aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorMaxim Mikityanskiy <maximmi@mellanox.com>2019-02-22 07:55:22 -0500
committerDavid S. Miller <davem@davemloft.net>2019-02-24 15:40:38 -0500
commita0dce8752193ee314c8dcff8671aa0a0cea4d377 (patch)
tree5a375aedf891031897c73aa0492a346d15cf9152 /net/core/dev.c
parent0a6c33e894a50e5483ca1f53d053985feabebbf3 (diff)
net: Skip GSO length estimation if transport header is not set
qdisc_pkt_len_init expects transport_header to be set for GSO packets. Patch [1] skips transport_header validation for GSO packets that don't have network_header set at the moment of calling virtio_net_hdr_to_skb, and allows them to pass into the stack. After patch [2] no placeholder value is assigned to transport_header if dissection fails, so this patch adds a check to the place where the value of transport_header is used. [1] https://patchwork.ozlabs.org/patch/1044429/ [2] https://patchwork.ozlabs.org/patch/1046122/ Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com> Acked-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index a3d13f5e2bfc..8a0da95ff4cc 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3421,7 +3421,7 @@ static void qdisc_pkt_len_init(struct sk_buff *skb)
3421 /* To get more precise estimation of bytes sent on wire, 3421 /* To get more precise estimation of bytes sent on wire,
3422 * we add to pkt_len the headers size of all segments 3422 * we add to pkt_len the headers size of all segments
3423 */ 3423 */
3424 if (shinfo->gso_size) { 3424 if (shinfo->gso_size && skb_transport_header_was_set(skb)) {
3425 unsigned int hdr_len; 3425 unsigned int hdr_len;
3426 u16 gso_segs = shinfo->gso_segs; 3426 u16 gso_segs = shinfo->gso_segs;
3427 3427