diff mbox series

[1/2] batctl: tcpdump: Add support for MCASTv2 RTR(4|6) flags

Message ID 20190629082818.29466-1-sven@narfation.org
State Accepted, archived
Commit ae5497b6144076ce8fbc00f4b966aaaf2d00196a
Delegated to: Simon Wunderlich
Headers show
Series [1/2] batctl: tcpdump: Add support for MCASTv2 RTR(4|6) flags | expand

Commit Message

Sven Eckelmann June 29, 2019, 8:28 a.m. UTC
The batman-adv commit 0a7733468f95 ("batman-adv: mcast: detect, distribute
and maintain multicast router presence") added support for two new flags
BATADV_MCAST_WANT_NO_RTR4 and BATADV_MCAST_WANT_NO_RTR6. These are
announced in IV_OGM and OGMv2.

batctl's tcpdump requires support for it to make debugging of
router-to-router multicast problems in networks easier.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 tcpdump.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tcpdump.c b/tcpdump.c
index 158b82e..0e2ae8e 100644
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -230,10 +230,12 @@  static void batctl_tvlv_parse_mcast_v2(void *buff, ssize_t buff_len)
 
 	flags = tvlv->flags;
 
-	printf("\tTVLV MCASTv2: [%c%c%c]\n",
+	printf("\tTVLV MCASTv2: [%c%c%c%s%s]\n",
 	       flags & BATADV_MCAST_WANT_ALL_UNSNOOPABLES ? 'U' : '.',
 	       flags & BATADV_MCAST_WANT_ALL_IPV4 ? '4' : '.',
-	       flags & BATADV_MCAST_WANT_ALL_IPV6 ? '6' : '.');
+	       flags & BATADV_MCAST_WANT_ALL_IPV6 ? '6' : '.',
+	       !(flags & BATADV_MCAST_WANT_NO_RTR4) ? "R4" : ". ",
+	       !(flags & BATADV_MCAST_WANT_NO_RTR6) ? "R6" : ". ");
 }
 
 typedef void (*batctl_tvlv_parser_t)(void *buff, ssize_t buff_len);