aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sched/sch_choke.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
index ee1e2090eebe..06afbaeb4c88 100644
--- a/net/sched/sch_choke.c
+++ b/net/sched/sch_choke.c
@@ -219,14 +219,25 @@ static bool choke_match_flow(struct sk_buff *skb1,
219 return *ports1 == *ports2; 219 return *ports1 == *ports2;
220} 220}
221 221
222struct choke_skb_cb {
223 u16 classid;
224};
225
226static inline struct choke_skb_cb *choke_skb_cb(const struct sk_buff *skb)
227{
228 BUILD_BUG_ON(sizeof(skb->cb) <
229 sizeof(struct qdisc_skb_cb) + sizeof(struct choke_skb_cb));
230 return (struct choke_skb_cb *)qdisc_skb_cb(skb)->data;
231}
232
222static inline void choke_set_classid(struct sk_buff *skb, u16 classid) 233static inline void choke_set_classid(struct sk_buff *skb, u16 classid)
223{ 234{
224 *(unsigned int *)(qdisc_skb_cb(skb)->data) = classid; 235 choke_skb_cb(skb)->classid = classid;
225} 236}
226 237
227static u16 choke_get_classid(const struct sk_buff *skb) 238static u16 choke_get_classid(const struct sk_buff *skb)
228{ 239{
229 return *(unsigned int *)(qdisc_skb_cb(skb)->data); 240 return choke_skb_cb(skb)->classid;
230} 241}
231 242
232/* 243/*