From patchwork Wed Jan 22 09:28:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0876C2D0DB for ; Wed, 22 Jan 2020 09:30:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7C1572071E for ; Wed, 22 Jan 2020 09:30:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579685458; bh=1sZwyDzsZStdE1HgfxdQMDQY0KfdLKvbmwsdZjONnM4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=I89DI4suZRiGnMAPAEP/5YB0Xulz5su9wrVfmhB8YVP67lpj/tJp6ym7BJmqfbQVE o+OY5bk+34m+qKx4J47jVkTPCLRlHdDLnIijX+uQ4tBBHx29lnDnDnFJ0fylZ8D0HX ujGALcnQzhez0pWGL+4hGiV0YP1JFKswLlFnZZdM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729442AbgAVJa5 (ORCPT ); Wed, 22 Jan 2020 04:30:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:42662 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729437AbgAVJa4 (ORCPT ); Wed, 22 Jan 2020 04:30:56 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 C2AFD2071E; Wed, 22 Jan 2020 09:30:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579685456; bh=1sZwyDzsZStdE1HgfxdQMDQY0KfdLKvbmwsdZjONnM4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0vbg6gL36Uwe3YfcXOEXWgy68g1d8fZZcIcSVXRxOqWpH7grdthjjKpgOAMD/oBTQ yro/HRvW8BMh1nZhdneKxtZAJ+CB7U1E54wUAyTB8cRlqDfr4RyG8fTS5ldXVWVLHB f1NcyeRaDrwz5LNgA/8Rv7D7FNQbGAsUwTASgBko= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Taehee Yoo , "David S. Miller" Subject: [PATCH 4.4 21/76] hsr: reset network header when supervision frame is created Date: Wed, 22 Jan 2020 10:28:37 +0100 Message-Id: <20200122092753.778521511@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092751.587775548@linuxfoundation.org> References: <20200122092751.587775548@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Taehee Yoo commit 3ed0a1d563903bdb4b4c36c58c4d9c1bcb23a6e6 upstream. The supervision frame is L2 frame. When supervision frame is created, hsr module doesn't set network header. If tap routine is enabled, dev_queue_xmit_nit() is called and it checks network_header. If network_header pointer wasn't set(or invalid), it resets network_header and warns. In order to avoid unnecessary warning message, resetting network_header is needed. Test commands: ip netns add nst ip link add veth0 type veth peer name veth1 ip link add veth2 type veth peer name veth3 ip link set veth1 netns nst ip link set veth3 netns nst ip link set veth0 up ip link set veth2 up ip link add hsr0 type hsr slave1 veth0 slave2 veth2 ip a a 192.168.100.1/24 dev hsr0 ip link set hsr0 up ip netns exec nst ip link set veth1 up ip netns exec nst ip link set veth3 up ip netns exec nst ip link add hsr1 type hsr slave1 veth1 slave2 veth3 ip netns exec nst ip a a 192.168.100.2/24 dev hsr1 ip netns exec nst ip link set hsr1 up tcpdump -nei veth0 Splat looks like: [ 175.852292][ C3] protocol 88fb is buggy, dev veth0 Fixes: f421436a591d ("net/hsr: Add support for the High-availability Seamless Redundancy protocol (HSRv0)") Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/hsr/hsr_device.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -289,6 +289,8 @@ static void send_hsr_supervision_frame(s skb->dev->dev_addr, skb->len) <= 0) goto out; skb_reset_mac_header(skb); + skb_reset_network_header(skb); + skb_reset_transport_header(skb); hsr_stag = (typeof(hsr_stag)) skb_put(skb, sizeof(*hsr_stag));