Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40540
b: refs/heads/master
c: 4f44430
h: refs/heads/master
v: v3
  • Loading branch information
Vlad Yasevich authored and David S. Miller committed Oct 31, 2006
1 parent 7ecb144 commit f9c88b8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f8687afefcc821fc47c75775eec87731fe3de360
refs/heads/master: 4f4443088b763ca4ac7521e9b4a881b52c294dec
2 changes: 1 addition & 1 deletion trunk/net/sctp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ static struct sock *sctp_v4_create_accept_sk(struct sock *sk,
newinet->dport = htons(asoc->peer.port);
newinet->daddr = asoc->peer.primary_addr.v4.sin_addr.s_addr;
newinet->pmtudisc = inet->pmtudisc;
newinet->id = 0;
newinet->id = asoc->next_tsn ^ jiffies;

newinet->uc_ttl = -1;
newinet->mc_loop = 1;
Expand Down
9 changes: 9 additions & 0 deletions trunk/net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit f9c88b8

Please sign in to comment.