Skip to content

Commit

Permalink
bpf, skb_do_redirect: clear sender_cpu before xmit
Browse files Browse the repository at this point in the history
Similar to commit c29390c ("xps: must clear sender_cpu before
forwarding"), we also need to clear the skb->sender_cpu when moving
from RX to TX via skb_do_redirect() due to the shared location of
napi_id (used on RX) and sender_cpu (used on TX).

Fixes: 27b29f6 ("bpf: add bpf_redirect() helper")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Daniel Borkmann authored and David S. Miller committed Oct 8, 2015
1 parent dfdd723 commit cfc81b5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/core/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1462,6 +1462,7 @@ int skb_do_redirect(struct sk_buff *skb)
return dev_forward_skb(dev, skb);

skb->dev = dev;
skb_sender_cpu_clear(skb);
return dev_queue_xmit(skb);
}

Expand Down

0 comments on commit cfc81b5

Please sign in to comment.