diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c index 715e01e..b6394ab 100644 --- a/net/sched/cls_fw.c +++ b/net/sched/cls_fw.c @@ -34,6 +34,7 @@ struct fw_head { u32 mask; bool mask_set; + bool old_method; struct fw_filter __rcu *ht[HTSIZE]; struct rcu_head rcu; }; @@ -65,7 +66,7 @@ static int fw_classify(struct sk_buff *skb, const struct tcf_proto *tp, int r; u32 id = skb->mark; - if (head != NULL) { + if (!head->old_method) { id &= head->mask; for (f = rcu_dereference_bh(head->ht[fw_hash(id)]); f; @@ -120,6 +121,7 @@ static int fw_init(struct tcf_proto *tp) if (head == NULL) return -ENOBUFS; + head->old_method = true; head->mask_set = false; rcu_assign_pointer(tp->root, head); return 0; @@ -302,6 +304,7 @@ static int fw_change(struct net *net, struct sk_buff *in_skb, if (!handle) return -EINVAL; + head->old_method = false; if (!head->mask_set) { head->mask = 0xFFFFFFFF; if (tb[TCA_FW_MASK])