Commit 1b83336b authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[NET]: Fix OOPS due to missing check in dev_parse_header().

[ This is kernel bugzilla 9174 "linux-2.6.23-git11 kernel panic" ]

The device in question is an IPv6-over-IPv4 tunnel, which doesn't have
any header_ops, so the crash happens in dev_parse_header when
dereferencing them.
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent df2e014b
...@@ -827,7 +827,7 @@ static inline int dev_parse_header(const struct sk_buff *skb, ...@@ -827,7 +827,7 @@ static inline int dev_parse_header(const struct sk_buff *skb,
{ {
const struct net_device *dev = skb->dev; const struct net_device *dev = skb->dev;
if (!dev->header_ops->parse) if (!dev->header_ops || !dev->header_ops->parse)
return 0; return 0;
return dev->header_ops->parse(skb, haddr); return dev->header_ops->parse(skb, haddr);
} }
......
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