Skip to content

Commit

Permalink
sched, bpf: let stack handle !IFF_UP devs on bpf_clone_redirect
Browse files Browse the repository at this point in the history
Similarly as already the case in bpf_redirect()/skb_do_redirect()
pair, let the stack deal with devs that are !IFF_UP.

dev_forward_skb() as well as dev_queue_xmit() will free the skb
and increment drop counter internally in such cases, so we can
spare the condition in bpf_clone_redirect().

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 Sep 23, 2015
1 parent 644d0e6 commit 927ab1d
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions net/core/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1404,9 +1404,6 @@ static u64 bpf_clone_redirect(u64 r1, u64 ifindex, u64 flags, u64 r4, u64 r5)
if (unlikely(!dev))
return -EINVAL;

if (unlikely(!(dev->flags & IFF_UP)))
return -EINVAL;

skb2 = skb_clone(skb, GFP_ATOMIC);
if (unlikely(!skb2))
return -ENOMEM;
Expand Down

0 comments on commit 927ab1d

Please sign in to comment.