diff options
Diffstat (limited to 'net/ipv6/xfrm6_policy.c')
-rw-r--r-- | net/ipv6/xfrm6_policy.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 5f983644373a..48bf5a06847b 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c | |||
@@ -130,12 +130,18 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse) | |||
130 | { | 130 | { |
131 | struct flowi6 *fl6 = &fl->u.ip6; | 131 | struct flowi6 *fl6 = &fl->u.ip6; |
132 | int onlyproto = 0; | 132 | int onlyproto = 0; |
133 | u16 offset = skb_network_header_len(skb); | ||
134 | const struct ipv6hdr *hdr = ipv6_hdr(skb); | 133 | const struct ipv6hdr *hdr = ipv6_hdr(skb); |
134 | u16 offset = sizeof(*hdr); | ||
135 | struct ipv6_opt_hdr *exthdr; | 135 | struct ipv6_opt_hdr *exthdr; |
136 | const unsigned char *nh = skb_network_header(skb); | 136 | const unsigned char *nh = skb_network_header(skb); |
137 | u8 nexthdr = nh[IP6CB(skb)->nhoff]; | 137 | u16 nhoff = IP6CB(skb)->nhoff; |
138 | int oif = 0; | 138 | int oif = 0; |
139 | u8 nexthdr; | ||
140 | |||
141 | if (!nhoff) | ||
142 | nhoff = offsetof(struct ipv6hdr, nexthdr); | ||
143 | |||
144 | nexthdr = nh[nhoff]; | ||
139 | 145 | ||
140 | if (skb_dst(skb)) | 146 | if (skb_dst(skb)) |
141 | oif = skb_dst(skb)->dev->ifindex; | 147 | oif = skb_dst(skb)->dev->ifindex; |