Skip to content

Commit afcaf61

Browse files
lxinklassert
authored andcommitted
xfrm: allow to accept packets with ipv6 NEXTHDR_HOP in xfrm_input
For beet mode, when it's ipv6 inner address with nexthdrs set, the packet format might be: ---------------------------------------------------- | outer | | dest | | | ESP | ESP | | IP hdr | ESP | opts.| TCP | Data | Trailer | ICV | ---------------------------------------------------- The nexthdr from ESP could be NEXTHDR_HOP(0), so it should continue processing the packet when nexthdr returns 0 in xfrm_input(). Otherwise, when ipv6 nexthdr is set, the packet will be dropped. I don't see any error cases that nexthdr may return 0. So fix it by removing the check for nexthdr == 0. Fixes: 1da177e ("Linux-2.6.12-rc2") Signed-off-by: Xin Long <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent 91fac45 commit afcaf61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/xfrm/xfrm_input.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
644644
dev_put(skb->dev);
645645

646646
spin_lock(&x->lock);
647-
if (nexthdr <= 0) {
647+
if (nexthdr < 0) {
648648
if (nexthdr == -EBADMSG) {
649649
xfrm_audit_state_icvfail(x, skb,
650650
x->type->proto);

0 commit comments

Comments
 (0)