aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/core/dev.c6
-rw-r--r--net/ipv4/ip_tunnel.c7
2 files changed, 7 insertions, 6 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 58eb802584b9..1ed2b66a10a6 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1691,13 +1691,13 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
1691 kfree_skb(skb); 1691 kfree_skb(skb);
1692 return NET_RX_DROP; 1692 return NET_RX_DROP;
1693 } 1693 }
1694 skb_scrub_packet(skb);
1695 skb->protocol = eth_type_trans(skb, dev); 1694 skb->protocol = eth_type_trans(skb, dev);
1696 1695
1697 /* eth_type_trans() can set pkt_type. 1696 /* eth_type_trans() can set pkt_type.
1698 * clear pkt_type _after_ calling eth_type_trans() 1697 * call skb_scrub_packet() after it to clear pkt_type _after_ calling
1698 * eth_type_trans().
1699 */ 1699 */
1700 skb->pkt_type = PACKET_HOST; 1700 skb_scrub_packet(skb);
1701 1701
1702 return netif_rx(skb); 1702 return netif_rx(skb);
1703} 1703}
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index 9fdf8a6d95f3..fbc1094964bf 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -454,15 +454,16 @@ 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 if (tunnel->net != dev_net(tunnel->dev))
458 skb_scrub_packet(skb);
459
460 if (tunnel->dev->type == ARPHRD_ETHER) { 457 if (tunnel->dev->type == ARPHRD_ETHER) {
461 skb->protocol = eth_type_trans(skb, tunnel->dev); 458 skb->protocol = eth_type_trans(skb, tunnel->dev);
462 skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN); 459 skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN);
463 } else { 460 } else {
464 skb->dev = tunnel->dev; 461 skb->dev = tunnel->dev;
465 } 462 }
463
464 if (tunnel->net != dev_net(tunnel->dev))
465 skb_scrub_packet(skb);
466
466 gro_cells_receive(&tunnel->gro_cells, skb); 467 gro_cells_receive(&tunnel->gro_cells, skb);
467 return 0; 468 return 0;
468 469