Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4272181pxu; Mon, 12 Oct 2020 14:28:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDWHfuJkxRekFsk/fjiXqE4nlJZ6GK4ndcpa0y27lx2yl9VxshCXTcjKnxQd9c34djsSy1 X-Received: by 2002:a17:906:82d5:: with SMTP id a21mr29569761ejy.548.1602538126720; Mon, 12 Oct 2020 14:28:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602538126; cv=none; d=google.com; s=arc-20160816; b=kPG1bVJ67isSX6a09qUUZX9CDz81cOPmOeljinsoqocaiS22uSOr9FPq6AoPt9GcgZ vFOtFSjMiJHa0i33FO9sn/AKQ8moAeReTngekI3GM9946Z4qMmnAdjnDJ0vqehSZyhlo Fq6a9sJGpjPzBCeiO+bPRiLOEJFyQgLtDreQ3VabrJ2Zu62wWgOdpzh5Yn2+pI5TrODn TEJ/znxiD+5lGId+ucThVYPgMYHxfuKne0HjjIlAOA30tuoN9u6VFD9k8YJb81u3eM41 +KlSOZU+JL1OVdHXGXG/XOH996Ac9y8uPg/V+YKkeVFKfaYCW6K9Ai4lXWSKgy4AKREv oGDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VTx5Vfcp2lAcDBpyo+baX02V3wf1ifLDe/qRG7vhum8=; b=Fd/Nmyd6zqN0WGOuen6TnMHdJGaBkutaswdf03ArXyfhykhU9n/YV20XKS22kPA2NF 5LfSpn0e8xHQtkQ6S2OAd4Jh1YzwEGCsJAY19V6CgY0GgkoQRXRmRzFP2nWC6ERCB9lb +JYvLJXC+SQzq15C25kBa3G4J/WRRRtQOR8Y0zg7NDdL4fm8M+vLGxq56rXv/F6LMbDc CJK8y422x9wMjPii7OFDZjQx9gZSLzNm+AeKwbGsZCOtO2UY+Bc2GdA1N/MhQFIQ5Doi s0aijW1RG+fSUBSpZ1i6esak9EbcsTF3bPk2KcR1NDslqjEM3uwts8j1RI3HFWrTDrwb LvWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XLauxr6z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a64si11312559edf.234.2020.10.12.14.28.24; Mon, 12 Oct 2020 14:28:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XLauxr6z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730982AbgJLNhL (ORCPT + 99 others); Mon, 12 Oct 2020 09:37:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:36738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730716AbgJLNfs (ORCPT ); Mon, 12 Oct 2020 09:35:48 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 894FD20678; Mon, 12 Oct 2020 13:35:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602509748; bh=b5En8k/O97exEZDQzUfNz3XNs7S2smboU+rFFPz3PpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XLauxr6zXtNNBXzwU0Vmg6c7aU0Szw+wVgqVJe2gxg63XovLTJXq3qjyuXtqyFU3e en56V4yY50hOp1s8X7KS2+nNP7seCbyuGOk2gK7XgyDTfbYbx4yeSGTTk/z0KosHE0 KuH5lex/0ooOVs187xA7NUF2YDoeaidwNDolvjUs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Schiller , Xie He , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 13/70] drivers/net/wan/lapbether: Make skb->protocol consistent with the header Date: Mon, 12 Oct 2020 15:26:29 +0200 Message-Id: <20201012132630.856875552@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012132630.201442517@linuxfoundation.org> References: <20201012132630.201442517@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xie He [ Upstream commit 83f9a9c8c1edc222846dc1bde6e3479703e8e5a3 ] This driver is a virtual driver stacked on top of Ethernet interfaces. When this driver transmits data on the Ethernet device, the skb->protocol setting is inconsistent with the Ethernet header prepended to the skb. This causes a user listening on the Ethernet interface with an AF_PACKET socket, to see different sll_protocol values for incoming and outgoing frames, because incoming frames would have this value set by parsing the Ethernet header. This patch changes the skb->protocol value for outgoing Ethernet frames, making it consistent with the Ethernet header prepended. This makes a user listening on the Ethernet device with an AF_PACKET socket, to see the same sll_protocol value for incoming and outgoing frames. Cc: Martin Schiller Signed-off-by: Xie He Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/wan/lapbether.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index 15177a54b17d7..e5fc1b95cea6a 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c @@ -201,8 +201,6 @@ static void lapbeth_data_transmit(struct net_device *ndev, struct sk_buff *skb) struct net_device *dev; int size = skb->len; - skb->protocol = htons(ETH_P_X25); - ptr = skb_push(skb, 2); *ptr++ = size % 256; @@ -213,6 +211,8 @@ static void lapbeth_data_transmit(struct net_device *ndev, struct sk_buff *skb) skb->dev = dev = lapbeth->ethdev; + skb->protocol = htons(ETH_P_DEC); + skb_reset_network_header(skb); dev_hard_header(skb, dev, ETH_P_DEC, bcast_addr, NULL, 0); -- 2.25.1