mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
sctp: Support ipv6only AF_INET6 sockets.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
6d0ccbac68
commit
7dab83de50
6 changed files with 93 additions and 10 deletions
|
@ -381,6 +381,10 @@ static int sctp_v4_addr_valid(union sctp_addr *addr,
|
|||
struct sctp_sock *sp,
|
||||
const struct sk_buff *skb)
|
||||
{
|
||||
/* IPv4 addresses not allowed */
|
||||
if (sp && ipv6_only_sock(sctp_opt2sk(sp)))
|
||||
return 0;
|
||||
|
||||
/* Is this a non-unicast address or a unusable SCTP address? */
|
||||
if (IS_IPV4_UNUSABLE_ADDRESS(addr->v4.sin_addr.s_addr))
|
||||
return 0;
|
||||
|
@ -404,6 +408,9 @@ static int sctp_v4_available(union sctp_addr *addr, struct sctp_sock *sp)
|
|||
!sysctl_ip_nonlocal_bind)
|
||||
return 0;
|
||||
|
||||
if (ipv6_only_sock(sctp_opt2sk(sp)))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue