]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ipv6: re-enable fragment header matching in ipv6_find_hdr
authorFlorian Westphal <fw@strlen.de>
Tue, 1 Mar 2016 15:15:16 +0000 (16:15 +0100)
committerDhaval Giani <dhaval.giani@oracle.com>
Fri, 20 Jan 2017 22:22:00 +0000 (17:22 -0500)
commit92314cd390b3b3eb99fe72b4df7a015b8e9e37f2
treed65d0630f25a2f600613db7452feaf65e4f65217
parent8a149d9ce6a1fdcb8443d46fbeebc157f60efba7
ipv6: re-enable fragment header matching in ipv6_find_hdr

Orabug: 25308047

[ Upstream commit 5d150a985520bbe3cb2aa1ceef24a7e32f20c15f ]

When ipv6_find_hdr is used to find a fragment header
(caller specifies target NEXTHDR_FRAGMENT) we erronously return
-ENOENT for all fragments with nonzero offset.

Before commit 9195bb8e381d, when target was specified, we did not
enter the exthdr walk loop as nexthdr == target so this used to work.

Now we do (so we can skip empty route headers). When we then stumble upon
a frag with nonzero frag_off we must return -ENOENT ("header not found")
only if the caller did not specifically request NEXTHDR_FRAGMENT.

This allows nfables exthdr expression to match ipv6 fragments, e.g. via

nft add rule ip6 filter input frag frag-off gt 0

Fixes: 9195bb8e381d ("ipv6: improve ipv6_find_hdr() to skip empty routing headers")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit af4f7a3ca6a0928551220a7a8bea3cd3e70b873e)
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
net/ipv6/exthdrs_core.c