Skip to content

Commit

Permalink
[NET]: Fix OOPS due to missing check in dev_parse_header().
Browse files Browse the repository at this point in the history
[ 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: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Oct 18, 2007
1 parent df2e014 commit 1b83336
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ static inline int dev_parse_header(const struct sk_buff *skb,
{
const struct net_device *dev = skb->dev;

if (!dev->header_ops->parse)
if (!dev->header_ops || !dev->header_ops->parse)
return 0;
return dev->header_ops->parse(skb, haddr);
}
Expand Down

0 comments on commit 1b83336

Please sign in to comment.