sctp: fix to only enable IPv6 address support on PF_INET6 socket

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>
This commit is contained in:
Wei Yongjun 2009-04-07 16:35:11 +08:00 committed by Vlad Yasevich
parent 4553e88d87
commit a2c395846c
1 changed files with 2 additions and 1 deletions

View File

@ -293,6 +293,7 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
* told otherwise.
*/
asoc->peer.ipv4_address = 1;
if (asoc->base.sk->sk_family == PF_INET6)
asoc->peer.ipv6_address = 1;
INIT_LIST_HEAD(&asoc->asocs);