summaryrefslogtreecommitdiff
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
authorOlaf Kirch <okir@suse.de>2005-07-11 21:01:42 -0700
committerDavid S. Miller <davem@davemloft.net>2005-07-11 21:01:42 -0700
commit0b7f22aab4e960c75e82ad696ef852f9b0015e7d (patch)
tree4c689dd688fbe7cbb4c3c61e2b246d5f48805aa6 /net/ipv4/route.c
parentaf9debd461d10fe582c9c0e80eafa69f698331ed (diff)
downloadlinux-3.10-0b7f22aab4e960c75e82ad696ef852f9b0015e7d.tar.gz
linux-3.10-0b7f22aab4e960c75e82ad696ef852f9b0015e7d.tar.bz2
linux-3.10-0b7f22aab4e960c75e82ad696ef852f9b0015e7d.zip
[IPV4]: Prevent oops when printing martian source
In some cases, we may be generating packets with a source address that qualifies as martian. This can happen when we're in the middle of setting up the network, and netfilter decides to reject a packet with an RST. The IPv4 routing code would try to print a warning and oops, because locally generated packets do not have a valid skb->mac.raw pointer at this point. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 726ea5e8180..d675ff80b04 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1685,7 +1685,7 @@ static void ip_handle_martian_source(struct net_device *dev,
printk(KERN_WARNING "martian source %u.%u.%u.%u from "
"%u.%u.%u.%u, on dev %s\n",
NIPQUAD(daddr), NIPQUAD(saddr), dev->name);
- if (dev->hard_header_len) {
+ if (dev->hard_header_len && skb->mac.raw) {
int i;
unsigned char *p = skb->mac.raw;
printk(KERN_WARNING "ll header: ");