]> git.puffer.fish Git - matthieu/frr.git/commitdiff
vrrpd: add more dbg logs around interfaces
authorQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 1 Aug 2019 17:35:09 +0000 (17:35 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 2 Aug 2019 17:20:44 +0000 (17:20 +0000)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
vrrpd/vrrp.c
vrrpd/vrrp_zebra.c

index 5213b27d32c21fdc624b5ecc2ef91c31cf66163d..8e6c6389efd99184741786cfc9f98f590b3cc05d 100644 (file)
@@ -197,8 +197,19 @@ static struct vrrp_vrouter *vrrp_lookup_by_if_mvl(struct interface *mvl_ifp)
        struct interface *p;
 
        if (!mvl_ifp || !mvl_ifp->link_ifindex
-           || !vrrp_ifp_has_vrrp_mac(mvl_ifp))
+           || !vrrp_ifp_has_vrrp_mac(mvl_ifp)) {
+               if (!mvl_ifp->link_ifindex)
+                       DEBUGD(&vrrp_dbg_zebra,
+                              VRRP_LOGPFX
+                              "Interface %s has no parent ifindex; disregarding",
+                              mvl_ifp->name);
+               if (!vrrp_ifp_has_vrrp_mac(mvl_ifp))
+                       DEBUGD(&vrrp_dbg_zebra,
+                              VRRP_LOGPFX
+                              "Interface %s has a non-VRRP MAC; disregarding",
+                              mvl_ifp->name);
                return NULL;
+       }
 
        p = if_lookup_by_index(mvl_ifp->link_ifindex, VRF_DEFAULT);
        uint8_t vrid = mvl_ifp->hw_addr[5];
@@ -2028,9 +2039,19 @@ static void vrrp_bind_pending(struct interface *mvl_ifp)
 {
        struct vrrp_vrouter *vr;
 
+       DEBUGD(&vrrp_dbg_zebra,
+              VRRP_LOGPFX
+              "Searching for instances that could use interface %s",
+              mvl_ifp->name);
+
        vr = vrrp_lookup_by_if_mvl(mvl_ifp);
 
        if (vr) {
+               DEBUGD(&vrrp_dbg_zebra,
+                      VRRP_LOGPFX VRRP_LOGPFX_VRID
+                      "<-- This instance can probably use interface %s",
+                      vr->vrid, mvl_ifp->name);
+
                if (mvl_ifp->hw_addr[4] == 0x01 && !vr->v4->mvl_ifp)
                        vrrp_attach_interface(vr->v4);
                else if (mvl_ifp->hw_addr[4] == 0x02 && !vr->v6->mvl_ifp)
index dbfcbe945ed44994e5fc5d2295c8c3c1af7c8d71..72b77c1313697efd8b5ee3b441fdad7129386909 100644 (file)
@@ -38,9 +38,11 @@ static void vrrp_zebra_debug_if_state(struct interface *ifp, vrf_id_t vrf_id,
                                      const char *func)
 {
        DEBUGD(&vrrp_dbg_zebra,
-              "%s: %s index %d(%u) flags %ld metric %d mtu %d operative %d",
-              func, ifp->name, ifp->ifindex, vrf_id, (long)ifp->flags,
-              ifp->metric, ifp->mtu, if_is_operative(ifp));
+              "%s: %s index %d(%u) parent %d mac %02x:%02x:%02x:%02x:%02x:%02x flags %ld metric %d mtu %d operative %d",
+              func, ifp->name, vrf_id, ifp->link_ifindex, ifp->ifindex,
+              ifp->hw_addr[0], ifp->hw_addr[1], ifp->hw_addr[2],
+              ifp->hw_addr[3], ifp->hw_addr[4], ifp->hw_addr[5],
+              (long)ifp->flags, ifp->metric, ifp->mtu, if_is_operative(ifp));
 }
 
 static void vrrp_zebra_debug_if_dump_address(struct interface *ifp,