diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2015-11-11 23:25:41 +0100 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-12-14 12:19:22 -0500 |
commit | 302c63565452db0bdb065605ad227c88ec93d4e8 (patch) | |
tree | e9b152447360dd36b82199c572a1e561a894d397 | |
parent | 22fb967dc3ca91edb8298373d64beaec4a572373 (diff) | |
download | lwn-302c63565452db0bdb065605ad227c88ec93d4e8.tar.gz lwn-302c63565452db0bdb065605ad227c88ec93d4e8.zip |
packet: always probe for transport header
[ Upstream commit 8fd6c80d9dd938ca338c70698533a7e304752846 ]
We concluded that the skb_probe_transport_header() should better be
called unconditionally. Avoiding the call into the flow dissector has
also not really much to do with the direct xmit mode.
While it seems that only virtio_net code makes use of GSO from non
RX/TX ring packet socket paths, we should probe for a transport header
nevertheless before they hit devices.
Reference: http://thread.gmane.org/gmane.linux.network/386173/
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
-rw-r--r-- | net/packet/af_packet.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 9d5b9cea1ca7..9458455448bb 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -2200,8 +2200,7 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb, len = ((to_write > len_max) ? len_max : to_write); } - if (!packet_use_direct_xmit(po)) - skb_probe_transport_header(skb, 0); + skb_probe_transport_header(skb, 0); return tp_len; } @@ -2538,8 +2537,8 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) len += vnet_hdr_len; } - if (!packet_use_direct_xmit(po)) - skb_probe_transport_header(skb, reserve); + skb_probe_transport_header(skb, reserve); + if (unlikely(extra_len == 4)) skb->no_fcs = 1; |