Skip to content

Commit

Permalink
bridge: Pull ip header into skb->data before looking into ip header.
Browse files Browse the repository at this point in the history
If lower layer driver leaves the ip header in the skb fragment, it needs to
be first pulled into skb->data before inspecting ip header length or ip version
number.

Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sarveshwar Bandi authored and David S. Miller committed Oct 11, 2012
1 parent 435f08a commit 6caab7b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/bridge/br_netfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ static int br_parse_ip_options(struct sk_buff *skb)
struct net_device *dev = skb->dev;
u32 len;

if (!pskb_may_pull(skb, sizeof(struct iphdr)))
goto inhdr_error;

iph = ip_hdr(skb);
opt = &(IPCB(skb)->opt);

Expand Down

0 comments on commit 6caab7b

Please sign in to comment.