Skip to content

Commit

Permalink
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/klassert/ipsec

Steffen Klassert says:

====================
ipsec 2015-01-26

Just two small fixes for _decode_session6() where we
might decode to wrong header information in some rare
situations.

Please pull or let me know if there are problems.
====================

Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed Jan 27, 2015
2 parents 6e9e16e + f855691 commit bf693f7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions net/ipv6/xfrm6_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,18 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
{
struct flowi6 *fl6 = &fl->u.ip6;
int onlyproto = 0;
u16 offset = skb_network_header_len(skb);
const struct ipv6hdr *hdr = ipv6_hdr(skb);
u16 offset = sizeof(*hdr);
struct ipv6_opt_hdr *exthdr;
const unsigned char *nh = skb_network_header(skb);
u8 nexthdr = nh[IP6CB(skb)->nhoff];
u16 nhoff = IP6CB(skb)->nhoff;
int oif = 0;
u8 nexthdr;

if (!nhoff)
nhoff = offsetof(struct ipv6hdr, nexthdr);

nexthdr = nh[nhoff];

if (skb_dst(skb))
oif = skb_dst(skb)->dev->ifindex;
Expand Down

0 comments on commit bf693f7

Please sign in to comment.