]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Change ioctl call failure from vty_out to zlog_warn
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 2 Jul 2015 13:53:59 +0000 (09:53 -0400)
committerDonald Sharp <sharpd@cumulusnetwroks.com>
Thu, 26 May 2016 00:38:33 +0000 (20:38 -0400)
The command 'show ip multicast' when run, iterates over all interfaces
on the router, if you do not have pim configured on that interface
it would generate an error message:

Interface Address         ifi Vif  PktsIn PktsOut    BytesIn   BytesOut
br1       20.0.15.1         7   7       0       0          0          0
swp1      169.254.0.10      3   3       0       0          0          0
swp2      169.254.0.26      4   4       0       0          0          0
ioctl(SIOCGETVIFCNT=35296) failure for interface swp3 vif_index=-1: errno=22: Invalid argument
ioctl(SIOCGETVIFCNT=35296) failure for interface swp4 vif_index=-1: errno=22: Invalid argument

This fixes the issue to display this instead:

Interface Address         ifi Vif  PktsIn PktsOut    BytesIn   BytesOut
br1       20.0.15.1         7   7       0       0          0          0
swp1      169.254.0.10      3   3       0       0          0          0
swp2      169.254.0.26      4   4       0       0          0          0
swp3      0.0.0.0           5  -1       0       0          0          0
swp4      0.0.0.0           6  -1       0       0          0          0

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_cmd.c

index 0acba045b8f5b5103487809adcab4b016f05131f..2bc1de00705afbe784e4fb5ccb44c57e998a336c 100644 (file)
@@ -2070,16 +2070,13 @@ static void show_multicast_interfaces(struct vty *vty)
     vreq.vifi = pim_ifp->mroute_vif_index;
 
     if (ioctl(qpim_mroute_socket_fd, SIOCGETVIFCNT, &vreq)) {
-      int e = errno;
-      vty_out(vty,
-             "ioctl(SIOCGETVIFCNT=%lu) failure for interface %s vif_index=%d: errno=%d: %s%s",
-             (unsigned long)SIOCGETVIFCNT,
-             ifp->name,
-             pim_ifp->mroute_vif_index,
-             e,
-             safe_strerror(e),
-             VTY_NEWLINE);           
-      continue;
+      zlog_warn("ioctl(SIOCGETVIFCNT=%lu) failure for interface %s vif_index=%d: errno=%d: %s%s",
+               (unsigned long)SIOCGETVIFCNT,
+               ifp->name,
+               pim_ifp->mroute_vif_index,
+               errno,
+               safe_strerror(errno),
+               VTY_NEWLINE);
     }
 
     ifaddr = pim_ifp->primary_address;