[RFC,4/4] batman-adv: Demote batadv-on-batadv skip error message

Message ID 20220227235257.1324636-4-sven@narfation.org (mailing list archive)
State RFC, archived
Delegated to: Simon Wunderlich
Series [RFC,1/4] batman-adv: Request iflink once in batadv-on-batadv check |

Commit Message

Sven Eckelmann Feb. 27, 2022, 11:52 p.m. UTC
  The error message "Cannot find parent device" was shown for users of
macvtap (on batadv devices) whenever the macvtap was moved to a different
netns. This happens because macvtap doesn't provide

The situation for which this message is printed is actually not an error
but just a warning that the optional sanity check was skipped. So demote
the message from error to warning and adjust the text to better explain
what happened.

Reported-by: Leonardo Mörlein <freifunk@irrelefant.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
 net/batman-adv/hard-interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


Sven Eckelmann Feb. 28, 2022, 12:30 a.m. UTC | #1
On Monday, 28 February 2022 01:24:30 CET Leonardo Mörlein wrote:
> > This happens because macvtap doesn't provide
> >
> I think there are some missing words.


"This happens because macvtap doesn't provide an implementation for 
rtnl_link_ops->get_link_net" [1]

Kind regards,

[1] https://git.open-mesh.org/linux-merge.git/commit/7748449945e3fb63b64d57c5c0604201164ef93c


diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index cdb6e542..83fb51b6 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -168,9 +168,9 @@  static bool batadv_is_on_batman_iface(const struct net_device *net_dev)
 	/* recurse over the parent device */
 	parent_dev = __dev_get_by_index((struct net *)parent_net, iflink);
-	/* if we got a NULL parent_dev there is something broken.. */
 	if (!parent_dev) {
-		pr_err("Cannot find parent device\n");
+		pr_warn("Cannot find parent device. Skipping batadv-on-batadv check for %s\n",
+			net_dev->name);
 		return false;