diff options
Diffstat (limited to 'include/net/pkt_sched.h')
-rw-r--r-- | include/net/pkt_sched.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 27a33833ff4a..fe6e7aac3c56 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/jiffies.h> | 4 | #include <linux/jiffies.h> |
5 | #include <linux/ktime.h> | 5 | #include <linux/ktime.h> |
6 | #include <linux/if_vlan.h> | ||
6 | #include <net/sch_generic.h> | 7 | #include <net/sch_generic.h> |
7 | 8 | ||
8 | struct qdisc_walker { | 9 | struct qdisc_walker { |
@@ -114,6 +115,17 @@ int tc_classify_compat(struct sk_buff *skb, const struct tcf_proto *tp, | |||
114 | int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp, | 115 | int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp, |
115 | struct tcf_result *res); | 116 | struct tcf_result *res); |
116 | 117 | ||
118 | static inline __be16 tc_skb_protocol(const struct sk_buff *skb) | ||
119 | { | ||
120 | /* We need to take extra care in case the skb came via | ||
121 | * vlan accelerated path. In that case, use skb->vlan_proto | ||
122 | * as the original vlan header was already stripped. | ||
123 | */ | ||
124 | if (vlan_tx_tag_present(skb)) | ||
125 | return skb->vlan_proto; | ||
126 | return skb->protocol; | ||
127 | } | ||
128 | |||
117 | /* Calculate maximal size of packet seen by hard_start_xmit | 129 | /* Calculate maximal size of packet seen by hard_start_xmit |
118 | routine of this device. | 130 | routine of this device. |
119 | */ | 131 | */ |