Skip to content

Commit 9d2d38c

Browse files
Zhang Yunkaidavem330
authored andcommitted
ipv4: add description about martian source
When multiple containers are running in the environment and multiple macvlan network port are configured in each container, a lot of martian source prints will appear after martian_log is enabled. they are almost the same, and printed by net_warn_ratelimited. Each arp message will trigger this print on each network port. Such as: IPv4: martian source 173.254.95.16 from 173.254.100.109, on dev eth0 ll header: 00000000: ff ff ff ff ff ff 40 00 ad fe 64 6d 08 06 ......@...dm.. IPv4: martian source 173.254.95.16 from 173.254.100.109, on dev eth1 ll header: 00000000: ff ff ff ff ff ff 40 00 ad fe 64 6d 08 06 ......@...dm.. There is no description of this kind of source in the RFC1812. Signed-off-by: Zhang Yunkai <zhang.yunkai@zte.com.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2520611 commit 9d2d38c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/ipv4/fib_frontend.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,9 @@ int fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst,
436436
if (net->ipv4.fib_has_custom_local_routes ||
437437
fib4_has_custom_rules(net))
438438
goto full_check;
439+
/* Within the same container, it is regarded as a martian source,
440+
* and the same host but different containers are not.
441+
*/
439442
if (inet_lookup_ifaddr_rcu(net, src))
440443
return -EINVAL;
441444

0 commit comments

Comments
 (0)