]> git.baikalelectronics.ru Git - kernel.git/commit
net: orphan frags on stand-alone ptype in dev_queue_xmit_nit
authorWillem de Bruijn <willemb@google.com>
Fri, 22 Sep 2017 23:42:37 +0000 (19:42 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sat, 23 Sep 2017 03:31:29 +0000 (20:31 -0700)
commit159cca44278e8baf5dede95f812930cdaa570b8a
tree3e4d6f6ea3397283ab12445eb369ebb5ee4c006b
parentcf24e53d49cd3d1866239d603ba350b2ec8638b9
net: orphan frags on stand-alone ptype in dev_queue_xmit_nit

Zerocopy skbs frags are copied when the skb is looped to a local sock.
Commit 7ffcc1daa768 ("net: orphan frags on receive") introduced calls
to skb_orphan_frags to deliver_skb and __netif_receive_skb for this.

With msg_zerocopy, these skbs can also exist in the tx path and thus
loop from dev_queue_xmit_nit. This already calls deliver_skb in its
loop. But it does not orphan before a separate pt_prev->func().

Add the missing skb_orphan_frags_rx.

Changes
  v1->v2: handle skb_orphan_frags_rx failure

Fixes: 32dcb8236cb6 ("sock: enable MSG_ZEROCOPY")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c