提交 0b7f22aa 编写于 作者: O Olaf Kirch 提交者: David S. Miller

[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: NDavid S. Miller <davem@davemloft.net>
上级 af9debd4
...@@ -1685,7 +1685,7 @@ static void ip_handle_martian_source(struct net_device *dev, ...@@ -1685,7 +1685,7 @@ static void ip_handle_martian_source(struct net_device *dev,
printk(KERN_WARNING "martian source %u.%u.%u.%u from " printk(KERN_WARNING "martian source %u.%u.%u.%u from "
"%u.%u.%u.%u, on dev %s\n", "%u.%u.%u.%u, on dev %s\n",
NIPQUAD(daddr), NIPQUAD(saddr), dev->name); NIPQUAD(daddr), NIPQUAD(saddr), dev->name);
if (dev->hard_header_len) { if (dev->hard_header_len && skb->mac.raw) {
int i; int i;
unsigned char *p = skb->mac.raw; unsigned char *p = skb->mac.raw;
printk(KERN_WARNING "ll header: "); printk(KERN_WARNING "ll header: ");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册