diff options
author | Francesco Ruggeri <fruggeri@arista.com> | 2019-03-02 00:31:03 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-03-04 06:05:10 +0100 |
commit | 9036b2fe092a107856edd1a3bad48b83f2b45000 (patch) | |
tree | b9e330a8e765941112abcccfe48d968eca75bd4d /net/ipv6/ipv6_sockglue.c | |
parent | net: fixup address-space warnings in compat_mc_{get,set}sockopt() (diff) | |
download | linux-9036b2fe092a107856edd1a3bad48b83f2b45000.tar.xz linux-9036b2fe092a107856edd1a3bad48b83f2b45000.zip |
net: ipv6: add socket option IPV6_ROUTER_ALERT_ISOLATE
By default IPv6 socket with IPV6_ROUTER_ALERT socket option set will
receive all IPv6 RA packets from all namespaces.
IPV6_ROUTER_ALERT_ISOLATE socket option restricts packets received by
the socket to be only from the socket's namespace.
Signed-off-by: Maxim Martynov <maxim@arista.com>
Signed-off-by: Francesco Ruggeri <fruggeri@arista.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ipv6_sockglue.c')
-rw-r--r-- | net/ipv6/ipv6_sockglue.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 973e215c3114..40f21fef25ff 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c @@ -787,6 +787,12 @@ done: goto e_inval; retv = ip6_ra_control(sk, val); break; + case IPV6_ROUTER_ALERT_ISOLATE: + if (optlen < sizeof(int)) + goto e_inval; + np->rtalert_isolate = valbool; + retv = 0; + break; case IPV6_MTU_DISCOVER: if (optlen < sizeof(int)) goto e_inval; @@ -1358,6 +1364,10 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, val = np->rxopt.bits.recvfragsize; break; + case IPV6_ROUTER_ALERT_ISOLATE: + val = np->rtalert_isolate; + break; + default: return -ENOPROTOOPT; } |