]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Minor fixme - core
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Sun, 11 Mar 2018 23:20:24 +0000 (00:20 +0100)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Sun, 11 Mar 2018 23:20:24 +0000 (00:20 +0100)
lib/net.c

index 24619fca72432fdd1ac695f5b745e6e6a1bc31ef..03b79116056318b8ef3d7cc03ebddcc52897a90c 100644 (file)
--- a/lib/net.c
+++ b/lib/net.c
@@ -1,5 +1,6 @@
 
 #include "nest/bird.h"
+#include "nest/iface.h"
 #include "lib/ip.h"
 #include "lib/net.h"
 #include "lib/flowspec.h"
@@ -89,6 +90,7 @@ int
 net_format(const net_addr *N, char *buf, int buflen)
 {
   net_addr_union *n = (void *) N;
+  struct iface *ifa;
   buf[0] = 0;
 
   switch (n->n.type)
@@ -119,9 +121,11 @@ net_format(const net_addr *N, char *buf, int buflen)
   case NET_FLOW6:
     return flow6_net_format(buf, buflen, &n->flow6);
   case NET_MREQ4:
-    return bsnprintf(buf, buflen, "%I4", n->mreq4.grp);
+    ifa = if_find_by_index(n->mreq4.ifindex);
+    return bsnprintf(buf, buflen, "(*, %I4, %s)", n->mreq4.grp, ifa ? ifa->name : "?");
   case NET_MREQ6:
-    return bsnprintf(buf, buflen, "%I6", n->mreq6.grp);
+    ifa = if_find_by_index(n->mreq6.ifindex);
+    return bsnprintf(buf, buflen, "(*, %I6, %s)", n->mreq6.grp, ifa ? ifa->name : "?");
   case NET_MGRP4:
     return bsnprintf(buf, buflen, "(*, %I4)", n->mgrp4.grp);
   case NET_MGRP6: