]> err.no Git - linux-2.6/commitdiff
[NET]: Fix OOPS due to missing check in dev_parse_header().
authorPatrick McHardy <kaber@trash.net>
Thu, 18 Oct 2007 12:09:28 +0000 (05:09 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Oct 2007 12:09:28 +0000 (05:09 -0700)
[ 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>
include/linux/netdevice.h

index 39dd83b183a91d0f8fa9ce27a4f8ed84c8a238a8..452c88d971ade860fbd159b9d7319017cfd49826 100644 (file)
@@ -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);
 }