diff options
author | David Woodhouse <dwmw2@infradead.org> | 2006-12-01 10:56:43 +0100 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-12-01 10:56:43 +0100 |
commit | bd3c97a7c718bfb9f1e4f31c16c383a5c6f815eb (patch) | |
tree | 3f56594e813c6f35cbacbdb3e137ba5bfd0b3069 /net/sctp/socket.c | |
parent | [MTD] bugfix: DataFlash is not bit writable (diff) | |
parent | Linux 2.6.19 (diff) | |
download | linux-bd3c97a7c718bfb9f1e4f31c16c383a5c6f815eb.tar.xz linux-bd3c97a7c718bfb9f1e4f31c16c383a5c6f815eb.zip |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 9f34dec6ff8e..935bc9187fd8 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -3372,6 +3372,7 @@ SCTP_STATIC int sctp_do_peeloff(struct sctp_association *asoc, { struct sock *sk = asoc->base.sk; struct socket *sock; + struct inet_sock *inetsk; int err = 0; /* An association cannot be branched off from an already peeled-off @@ -3389,6 +3390,14 @@ SCTP_STATIC int sctp_do_peeloff(struct sctp_association *asoc, * asoc to the newsk. */ sctp_sock_migrate(sk, sock->sk, asoc, SCTP_SOCKET_UDP_HIGH_BANDWIDTH); + + /* Make peeled-off sockets more like 1-1 accepted sockets. + * Set the daddr and initialize id to something more random + */ + inetsk = inet_sk(sock->sk); + inetsk->daddr = asoc->peer.primary_addr.v4.sin_addr.s_addr; + inetsk->id = asoc->next_tsn ^ jiffies; + *sockp = sock; return err; |