]> git.hungrycats.org Git - linux/commitdiff
net_sched: copy exts->type in tcf_exts_change()
authorWANG Cong <xiyou.wangcong@gmail.com>
Tue, 7 Oct 2014 00:21:54 +0000 (17:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Oct 2014 10:05:30 +0000 (12:05 +0200)
[ Upstream commit 5301e3e117d88ef0967ce278912e54757f1a31a2 ]

We need to copy exts->type when committing the change, otherwise
it would be always 0. This is a quick fix for -net and -stable,
for net-next tcf_exts will be removed.

Fixes: commit 33be627159913b094bb578e83 ("net_sched: act: use standard struct list_head")
Reported-by: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sched/cls_api.c

index 45527e6b52dbf396cbb7415bb0613152a8320096..3b2617aa6bcdf2123f35a30c6c5b1cf3d7c15540 100644 (file)
@@ -549,6 +549,7 @@ void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst,
        tcf_tree_lock(tp);
        list_splice_init(&dst->actions, &tmp);
        list_splice(&src->actions, &dst->actions);
+       dst->type = src->type;
        tcf_tree_unlock(tp);
        tcf_action_destroy(&tmp, TCA_ACT_UNBIND);
 #endif