virtio-net: correctly set xdp_xmit for mergeable buffer

We should set xdp_xmit only when xdp_do_redirect() succeed.

Cc: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jason Wang 2017-09-22 14:38:58 +08:00 committed by David S. Miller
parent 411d788a23
commit dd54379749

View File

@ -721,7 +721,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
goto xdp_xmit;
case XDP_REDIRECT:
err = xdp_do_redirect(dev, &xdp, xdp_prog);
if (err)
if (!err)
*xdp_xmit = true;
rcu_read_unlock();
goto xdp_xmit;