public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH-maintv2] batman-adv: replace WARN with rate limited output on non-existing VLAN
@ 2016-05-12 16:52 Simon Wunderlich
  2016-05-17  9:12 ` Marek Lindner
  2016-05-20 10:05 ` [B.A.T.M.A.N.] Antwort: " Andreas Pape
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Wunderlich @ 2016-05-12 16:52 UTC (permalink / raw)
  To: b.a.t.m.a.n

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.

Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
Changes to PATCH-maint:
 * added newline to output
---
 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 9b4551a..48adb91 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;
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-20 10:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-12 16:52 [B.A.T.M.A.N.] [PATCH-maintv2] batman-adv: replace WARN with rate limited output on non-existing VLAN Simon Wunderlich
2016-05-17  9:12 ` Marek Lindner
2016-05-20 10:05 ` [B.A.T.M.A.N.] Antwort: " Andreas Pape
2016-05-20 10:34   ` Simon Wunderlich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox