From: Philippe Guibert Date: Fri, 8 Jan 2021 15:17:28 +0000 (+0000) Subject: bfdd: improve some debug messages related to zebra notifications X-Git-Tag: base_7.6~21^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=99950bc559cd2b466e4d02447fa6c1ecc5395270;p=matthieu%2Ffrr.git bfdd: improve some debug messages related to zebra notifications 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 --- diff --git a/bfdd/bfd.c b/bfdd/bfd.c index 622b6ef396..ca4bf94955 100644 --- a/bfdd/bfd.c +++ b/bfdd/bfd.c @@ -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 : ""); 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; } } diff --git a/bfdd/ptm_adapter.c b/bfdd/ptm_adapter.c index 26ff7bd188..57fb81aa27 100644 --- a/bfdd/ptm_adapter.c +++ b/bfdd/ptm_adapter.c @@ -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;