diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-01-13 16:23:35 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-01-13 16:26:51 +0100 |
commit | 2b2d7fdc42475019e5ce3eabc9c9673e3c13d89f (patch) | |
tree | e7409c870c39a10241875454e345d5ec16517738 /pfinet/linux-src/include/net | |
parent | 03be85eb11f756414aafedca22f93a3351b727b8 (diff) |
[IPV6]: Add IPV6_V6ONLY socket option support.
Cherry-picked from Linux 524354b4d086a4f013343d727eaccb7b4c39eb25
* pfinet/glue-include/linux/ipv6.h: Include linux/config.h>
(__ipv6_only_sock, ipv6_only_sock): New macros
* pfinet/linux-src/include/linux/ipv6.h: Likewise.
* pfinet/linux-src/include/linux/in6.h (IPV6_V6ONLY): New macro.
* pfinet/linux-src/include/linux/sysctl.h (NET_IPV6_BINDV6ONLY): New macro.
* pfinet/linux-src/include/net/ipv6.h (sysctl_ipv6_bindv6only): Declare
variable.
* pfinet/linux-src/include/net/sock.h (ipv6_pinfo): Add ipv6only field.
* pfinet/linux-src/net/ipv4/tcp_ipv4.c: Include linux/ipv6.h.
(tcp_v4_get_port, tcp_v4_lookup_listener): Test for ipv6_only_sock.
* pfinet/linux-src/net/ipv4/udp.c: Include linux/ipv6.h.
(udp_v4_get_port, udp_v4_lookup_longway, udp_v4_mcast_next): Test for
ipv6_only_sock.
* pfinet/linux-src/net/ipv6/af_inet6.c (sysctl_ipv6_bindv6only): New
variable.
(inet6_create): Initialize ipv6only field to sysctl_ipv6_bindv6only.
* pfinet/linux-src/net/ipv6/ipv6_sockglue.c (ipv6_setsockopt): Test for
ipv6_only_sock.
(ipv6_setsockopt, ipv6_getsockopt): Support IPV6_V6ONLY case.
* pfinet/linux-src/net/ipv6/tcp_ipv6.c (ipv6_rcv_saddr_equal): New inline
function.
(tcp_v6_get_port): Replace old tests with ipv6_rcv_saddr_equal.
(tcp_v6_connect): Test for __ipv6_only_sock.
* pfinet/linux-src/net/ipv6/udp_ipv6.c (udv6_rcv_saddr_equal): New inline
function.
(udp_v6_get_port): Replace old tests with udv6_rcv_saddr_equal.
(udpv6_connect, udpv6_sendmsg): Test for __ipv6_only_sock.
Diffstat (limited to 'pfinet/linux-src/include/net')
-rw-r--r-- | pfinet/linux-src/include/net/ipv6.h | 3 | ||||
-rw-r--r-- | pfinet/linux-src/include/net/sock.h | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/pfinet/linux-src/include/net/ipv6.h b/pfinet/linux-src/include/net/ipv6.h index 50e2299f..77520eeb 100644 --- a/pfinet/linux-src/include/net/ipv6.h +++ b/pfinet/linux-src/include/net/ipv6.h @@ -86,6 +86,9 @@ struct frag_hdr { #include <net/sock.h> +/* sysctls */ +extern int sysctl_ipv6_bindv6only; + extern struct ipv6_mib ipv6_statistics; extern struct icmpv6_mib icmpv6_statistics; extern struct udp_mib udp_stats_in6; diff --git a/pfinet/linux-src/include/net/sock.h b/pfinet/linux-src/include/net/sock.h index 7789ec40..96fdfe8b 100644 --- a/pfinet/linux-src/include/net/sock.h +++ b/pfinet/linux-src/include/net/sock.h @@ -170,7 +170,8 @@ struct ipv6_pinfo { __u8 mc_loop:1, recverr:1, sndflow:1, - pmtudisc:2; + pmtudisc:2, + ipv6only:1; struct ipv6_mc_socklist *ipv6_mc_list; struct ipv6_fl_socklist *ipv6_fl_list; |