]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bfdd: improve some debug messages related to zebra notifications
authorPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 8 Jan 2021 15:17:28 +0000 (15:17 +0000)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Sat, 9 Jan 2021 13:29:45 +0000 (13:29 +0000)
when receiving interface and address notifications, one may be puzzled
by the information since for example, the presence of an interface is
not enough to use it in a bfd session, simply because the interface is
in the wrong vrf. add VRF information on those traces.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bfdd/bfd.c
bfdd/ptm_adapter.c

index 622b6ef396975e9f5816a664e3bda7f34d538518..ca4bf949556ff31d71bc826b882415ec39ac3904 100644 (file)
@@ -327,14 +327,16 @@ int bfd_session_enable(struct bfd_session *bs)
                        ifp = if_lookup_by_name_all_vrf(bs->key.ifname);
                if (ifp == NULL) {
                        zlog_err(
-                               "session-enable: specified interface doesn't exists.");
+                               "session-enable: specified interface %s (VRF %s) doesn't exist.",
+                               bs->key.ifname, vrf ? vrf->name : "<all>");
                        return 0;
                }
                if (bs->key.ifname[0] && !vrf) {
                        vrf = vrf_lookup_by_id(ifp->vrf_id);
                        if (vrf == NULL) {
                                zlog_err(
-                                       "session-enable: specified VRF doesn't exists.");
+                                       "session-enable: specified VRF %u doesn't exist.",
+                                       ifp->vrf_id);
                                return 0;
                        }
                }
index 26ff7bd188796d569e2bc0dee8ba8c67ce7c5a4d..57fb81aa27a733163a16c846dd3917eb766720c1 100644 (file)
@@ -766,7 +766,8 @@ void bfdd_sessions_disable_vrf(struct vrf *vrf)
 static int bfd_ifp_destroy(struct interface *ifp)
 {
        if (bglobal.debug_zebra)
-               zlog_debug("zclient: delete interface %s", ifp->name);
+               zlog_debug("zclient: delete interface %s (VRF %u)", ifp->name,
+                          ifp->vrf_id);
 
        bfdd_sessions_disable_interface(ifp);
 
@@ -819,10 +820,10 @@ static int bfdd_interface_address_update(ZAPI_CALLBACK_ARGS)
                return 0;
 
        if (bglobal.debug_zebra)
-               zlog_debug("zclient: %s local address %pFX",
+               zlog_debug("zclient: %s local address %pFX (VRF %u)",
                           cmd == ZEBRA_INTERFACE_ADDRESS_ADD ? "add"
                                                              : "delete",
-                          ifc->address);
+                          ifc->address, vrf_id);
 
        if (cmd == ZEBRA_INTERFACE_ADDRESS_ADD)
                bfdd_sessions_enable_address(ifc);
@@ -835,8 +836,8 @@ static int bfdd_interface_address_update(ZAPI_CALLBACK_ARGS)
 static int bfd_ifp_create(struct interface *ifp)
 {
        if (bglobal.debug_zebra)
-               zlog_debug("zclient: add interface %s", ifp->name);
-
+               zlog_debug("zclient: add interface %s (VRF %u)", ifp->name,
+                          ifp->vrf_id);
        bfdd_sessions_enable_interface(ifp);
 
        return 0;