diff options
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r-- | net/sctp/protocol.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index dd811a8456a8..cdd881142f2c 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -381,6 +381,10 @@ static int sctp_v4_addr_valid(union sctp_addr *addr, | |||
381 | struct sctp_sock *sp, | 381 | struct sctp_sock *sp, |
382 | const struct sk_buff *skb) | 382 | const struct sk_buff *skb) |
383 | { | 383 | { |
384 | /* IPv4 addresses not allowed */ | ||
385 | if (sp && ipv6_only_sock(sctp_opt2sk(sp))) | ||
386 | return 0; | ||
387 | |||
384 | /* Is this a non-unicast address or a unusable SCTP address? */ | 388 | /* Is this a non-unicast address or a unusable SCTP address? */ |
385 | if (IS_IPV4_UNUSABLE_ADDRESS(addr->v4.sin_addr.s_addr)) | 389 | if (IS_IPV4_UNUSABLE_ADDRESS(addr->v4.sin_addr.s_addr)) |
386 | return 0; | 390 | return 0; |
@@ -404,6 +408,9 @@ static int sctp_v4_available(union sctp_addr *addr, struct sctp_sock *sp) | |||
404 | !sysctl_ip_nonlocal_bind) | 408 | !sysctl_ip_nonlocal_bind) |
405 | return 0; | 409 | return 0; |
406 | 410 | ||
411 | if (ipv6_only_sock(sctp_opt2sk(sp))) | ||
412 | return 0; | ||
413 | |||
407 | return 1; | 414 | return 1; |
408 | } | 415 | } |
409 | 416 | ||