struct xfrm_state *x;
int xfrm_nr = 0;
int decaps = 0;
- int nexthdr;
- unsigned int nhoff;
+ int nexthdr = 0;
+ u8 *prevhdr = NULL;
- nhoff = *nhoffp;
- nexthdr = skb->nh.raw[nhoff];
+ ip6_find_1stfragopt(skb, &prevhdr);
+ nexthdr = *prevhdr;
+ *nhoffp = prevhdr - skb->nh.raw;
if ((err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) != 0)
goto drop;
if (nexthdr <= 0)
goto drop_unlock;
- skb->nh.raw[nhoff] = nexthdr;
-
if (x->props.replay_window)
xfrm_replay_advance(x, seq);