sctp: fix to only enable IPv6 address support on PF_INET6 socket
authorWei Yongjun <yjwei@cn.fujitsu.com>
Tue, 7 Apr 2009 08:35:11 +0000 (16:35 +0800)
committerVlad Yasevich <vladislav.yasevich@hp.com>
Wed, 3 Jun 2009 13:14:46 +0000 (09:14 -0400)
If socket is create by PF_INET type, it can not used IPv6 address
to send/recv DATA. So only enable IPv6 address support on PF_INET6
socket.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
net/sctp/associola.c

index f4b23043b610b85a7a004770569fa5a01e0e932a..e7b69a7360e2f6249b0f1bf33dc25037931246e4 100644 (file)
@@ -293,7 +293,8 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
         * told otherwise.
         */
        asoc->peer.ipv4_address = 1;
-       asoc->peer.ipv6_address = 1;
+       if (asoc->base.sk->sk_family == PF_INET6)
+               asoc->peer.ipv6_address = 1;
        INIT_LIST_HEAD(&asoc->asocs);
 
        asoc->autoclose = sp->autoclose;