From 748b06205290290bb1ebea22740d91f7cfa3f3f9 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 18 Mar 2021 10:53:05 +0100 Subject: [PATCH] Revert "net: check if protocol extracted by virtio_net_hdr_set_proto is correct" This reverts commit 54ef8243c3c8e90f1ea5792e6752e021a25c8eb3 which is commit 924a9bc362a5223cd448ca08c3dde21235adc310 upstream. This breaks the ABI and is not needed in the android-4.19-stable branch as the issue it was added for is not relevant here. Bug: 161946584 Signed-off-by: Greg Kroah-Hartman Change-Id: I0a0453de60f4a614448cc62736eb32681277a6e8 --- include/linux/virtio_net.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index 98e7716e0341..f32fe7080d2e 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h @@ -79,13 +79,8 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, if (gso_type && skb->network_header) { struct flow_keys_basic keys; - if (!skb->protocol) { - __be16 protocol = dev_parse_header_protocol(skb); - + if (!skb->protocol) virtio_net_hdr_set_proto(skb, hdr); - if (protocol && protocol != skb->protocol) - return -EINVAL; - } retry: if (!skb_flow_dissect_flow_keys_basic(skb, &keys, NULL, 0, 0, 0,