summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Wunderlich <sw@simonwunderlich.de>2016-06-26 11:16:09 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-10 10:26:02 +0200
commit61a2d57491324cd145e23f0cf040f503a9b3f4e4 (patch)
tree22167c9bfeaa919634db94b6a9bdf79f016981a7
parentd1fe020cde3316fb812bff8f1cd95842814bad84 (diff)
downloadlinux-stable-61a2d57491324cd145e23f0cf040f503a9b3f4e4.tar.gz
linux-stable-61a2d57491324cd145e23f0cf040f503a9b3f4e4.tar.bz2
linux-stable-61a2d57491324cd145e23f0cf040f503a9b3f4e4.zip
batman-adv: replace WARN with rate limited output on non-existing VLAN
commit 0b3dd7dfb81ad8af53791ea2bb64b83bac1b7d32 upstream. 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 <sw@simonwunderlich.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/batman-adv/translation-table.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 67ee7c83a28d..06f366d234ff 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -614,8 +614,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;