Subject: Re: [PATCH net-next] bpf: no need to nullify ri->map in xdp_do_redirect

From: John Fastabend <[email-masked]>
Date: Thu, 17 Aug 2017 08:59:52 -0700

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 <[email-masked]>
> ---
>  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 <[email-masked]>