Browse Source

pimd: Log ifindex found for an interface when zebra lib reports a new connected address.

Everton Marques 4 years ago
parent
commit
85385f7eee
3 changed files with 10 additions and 10 deletions
  1. 6 6
      pimd/pim_iface.c
  2. 2 2
      pimd/pim_pim.c
  3. 2 2
      pimd/pim_zebra.c

+ 6 - 6
pimd/pim_iface.c

@@ -388,12 +388,12 @@ void pim_if_addr_add(struct connected *ifc)
   if (!if_is_operative(ifp))
     return;
 
-  if (PIM_DEBUG_ZEBRA) {
+  /* if (PIM_DEBUG_ZEBRA) */ {
     char buf[BUFSIZ];
     prefix2str(ifc->address, buf, BUFSIZ);
-    zlog_debug("%s: %s connected IP address %s %s",
+    zlog_debug("%s: %s ifindex=%d connected IP address %s %s",
 	       __PRETTY_FUNCTION__,
-	       ifp->name, buf,
+	       ifp->name, ifp->ifindex, buf,
 	       CHECK_FLAG(ifc->flags, ZEBRA_IFA_SECONDARY) ?
 	       "secondary" : "primary");
   }
@@ -507,12 +507,12 @@ void pim_if_addr_del(struct connected *ifc, int force_prim_as_any)
   ifp = ifc->ifp;
   zassert(ifp);
 
-  if (PIM_DEBUG_ZEBRA) {
+  /* if (PIM_DEBUG_ZEBRA) */ {
     char buf[BUFSIZ];
     prefix2str(ifc->address, buf, BUFSIZ);
-    zlog_debug("%s: %s disconnected IP address %s %s",
+    zlog_debug("%s: %s ifindex=%d disconnected IP address %s %s",
 	       __PRETTY_FUNCTION__,
-	       ifp->name, buf,
+	       ifp->name, ifp->ifindex, buf,
 	       CHECK_FLAG(ifc->flags, ZEBRA_IFA_SECONDARY) ?
 	       "secondary" : "primary");
   }

+ 2 - 2
pimd/pim_pim.c

@@ -725,8 +725,8 @@ int pim_sock_add(struct interface *ifp)
 
   pim_ifp->pim_generation_id = pim_rand() & (int64_t) 0xFFFFFFFF;
 
-  zlog_info("PIM INTERFACE UP: on interface %s",
-	    ifp->name);
+  zlog_info("PIM INTERFACE UP: on interface %s ifindex=%d",
+	    ifp->name, ifp->ifindex);
 
   /*
    * Start receiving PIM messages

+ 2 - 2
pimd/pim_zebra.c

@@ -150,7 +150,7 @@ static int pim_zebra_if_state_up(int command, struct zclient *zclient,
   if (!ifp)
     return 0;
 
-  zlog_info("INTERFACE UP: %s", ifp->name);
+  zlog_info("INTERFACE UP: %s ifindex=%d", ifp->name, ifp->ifindex);
 
   if (PIM_DEBUG_ZEBRA) {
     zlog_debug("%s: %s index %d flags %ld metric %d mtu %d operative %d",
@@ -182,7 +182,7 @@ static int pim_zebra_if_state_down(int command, struct zclient *zclient,
   if (!ifp)
     return 0;
 
-  zlog_info("INTERFACE DOWN: %s", ifp->name);
+  zlog_info("INTERFACE DOWN: %s ifindex=%d", ifp->name, ifp->ifindex);
 
   if (PIM_DEBUG_ZEBRA) {
     zlog_debug("%s: %s index %d flags %ld metric %d mtu %d operative %d",