diff options
author | Alexei Starovoitov <ast@plumgrid.com> | 2013-11-12 17:39:13 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-11-14 02:39:53 -0500 |
commit | 81b9eab5ebbf0d5d54da4fc168cfb02c2adc76b8 (patch) | |
tree | 27470d9df44d0361aee2a5ce9f4e4420d166c6ac /net/ipv4 | |
parent | 52f48d0d9aaa621ffa5e08d79da99a3f8c93b848 (diff) |
core/dev: do not ignore dmac in dev_forward_skb()
commit 06a23fe31ca3
("core/dev: set pkt_type after eth_type_trans() in dev_forward_skb()")
and refactoring 64261f230a91
("dev: move skb_scrub_packet() after eth_type_trans()")
are forcing pkt_type to be PACKET_HOST when skb traverses veth.
which means that ip forwarding will kick in inside netns
even if skb->eth->h_dest != dev->dev_addr
Fix order of eth_type_trans() and skb_scrub_packet() in dev_forward_skb()
and in ip_tunnel_rcv()
Fixes: 06a23fe31ca3 ("core/dev: set pkt_type after eth_type_trans() in dev_forward_skb()")
CC: Isaku Yamahata <yamahatanetdev@gmail.com>
CC: Maciej Zenczykowski <zenczykowski@gmail.com>
CC: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ip_tunnel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index 63a6d6d6b875..254f11c24aa5 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c | |||
@@ -454,6 +454,8 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb, | |||
454 | tstats->rx_bytes += skb->len; | 454 | tstats->rx_bytes += skb->len; |
455 | u64_stats_update_end(&tstats->syncp); | 455 | u64_stats_update_end(&tstats->syncp); |
456 | 456 | ||
457 | skb_scrub_packet(skb, !net_eq(tunnel->net, dev_net(tunnel->dev))); | ||
458 | |||
457 | if (tunnel->dev->type == ARPHRD_ETHER) { | 459 | if (tunnel->dev->type == ARPHRD_ETHER) { |
458 | skb->protocol = eth_type_trans(skb, tunnel->dev); | 460 | skb->protocol = eth_type_trans(skb, tunnel->dev); |
459 | skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN); | 461 | skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN); |
@@ -461,8 +463,6 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb, | |||
461 | skb->dev = tunnel->dev; | 463 | skb->dev = tunnel->dev; |
462 | } | 464 | } |
463 | 465 | ||
464 | skb_scrub_packet(skb, !net_eq(tunnel->net, dev_net(tunnel->dev))); | ||
465 | |||
466 | gro_cells_receive(&tunnel->gro_cells, skb); | 466 | gro_cells_receive(&tunnel->gro_cells, skb); |
467 | return 0; | 467 | return 0; |
468 | 468 | ||