From patchwork Sun Jun 26 09:16:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16393 Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 0D0BF817A9; Sun, 26 Jun 2016 11:16:26 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=narfation.org Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=narfation.org header.i=@narfation.org header.b=d1rQSlz+; dkim-adsp=fail (unprotected policy); dkim-atps=neutral Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=79.140.41.39; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=pass header.from=narfation.org Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id 9253D817A8 for ; Sun, 26 Jun 2016 11:16:24 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p200300C593D02DF90000000000002E16.dip0.t-ipconnect.de [IPv6:2003:c5:93d0:2df9::2e16]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id E75881C8001; Sun, 26 Jun 2016 11:16:23 +0200 (CEST) Authentication-Results: v3-1039.vlinux.de; dmarc=none header.from=narfation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1466932584; bh=VXgdn2Har7+n/JXfCeiQDqgklW41BOsjDQNGHf9tB1c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d1rQSlz++lcF1U0ehw8bHoR+5khz/FDYygnNtj35GI2NdqgdFqfr6KVqr0WhTMnH8 tLdSkE2rW4dmzv4sz5xaWYdiU5NRZhx77rvvBfvn/Zxdv9n5k0joaNrsgpCR/mGE5A w4VTOis8f9xoX5SnFAU8S4REsVD9qMV/fF0+yuGk= From: Sven Eckelmann To: David Miller Date: Sun, 26 Jun 2016 11:16:09 +0200 Message-Id: <1466932573-23105-1-git-send-email-sven@narfation.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <10049349.EHEiaYmtBd@sven-edge> References: <10049349.EHEiaYmtBd@sven-edge> Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, Marek Lindner Subject: [B.A.T.M.A.N.] [PATCH net 1/5] batman-adv: replace WARN with rate limited output on non-existing VLAN X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" From: Simon Wunderlich If a VLAN tagged frame is received and the corresponding VLAN is not configured on the soft interface, it will splat a WARN on every packet received. This is a quite annoying behaviour for some scenarios, e.g. if bat0 is bridged with eth0, and there are arbitrary VLAN tagged frames from Ethernet coming in without having any VLAN configuration on bat0. The code should probably create vlan objects on the fly and transparently transport these VLAN-tagged Ethernet frames, but until this is done, at least the WARN splat should be replaced by a rate limited output. Fixes: 354136bcc3c4 ("batman-adv: fix kernel crash due to missing NULL checks") Signed-off-by: Simon Wunderlich Signed-off-by: Marek Lindner Signed-off-by: Sven Eckelmann --- net/batman-adv/translation-table.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index feaf492b..72abab7 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -650,8 +650,10 @@ bool batadv_tt_local_add(struct net_device *soft_iface, const u8 *addr, /* increase the refcounter of the related vlan */ vlan = batadv_softif_vlan_get(bat_priv, vid); - if (WARN(!vlan, "adding TT local entry %pM to non-existent VLAN %d", - addr, BATADV_PRINT_VID(vid))) { + if (!vlan) { + net_ratelimited_function(batadv_info, soft_iface, + "adding TT local entry %pM to non-existent VLAN %d\n", + addr, BATADV_PRINT_VID(vid)); kfree(tt_local); tt_local = NULL; goto out;