From 9baee83406d6a4b02222f5ee21511c3f4c19e39d Mon Sep 17 00:00:00 2001 From: David Lebrun Date: Tue, 8 Nov 2016 14:59:19 +0100 Subject: ipv6: sr: add calls to verify and insert HMAC signatures This patch enables the verification of the HMAC signature for transiting SR-enabled packets, and its insertion on encapsulated/injected SRH. Signed-off-by: David Lebrun Signed-off-by: David S. Miller --- net/ipv6/exthdrs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'net/ipv6/exthdrs.c') diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index b8ba3961ff8a..541cfa6345e5 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c @@ -49,6 +49,9 @@ #endif #include #include +#ifdef CONFIG_IPV6_SEG6_HMAC +#include +#endif #include @@ -340,6 +343,13 @@ static int ipv6_srh_rcv(struct sk_buff *skb) return -1; } +#ifdef CONFIG_IPV6_SEG6_HMAC + if (!seg6_hmac_validate_skb(skb)) { + kfree_skb(skb); + return -1; + } +#endif + looped_back: if (hdr->segments_left > 0) { if (hdr->nexthdr != NEXTHDR_IPV6 && hdr->segments_left == 1 && -- cgit