mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-15 17:43:59 +00:00
dev: move skb_scrub_packet() after eth_type_trans()
skb_scrub_packet() was called before eth_type_trans() to let eth_type_trans() set pkt_type. In fact, we should force pkt_type to PACKET_HOST, so move the call after eth_type_trans(). Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
fc4eba58b4
commit
64261f230a
@ -1691,13 +1691,13 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
|
|||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
return NET_RX_DROP;
|
return NET_RX_DROP;
|
||||||
}
|
}
|
||||||
skb_scrub_packet(skb);
|
|
||||||
skb->protocol = eth_type_trans(skb, dev);
|
skb->protocol = eth_type_trans(skb, dev);
|
||||||
|
|
||||||
/* eth_type_trans() can set pkt_type.
|
/* eth_type_trans() can set pkt_type.
|
||||||
* clear pkt_type _after_ calling eth_type_trans()
|
* call skb_scrub_packet() after it to clear pkt_type _after_ calling
|
||||||
|
* eth_type_trans().
|
||||||
*/
|
*/
|
||||||
skb->pkt_type = PACKET_HOST;
|
skb_scrub_packet(skb);
|
||||||
|
|
||||||
return netif_rx(skb);
|
return netif_rx(skb);
|
||||||
}
|
}
|
||||||
|
@ -454,15 +454,16 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb,
|
|||||||
tstats->rx_bytes += skb->len;
|
tstats->rx_bytes += skb->len;
|
||||||
u64_stats_update_end(&tstats->syncp);
|
u64_stats_update_end(&tstats->syncp);
|
||||||
|
|
||||||
if (tunnel->net != dev_net(tunnel->dev))
|
|
||||||
skb_scrub_packet(skb);
|
|
||||||
|
|
||||||
if (tunnel->dev->type == ARPHRD_ETHER) {
|
if (tunnel->dev->type == ARPHRD_ETHER) {
|
||||||
skb->protocol = eth_type_trans(skb, tunnel->dev);
|
skb->protocol = eth_type_trans(skb, tunnel->dev);
|
||||||
skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN);
|
skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN);
|
||||||
} else {
|
} else {
|
||||||
skb->dev = tunnel->dev;
|
skb->dev = tunnel->dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tunnel->net != dev_net(tunnel->dev))
|
||||||
|
skb_scrub_packet(skb);
|
||||||
|
|
||||||
gro_cells_receive(&tunnel->gro_cells, skb);
|
gro_cells_receive(&tunnel->gro_cells, skb);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user