Commit cd3bafc7 authored by Hajime Tazaki's avatar Hajime Tazaki Committed by Steffen Klassert

xfrm6: Fix a offset value for network header in _decode_session6

When a network-layer header has multiple IPv6 extension headers, then offset
for mobility header goes wrong. This regression breaks an xfrm policy lookup
for a particular receive packet. Binding update packets of Mobile IPv6
are all discarded without this fix.

Fixes: de3b7a06 ("xfrm6: Fix transport header offset in _decode_session6.")
Signed-off-by: default avatarHajime Tazaki <tazaki@sfc.wide.ad.jp>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent 59343cd7
...@@ -200,6 +200,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse) ...@@ -200,6 +200,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
#if IS_ENABLED(CONFIG_IPV6_MIP6) #if IS_ENABLED(CONFIG_IPV6_MIP6)
case IPPROTO_MH: case IPPROTO_MH:
offset += ipv6_optlen(exthdr);
if (!onlyproto && pskb_may_pull(skb, nh + offset + 3 - skb->data)) { if (!onlyproto && pskb_may_pull(skb, nh + offset + 3 - skb->data)) {
struct ip6_mh *mh; struct ip6_mh *mh;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment