|
@@ -3372,6 +3372,7 @@ SCTP_STATIC int sctp_do_peeloff(struct sctp_association *asoc,
|
|
{
|
|
{
|
|
struct sock *sk = asoc->base.sk;
|
|
struct sock *sk = asoc->base.sk;
|
|
struct socket *sock;
|
|
struct socket *sock;
|
|
|
|
+ struct inet_sock *inetsk;
|
|
int err = 0;
|
|
int err = 0;
|
|
|
|
|
|
/* An association cannot be branched off from an already peeled-off
|
|
/* 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.
|
|
* asoc to the newsk.
|
|
*/
|
|
*/
|
|
sctp_sock_migrate(sk, sock->sk, asoc, SCTP_SOCKET_UDP_HIGH_BANDWIDTH);
|
|
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;
|
|
*sockp = sock;
|
|
|
|
|
|
return err;
|
|
return err;
|