Skip to content

Commit

Permalink
sctp: fix to only enable IPv6 address support on PF_INET6 socket
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Vlad Yasevich committed Jun 3, 2009
1 parent 4553e88 commit a2c3958
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/sctp/associola.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a2c3958

Please sign in to comment.