diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2007-05-15 16:32:39 -0400 |
---|---|---|
committer | Vladislav Yasevich <vxy@hera.kernel.org> | 2007-06-13 16:44:41 -0400 |
commit | d570ee490fb18220262cfe41284d7aede797ed4f (patch) | |
tree | 4b223d7dae740975118dbe79c590910dab6f647a /net/sctp | |
parent | 66e1e3b20cbbf99da63e6c1af0fc6d39c2ed099a (diff) |
[SCTP]: Correctly set daddr for IPv6 sockets during peeloff
During peeloff of AF_INET6 socket, the inet6_sk(sk)->daddr
wasn't set correctly since the code was assuming IPv4 only.
Now we use a correct call to set the destination address.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Acked-by: Sridhar Samudrala <sri@us.ibm.com>
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/socket.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 4dcdabf56473..d370c945a757 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -3550,6 +3550,7 @@ SCTP_STATIC int sctp_do_peeloff(struct sctp_association *asoc, | |||
3550 | struct sock *sk = asoc->base.sk; | 3550 | struct sock *sk = asoc->base.sk; |
3551 | struct socket *sock; | 3551 | struct socket *sock; |
3552 | struct inet_sock *inetsk; | 3552 | struct inet_sock *inetsk; |
3553 | struct sctp_af *af; | ||
3553 | int err = 0; | 3554 | int err = 0; |
3554 | 3555 | ||
3555 | /* An association cannot be branched off from an already peeled-off | 3556 | /* An association cannot be branched off from an already peeled-off |
@@ -3571,8 +3572,9 @@ SCTP_STATIC int sctp_do_peeloff(struct sctp_association *asoc, | |||
3571 | /* Make peeled-off sockets more like 1-1 accepted sockets. | 3572 | /* Make peeled-off sockets more like 1-1 accepted sockets. |
3572 | * Set the daddr and initialize id to something more random | 3573 | * Set the daddr and initialize id to something more random |
3573 | */ | 3574 | */ |
3575 | af = sctp_get_af_specific(asoc->peer.primary_addr.sa.sa_family); | ||
3576 | af->to_sk_daddr(&asoc->peer.primary_addr, sk); | ||
3574 | inetsk = inet_sk(sock->sk); | 3577 | inetsk = inet_sk(sock->sk); |
3575 | inetsk->daddr = asoc->peer.primary_addr.v4.sin_addr.s_addr; | ||
3576 | inetsk->id = asoc->next_tsn ^ jiffies; | 3578 | inetsk->id = asoc->next_tsn ^ jiffies; |
3577 | 3579 | ||
3578 | *sockp = sock; | 3580 | *sockp = sock; |