diff options
author | David Lebrun <david.lebrun@uclouvain.be> | 2016-11-08 16:59:21 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-10 04:40:06 +0300 |
commit | a149e7c7ce812561f0fdc7a86ddc42f294e5eb3e (patch) | |
tree | 04c5b7531a8d4bd7060f4d92e895a113515085b8 /net/ipv6/ipv6_sockglue.c | |
parent | 613fa3ca9e9e6af57927dab238121010c510fe4c (diff) | |
download | linux-a149e7c7ce812561f0fdc7a86ddc42f294e5eb3e.tar.xz |
ipv6: sr: add support for SRH injection through setsockopt
This patch adds support for per-socket SRH injection with the setsockopt
system call through the IPPROTO_IPV6, IPV6_RTHDR options.
The SRH is pushed through the ipv6_push_nfrag_opts function.
Signed-off-by: David Lebrun <david.lebrun@uclouvain.be>
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 6c126780fcf2..3ba530373560 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c @@ -52,6 +52,7 @@ #include <net/udplite.h> #include <net/xfrm.h> #include <net/compat.h> +#include <net/seg6.h> #include <asm/uaccess.h> @@ -430,6 +431,15 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, break; #endif + case IPV6_SRCRT_TYPE_4: + { + struct ipv6_sr_hdr *srh = (struct ipv6_sr_hdr *) + opt->srcrt; + + if (!seg6_validate_srh(srh, optlen)) + goto sticky_done; + break; + } default: goto sticky_done; } |