Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 302c6356 authored by Daniel Borkmann's avatar Daniel Borkmann Committed by Sasha Levin
Browse files

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: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent 22fb967d
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -2200,7 +2200,6 @@ 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);

	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);

	if (unlikely(extra_len == 4))
		skb->no_fcs = 1;