diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2008-07-19 02:05:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-19 02:05:40 -0400 |
commit | 7dab83de50c7b2b7ceac695a0b56fa6c0f95b0bc (patch) | |
tree | 979c6905f2ef643acccfea9ab9ed926e764e72c8 /net/sctp/protocol.c | |
parent | 6d0ccbac688207ca0616ab5094932af4db4747b3 (diff) |
sctp: Support ipv6only AF_INET6 sockets.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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 | ||