Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d570ee490fb18220262cfe41284d7aede797ed4f
Commit:     d570ee490fb18220262cfe41284d7aede797ed4f
Parent:     66e1e3b20cbbf99da63e6c1af0fc6d39c2ed099a
Author:     Vlad Yasevich <[EMAIL PROTECTED]>
AuthorDate: Tue May 15 16:32:39 2007 -0400
Committer:  Vladislav Yasevich <[EMAIL PROTECTED]>
CommitDate: Wed Jun 13 20:44:41 2007 +0000

    [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 <[EMAIL PROTECTED]>
    Acked-by: Sridhar Samudrala <[EMAIL PROTECTED]>
---
 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 4dcdabf..d370c94 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,
        struct sock *sk = asoc->base.sk;
        struct socket *sock;
        struct inet_sock *inetsk;
+       struct sctp_af *af;
        int err = 0;
 
        /* 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,
        /* Make peeled-off sockets more like 1-1 accepted sockets.
         * Set the daddr and initialize id to something more random
         */
+       af = sctp_get_af_specific(asoc->peer.primary_addr.sa.sa_family);
+       af->to_sk_daddr(&asoc->peer.primary_addr, sk);
        inetsk = inet_sk(sock->sk);
-       inetsk->daddr = asoc->peer.primary_addr.v4.sin_addr.s_addr;
        inetsk->id = asoc->next_tsn ^ jiffies;
 
        *sockp = sock;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to