From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zahari Doychev Subject: [PATCH 1/2] net: bridge: fix tc added QinQ forwarding Date: Sun, 13 Jan 2019 14:59:38 +0100 Message-ID: <20190113135939.8970-2-zahari.doychev@linux.com> References: <20190113135939.8970-1-zahari.doychev@linux.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: jhs@mojatatu.com, johannes@sipsolutions.net, zahari.doychev@linux.com To: netdev@vger.kernel.org, bridge@lists.linux-foundation.org, nikolay@cumulusnetworks.com, roopa@cumulusnetworks.com Return-path: Received: from mail-wm1-f65.google.com ([209.85.128.65]:35162 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726434AbfAMNzA (ORCPT ); Sun, 13 Jan 2019 08:55:00 -0500 Received: by mail-wm1-f65.google.com with SMTP id t200so6435170wmt.0 for ; Sun, 13 Jan 2019 05:54:59 -0800 (PST) In-Reply-To: <20190113135939.8970-1-zahari.doychev@linux.com> Sender: netdev-owner@vger.kernel.org List-ID: Use the skb->mac_len instead of using the ETH_HLEN when pushing the skb data pointer. This fixes sending incorrect packets when more than one vlan tags are pushed by tc-vlan and the mac header length is bigger than ETH_HLEN. In this way the vlan tagged contained in the skb is inserted at right offset in the packet payload before sending the packet. Signed-off-by: Zahari Doychev --- net/bridge/br_forward.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c index 5372e2042adf..55f928043f77 100644 --- a/net/bridge/br_forward.c +++ b/net/bridge/br_forward.c @@ -39,7 +39,7 @@ int br_dev_queue_push_xmit(struct net *net, struct sock *sk, struct sk_buff *skb if (!is_skb_forwardable(skb->dev, skb)) goto drop; - skb_push(skb, ETH_HLEN); + skb_push(skb, skb->mac_len); br_drop_fake_rtable(skb); if (skb->ip_summed == CHECKSUM_PARTIAL && -- 2.20.1