diff options
author | Shaun Pereira <pereira.shaun@gmail.com> | 2006-01-06 16:11:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-01-06 16:11:35 -0500 |
commit | a20a8554796bc4e28879beabd0db4bf3ce77b686 (patch) | |
tree | 2fdc866d3fe722e6eea6b6bb4017b9ab53927a62 /net/x25/af_x25.c | |
parent | 4bad4dc919573dbe9a5b41dd9edff279e99822d7 (diff) |
[X25]: Fix for broken x25 module.
When a user-space server application calls bind on a socket, then in kernel
space this bound socket is considered 'x25-linked' and the SOCK_ZAPPED flag
is unset.(As in x25_bind()/af_x25.c).
Now when a user-space client application attempts to connect to the server
on the listening socket, if the kernel accepts this in-coming call, then it
returns a new socket to userland and attempts to reply to the caller.
The reply/x25_sendmsg() will fail, because the new socket created on
call-accept has its SOCK_ZAPPED flag set by x25_make_new().
(sock_init_data() called by x25_alloc_socket() called by x25_make_new()
sets the flag to SOCK_ZAPPED)).
Fix: Using the sock_copy_flag() routine available in sock.h fixes this.
Tested on 32 and 64 bit kernels with x25 over tcp.
Signed-off-by: Shaun Pereira <pereira.shaun@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/x25/af_x25.c')
-rw-r--r-- | net/x25/af_x25.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 16459c7f54b2..bfabaf9cba87 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c | |||
@@ -540,12 +540,7 @@ static struct sock *x25_make_new(struct sock *osk) | |||
540 | sk->sk_state = TCP_ESTABLISHED; | 540 | sk->sk_state = TCP_ESTABLISHED; |
541 | sk->sk_sleep = osk->sk_sleep; | 541 | sk->sk_sleep = osk->sk_sleep; |
542 | sk->sk_backlog_rcv = osk->sk_backlog_rcv; | 542 | sk->sk_backlog_rcv = osk->sk_backlog_rcv; |
543 | 543 | sock_copy_flags(sk, osk); | |
544 | if (sock_flag(osk, SOCK_ZAPPED)) | ||
545 | sock_set_flag(sk, SOCK_ZAPPED); | ||
546 | |||
547 | if (sock_flag(osk, SOCK_DBG)) | ||
548 | sock_set_flag(sk, SOCK_DBG); | ||
549 | 544 | ||
550 | ox25 = x25_sk(osk); | 545 | ox25 = x25_sk(osk); |
551 | x25->t21 = ox25->t21; | 546 | x25->t21 = ox25->t21; |