netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] bpf: no need to nullify ri->map in xdp_do_redirect
@ 2017-08-17 13:07 Daniel Borkmann
  2017-08-17 15:59 ` John Fastabend
  2017-08-17 17:16 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Borkmann @ 2017-08-17 13:07 UTC (permalink / raw)
  To: davem; +Cc: john.fastabend, ast, netdev, Daniel Borkmann

We are guaranteed to have a NULL ri->map in this branch since
we test for it earlier, so we don't need to reset it here.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
---
 net/core/filter.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/core/filter.c b/net/core/filter.c
index e9f8dce..ea3ca34 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -2568,7 +2568,6 @@ int xdp_do_redirect(struct net_device *dev, struct xdp_buff *xdp,
 
 	fwd = dev_get_by_index_rcu(dev_net(dev), index);
 	ri->ifindex = 0;
-	ri->map = NULL;
 	if (unlikely(!fwd)) {
 		bpf_warn_invalid_xdp_redirect(index);
 		return -EINVAL;
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] bpf: no need to nullify ri->map in xdp_do_redirect
  2017-08-17 13:07 [PATCH net-next] bpf: no need to nullify ri->map in xdp_do_redirect Daniel Borkmann
@ 2017-08-17 15:59 ` John Fastabend
  2017-08-17 17:16 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: John Fastabend @ 2017-08-17 15:59 UTC (permalink / raw)
  To: Daniel Borkmann, davem; +Cc: ast, netdev

On 08/17/2017 06:07 AM, Daniel Borkmann wrote:
> We are guaranteed to have a NULL ri->map in this branch since
> we test for it earlier, so we don't need to reset it here.
> 
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
> ---
>  net/core/filter.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/net/core/filter.c b/net/core/filter.c
> index e9f8dce..ea3ca34 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -2568,7 +2568,6 @@ int xdp_do_redirect(struct net_device *dev, struct xdp_buff *xdp,
>  
>  	fwd = dev_get_by_index_rcu(dev_net(dev), index);
>  	ri->ifindex = 0;
> -	ri->map = NULL;
>  	if (unlikely(!fwd)) {
>  		bpf_warn_invalid_xdp_redirect(index);
>  		return -EINVAL;
> 

Thanks this was on my todo list as well.

Acked-by: John Fastabend <john.fastabend@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] bpf: no need to nullify ri->map in xdp_do_redirect
  2017-08-17 13:07 [PATCH net-next] bpf: no need to nullify ri->map in xdp_do_redirect Daniel Borkmann
  2017-08-17 15:59 ` John Fastabend
@ 2017-08-17 17:16 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-08-17 17:16 UTC (permalink / raw)
  To: daniel; +Cc: john.fastabend, ast, netdev

From: Daniel Borkmann <daniel@iogearbox.net>
Date: Thu, 17 Aug 2017 15:07:22 +0200

> We are guaranteed to have a NULL ri->map in this branch since
> we test for it earlier, so we don't need to reset it here.
> 
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-17 17:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-17 13:07 [PATCH net-next] bpf: no need to nullify ri->map in xdp_do_redirect Daniel Borkmann
2017-08-17 15:59 ` John Fastabend
2017-08-17 17:16 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).