Blame SOURCES/kvm-net-remove-an-assert-call-in-eth_get_gso_type.patch

dc7afb
From b7de63e72c479df42c324c058a487517210fa069 Mon Sep 17 00:00:00 2001
dc7afb
From: Jon Maloy <jmaloy@redhat.com>
dc7afb
Date: Tue, 13 Apr 2021 19:21:50 -0400
dc7afb
Subject: [PATCH 1/5] net: remove an assert call in eth_get_gso_type
dc7afb
dc7afb
RH-Author: Jon Maloy <jmaloy@redhat.com>
dc7afb
Message-id: <20210413192150.3817133-2-jmaloy@redhat.com>
dc7afb
Patchwork-id: 101469
dc7afb
O-Subject: [RHEL-8.5.0 qemu-kvm PATCH 1/1] net: remove an assert call in eth_get_gso_type
dc7afb
Bugzilla: 1892350
dc7afb
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
dc7afb
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
dc7afb
RH-Acked-by: Xiao Wang <jasowang@redhat.com>
dc7afb
dc7afb
From: Prasad J Pandit <pjp@fedoraproject.org>
dc7afb
dc7afb
eth_get_gso_type() routine returns segmentation offload type based on
dc7afb
L3 protocol type. It calls g_assert_not_reached if L3 protocol is
dc7afb
unknown, making the following return statement unreachable. Remove the
dc7afb
g_assert call, it maybe triggered by a guest user.
dc7afb
dc7afb
Reported-by: Gaoning Pan <pgn@zju.edu.cn>
dc7afb
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
dc7afb
Signed-off-by: Jason Wang <jasowang@redhat.com>
dc7afb
dc7afb
(cherry picked from commit 7564bf7701f00214cdc8a678a9f7df765244def1)
dc7afb
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
dc7afb
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
dc7afb
---
dc7afb
 net/eth.c | 6 +++---
dc7afb
 1 file changed, 3 insertions(+), 3 deletions(-)
dc7afb
dc7afb
diff --git a/net/eth.c b/net/eth.c
dc7afb
index 0c1d413ee2..1e0821c5f8 100644
dc7afb
--- a/net/eth.c
dc7afb
+++ b/net/eth.c
dc7afb
@@ -16,6 +16,7 @@
dc7afb
  */
dc7afb
 
dc7afb
 #include "qemu/osdep.h"
dc7afb
+#include "qemu/log.h"
dc7afb
 #include "net/eth.h"
dc7afb
 #include "net/checksum.h"
dc7afb
 #include "net/tap.h"
dc7afb
@@ -71,9 +72,8 @@ eth_get_gso_type(uint16_t l3_proto, uint8_t *l3_hdr, uint8_t l4proto)
dc7afb
             return VIRTIO_NET_HDR_GSO_TCPV6 | ecn_state;
dc7afb
         }
dc7afb
     }
dc7afb
-
dc7afb
-    /* Unsupported offload */
dc7afb
-    g_assert_not_reached();
dc7afb
+    qemu_log_mask(LOG_UNIMP, "%s: probably not GSO frame, "
dc7afb
+        "unknown L3 protocol: 0x%04"PRIx16"\n", __func__, l3_proto);
dc7afb
 
dc7afb
     return VIRTIO_NET_HDR_GSO_NONE | ecn_state;
dc7afb
 }
dc7afb
-- 
dc7afb
2.27.0
dc7afb