Commit 27d30b0f authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [XFRM]: Fix missing protocol comparison of larval SAs.
  [WANROUTER]: Delete superfluous source file "net/wanrouter/af_wanpipe.c".
  [IPV4]: Fix warning in ip_mc_rejoin_group.
  [ROSE]: Socket locking is a great invention.
  [ROSE]: Remove ourselves from waitqueue when receiving a signal
  [NetLabel]: parse the CIPSO ranged tag on incoming packets
parents 2cb8a57b 75e252d9
...@@ -1933,6 +1933,11 @@ int cipso_v4_skbuff_getattr(const struct sk_buff *skb, ...@@ -1933,6 +1933,11 @@ int cipso_v4_skbuff_getattr(const struct sk_buff *skb,
&cipso_ptr[6], &cipso_ptr[6],
secattr); secattr);
break; break;
case CIPSO_V4_TAG_RANGE:
ret_val = cipso_v4_parsetag_rng(doi_def,
&cipso_ptr[6],
secattr);
break;
} }
skbuff_getattr_return: skbuff_getattr_return:
......
...@@ -1255,9 +1255,9 @@ out: ...@@ -1255,9 +1255,9 @@ out:
*/ */
void ip_mc_rejoin_group(struct ip_mc_list *im) void ip_mc_rejoin_group(struct ip_mc_list *im)
{ {
#ifdef CONFIG_IP_MULTICAST
struct in_device *in_dev = im->interface; struct in_device *in_dev = im->interface;
#ifdef CONFIG_IP_MULTICAST
if (im->multiaddr == IGMP_ALL_HOSTS) if (im->multiaddr == IGMP_ALL_HOSTS)
return; return;
......
...@@ -700,23 +700,7 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le ...@@ -700,23 +700,7 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
unsigned char cause, diagnostic; unsigned char cause, diagnostic;
struct net_device *dev; struct net_device *dev;
ax25_uid_assoc *user; ax25_uid_assoc *user;
int n; int n, err = 0;
if (sk->sk_state == TCP_ESTABLISHED && sock->state == SS_CONNECTING) {
sock->state = SS_CONNECTED;
return 0; /* Connect completed during a ERESTARTSYS event */
}
if (sk->sk_state == TCP_CLOSE && sock->state == SS_CONNECTING) {
sock->state = SS_UNCONNECTED;
return -ECONNREFUSED;
}
if (sk->sk_state == TCP_ESTABLISHED)
return -EISCONN; /* No reconnect on a seqpacket socket */
sk->sk_state = TCP_CLOSE;
sock->state = SS_UNCONNECTED;
if (addr_len != sizeof(struct sockaddr_rose) && addr_len != sizeof(struct full_sockaddr_rose)) if (addr_len != sizeof(struct sockaddr_rose) && addr_len != sizeof(struct full_sockaddr_rose))
return -EINVAL; return -EINVAL;
...@@ -734,24 +718,53 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le ...@@ -734,24 +718,53 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
if ((rose->source_ndigis + addr->srose_ndigis) > ROSE_MAX_DIGIS) if ((rose->source_ndigis + addr->srose_ndigis) > ROSE_MAX_DIGIS)
return -EINVAL; return -EINVAL;
lock_sock(sk);
if (sk->sk_state == TCP_ESTABLISHED && sock->state == SS_CONNECTING) {
/* Connect completed during a ERESTARTSYS event */
sock->state = SS_CONNECTED;
goto out_release;
}
if (sk->sk_state == TCP_CLOSE && sock->state == SS_CONNECTING) {
sock->state = SS_UNCONNECTED;
err = -ECONNREFUSED;
goto out_release;
}
if (sk->sk_state == TCP_ESTABLISHED) {
/* No reconnect on a seqpacket socket */
err = -EISCONN;
goto out_release;
}
sk->sk_state = TCP_CLOSE;
sock->state = SS_UNCONNECTED;
rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause,
&diagnostic); &diagnostic);
if (!rose->neighbour) if (!rose->neighbour)
return -ENETUNREACH; return -ENETUNREACH;
rose->lci = rose_new_lci(rose->neighbour); rose->lci = rose_new_lci(rose->neighbour);
if (!rose->lci) if (!rose->lci) {
return -ENETUNREACH; err = -ENETUNREACH;
goto out_release;
}
if (sock_flag(sk, SOCK_ZAPPED)) { /* Must bind first - autobinding in this may or may not work */ if (sock_flag(sk, SOCK_ZAPPED)) { /* Must bind first - autobinding in this may or may not work */
sock_reset_flag(sk, SOCK_ZAPPED); sock_reset_flag(sk, SOCK_ZAPPED);
if ((dev = rose_dev_first()) == NULL) if ((dev = rose_dev_first()) == NULL) {
return -ENETUNREACH; err = -ENETUNREACH;
goto out_release;
}
user = ax25_findbyuid(current->euid); user = ax25_findbyuid(current->euid);
if (!user) if (!user) {
return -EINVAL; err = -EINVAL;
goto out_release;
}
memcpy(&rose->source_addr, dev->dev_addr, ROSE_ADDR_LEN); memcpy(&rose->source_addr, dev->dev_addr, ROSE_ADDR_LEN);
rose->source_call = user->call; rose->source_call = user->call;
...@@ -789,8 +802,10 @@ rose_try_next_neigh: ...@@ -789,8 +802,10 @@ rose_try_next_neigh:
rose_start_t1timer(sk); rose_start_t1timer(sk);
/* Now the loop */ /* Now the loop */
if (sk->sk_state != TCP_ESTABLISHED && (flags & O_NONBLOCK)) if (sk->sk_state != TCP_ESTABLISHED && (flags & O_NONBLOCK)) {
return -EINPROGRESS; err = -EINPROGRESS;
goto out_release;
}
/* /*
* A Connect Ack with Choke or timeout or failed routing will go to * A Connect Ack with Choke or timeout or failed routing will go to
...@@ -805,8 +820,10 @@ rose_try_next_neigh: ...@@ -805,8 +820,10 @@ rose_try_next_neigh:
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
if (sk->sk_state != TCP_SYN_SENT) if (sk->sk_state != TCP_SYN_SENT)
break; break;
release_sock(sk);
if (!signal_pending(tsk)) { if (!signal_pending(tsk)) {
schedule(); schedule();
lock_sock(sk);
continue; continue;
} }
current->state = TASK_RUNNING; current->state = TASK_RUNNING;
...@@ -822,14 +839,19 @@ rose_try_next_neigh: ...@@ -822,14 +839,19 @@ rose_try_next_neigh:
rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, &diagnostic); rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, &diagnostic);
if (rose->neighbour) if (rose->neighbour)
goto rose_try_next_neigh; goto rose_try_next_neigh;
/* No more neighbour */
/* No more neighbours */
sock->state = SS_UNCONNECTED; sock->state = SS_UNCONNECTED;
return sock_error(sk); /* Always set at this point */ err = sock_error(sk); /* Always set at this point */
goto out_release;
} }
sock->state = SS_CONNECTED; sock->state = SS_CONNECTED;
return 0; out_release:
release_sock(sk);
return err;
} }
static int rose_accept(struct socket *sock, struct socket *newsock, int flags) static int rose_accept(struct socket *sock, struct socket *newsock, int flags)
...@@ -877,6 +899,8 @@ static int rose_accept(struct socket *sock, struct socket *newsock, int flags) ...@@ -877,6 +899,8 @@ static int rose_accept(struct socket *sock, struct socket *newsock, int flags)
lock_sock(sk); lock_sock(sk);
continue; continue;
} }
current->state = TASK_RUNNING;
remove_wait_queue(sk->sk_sleep, &wait);
return -ERESTARTSYS; return -ERESTARTSYS;
} }
current->state = TASK_RUNNING; current->state = TASK_RUNNING;
......
This diff is collapsed.
...@@ -704,7 +704,8 @@ static struct xfrm_state *__find_acq_core(unsigned short family, u8 mode, u32 re ...@@ -704,7 +704,8 @@ static struct xfrm_state *__find_acq_core(unsigned short family, u8 mode, u32 re
x->props.mode != mode || x->props.mode != mode ||
x->props.family != family || x->props.family != family ||
x->km.state != XFRM_STATE_ACQ || x->km.state != XFRM_STATE_ACQ ||
x->id.spi != 0) x->id.spi != 0 ||
x->id.proto != proto)
continue; continue;
switch (family) { switch (family) {
...@@ -801,7 +802,8 @@ int xfrm_state_add(struct xfrm_state *x) ...@@ -801,7 +802,8 @@ int xfrm_state_add(struct xfrm_state *x)
if (use_spi && x->km.seq) { if (use_spi && x->km.seq) {
x1 = __xfrm_find_acq_byseq(x->km.seq); x1 = __xfrm_find_acq_byseq(x->km.seq);
if (x1 && xfrm_addr_cmp(&x1->id.daddr, &x->id.daddr, family)) { if (x1 && ((x1->id.proto != x->id.proto) ||
xfrm_addr_cmp(&x1->id.daddr, &x->id.daddr, family))) {
xfrm_state_put(x1); xfrm_state_put(x1);
x1 = NULL; x1 = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment