Commit 1a304495 authored by David S. Miller's avatar David S. Miller

Merge branch 'tc-action-fixes'

Vlad Buslov says:

====================
Fixes for miss to tc action series

Changes V1 -> V2:

- Added new patch reverting Ivan's fix for the same issue.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 26312c68 fd741f0d
...@@ -2210,10 +2210,10 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, ...@@ -2210,10 +2210,10 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
spin_lock(&tp->lock); spin_lock(&tp->lock);
if (!handle) { if (!handle) {
handle = 1; handle = 1;
err = idr_alloc_u32(&head->handle_idr, fnew, &handle, err = idr_alloc_u32(&head->handle_idr, NULL, &handle,
INT_MAX, GFP_ATOMIC); INT_MAX, GFP_ATOMIC);
} else { } else {
err = idr_alloc_u32(&head->handle_idr, fnew, &handle, err = idr_alloc_u32(&head->handle_idr, NULL, &handle,
handle, GFP_ATOMIC); handle, GFP_ATOMIC);
/* Filter with specified handle was concurrently /* Filter with specified handle was concurrently
...@@ -2231,8 +2231,8 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, ...@@ -2231,8 +2231,8 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
kfree(fnew); kfree(fnew);
goto errout_tb; goto errout_tb;
} }
fnew->handle = handle;
} }
fnew->handle = handle;
err = tcf_exts_init_ex(&fnew->exts, net, TCA_FLOWER_ACT, 0, tp, handle, err = tcf_exts_init_ex(&fnew->exts, net, TCA_FLOWER_ACT, 0, tp, handle,
!tc_skip_hw(fnew->flags)); !tc_skip_hw(fnew->flags));
...@@ -2339,6 +2339,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, ...@@ -2339,6 +2339,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
errout_mask: errout_mask:
fl_mask_put(head, fnew->mask); fl_mask_put(head, fnew->mask);
errout_idr: errout_idr:
if (!fold)
idr_remove(&head->handle_idr, fnew->handle); idr_remove(&head->handle_idr, fnew->handle);
__fl_put(fnew); __fl_put(fnew);
errout_tb: errout_tb:
...@@ -2378,7 +2379,7 @@ static void fl_walk(struct tcf_proto *tp, struct tcf_walker *arg, ...@@ -2378,7 +2379,7 @@ static void fl_walk(struct tcf_proto *tp, struct tcf_walker *arg,
rcu_read_lock(); rcu_read_lock();
idr_for_each_entry_continue_ul(&head->handle_idr, f, tmp, id) { idr_for_each_entry_continue_ul(&head->handle_idr, f, tmp, id) {
/* don't return filters that are being deleted */ /* don't return filters that are being deleted */
if (!refcount_inc_not_zero(&f->refcnt)) if (!f || !refcount_inc_not_zero(&f->refcnt))
continue; continue;
rcu_read_unlock(); rcu_read_unlock();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment