History

net: clear skb->priority when forwarding to another netns

skb->priority can be set for two purposes: 1) With respect to IP TOS field, which is computed by a mask. Ususally used for priority qdisc's (pfifo, prio etc.), on TX side (we only have ingress qdisc on RX side). 2) Used as a classid or flowid, works in the same way with tc classid. What's more, this can even override the classid of tc filters. For case 1), it has been respected within its netns, I don't see any point of keeping it for another netns, especially when packets will be forwarded to Rx path (no matter from TX path or RX path). For case 2) we care, our applications run inside a netns, and we classify the packets by our own filters outside, If some application sets this priority, it could bypass our filters, therefore clear it when moving out of a netns, it makes no sense to bypass tc filters out of its netns.

WANG Cong committed 11 years ago

Commit 08b4b8e1 parent a659f911 file · +1 −0Browse files

Unified · Split

net/core/dev.c+1−0
@@ -1696,6 +1696,7 @@ int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb) · 1695 unmodified lines
16961696 }
16971697
16981698 skb_scrub_packet(skb, true);
1699+ skb->priority = 0;
16991700 skb->protocol = eth_type_trans(skb, dev);
17001701 skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN);
17011702