diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2015-11-11 17:25:41 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-11-15 18:00:35 -0500 |
commit | 8fd6c80d9dd938ca338c70698533a7e304752846 (patch) | |
tree | b5080145d5f9afe7b0502a4aed2a5fae37631280 /net | |
parent | efdfa2f7848f64517008136fb41f53c4a1faf93a (diff) |
packet: always probe for transport header
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>
Diffstat (limited to 'net')
-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 80c36c0867d3..bdecf17a15bb 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -2447,8 +2447,7 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb, | |||
2447 | len = ((to_write > len_max) ? len_max : to_write); | 2447 | len = ((to_write > len_max) ? len_max : to_write); |
2448 | } | 2448 | } |
2449 | 2449 | ||
2450 | if (!packet_use_direct_xmit(po)) | 2450 | skb_probe_transport_header(skb, 0); |
2451 | skb_probe_transport_header(skb, 0); | ||
2452 | 2451 | ||
2453 | return tp_len; | 2452 | return tp_len; |
2454 | } | 2453 | } |
@@ -2808,8 +2807,8 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) | |||
2808 | len += vnet_hdr_len; | 2807 | len += vnet_hdr_len; |
2809 | } | 2808 | } |
2810 | 2809 | ||
2811 | if (!packet_use_direct_xmit(po)) | 2810 | skb_probe_transport_header(skb, reserve); |
2812 | skb_probe_transport_header(skb, reserve); | 2811 | |
2813 | if (unlikely(extra_len == 4)) | 2812 | if (unlikely(extra_len == 4)) |
2814 | skb->no_fcs = 1; | 2813 | skb->no_fcs = 1; |
2815 | 2814 | ||