Merge pull request #8077 from taspelund/ospf_flood_debug_improvements

ospfd: cleanup ospf_flood debugs
This commit is contained in:
Russ White 2021-02-16 11:19:47 -05:00 committed by GitHub
commit 9238b5ba4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -458,11 +458,11 @@ static int ospf_flood_through_interface(struct ospf_interface *oi,
if (IS_DEBUG_OSPF_EVENT) if (IS_DEBUG_OSPF_EVENT)
zlog_debug( zlog_debug(
"%s:ospf_flood_through_interface(): considering int %s, INBR(%s), LSA[%s] AGE %u", "%s: considering int %s (%s), INBR(%s), LSA[%s] AGE %u",
ospf_get_name(oi->ospf), IF_NAME(oi), __func__, IF_NAME(oi), ospf_get_name(oi->ospf),
inbr ? inbr ? inet_ntop(AF_INET, &inbr->router_id, buf,
inet_ntop(AF_INET, &inbr->router_id, buf, sizeof(buf)) : sizeof(buf))
"NULL", : "NULL",
dump_lsa_key(lsa), ntohs(lsa->data->ls_age)); dump_lsa_key(lsa), ntohs(lsa->data->ls_age));
if (!ospf_if_is_enable(oi)) if (!ospf_if_is_enable(oi))
@ -483,8 +483,8 @@ static int ospf_flood_through_interface(struct ospf_interface *oi,
onbr = rn->info; onbr = rn->info;
if (IS_DEBUG_OSPF_EVENT) if (IS_DEBUG_OSPF_EVENT)
zlog_debug( zlog_debug(
"ospf_flood_through_interface(): considering nbr %pI4(%s) (%s)", "%s: considering nbr %pI4 via %s (%s), state: %s",
&onbr->router_id, __func__, &onbr->router_id, IF_NAME(oi),
ospf_get_name(oi->ospf), ospf_get_name(oi->ospf),
lookup_msg(ospf_nsm_state_msg, onbr->state, lookup_msg(ospf_nsm_state_msg, onbr->state,
NULL)); NULL));
@ -504,7 +504,10 @@ static int ospf_flood_through_interface(struct ospf_interface *oi,
if (onbr->state < NSM_Full) { if (onbr->state < NSM_Full) {
if (IS_DEBUG_OSPF_EVENT) if (IS_DEBUG_OSPF_EVENT)
zlog_debug( zlog_debug(
"ospf_flood_through_interface(): nbr adj is not Full"); "%s: adj to onbr %pI4 is not Full (%s)",
__func__, &onbr->router_id,
lookup_msg(ospf_nsm_state_msg,
onbr->state, NULL));
ls_req = ospf_ls_request_lookup(onbr, lsa); ls_req = ospf_ls_request_lookup(onbr, lsa);
if (ls_req != NULL) { if (ls_req != NULL) {
int ret; int ret;
@ -534,7 +537,11 @@ static int ospf_flood_through_interface(struct ospf_interface *oi,
if (!CHECK_FLAG(onbr->options, OSPF_OPTION_O)) { if (!CHECK_FLAG(onbr->options, OSPF_OPTION_O)) {
if (IS_DEBUG_OSPF(lsa, LSA_FLOODING)) if (IS_DEBUG_OSPF(lsa, LSA_FLOODING))
zlog_debug( zlog_debug(
"Skip this neighbor: Not Opaque-capable."); "%s: Skipping neighbor %s via %s -- Not Opaque-capable.",
__func__, IF_NAME(oi),
inet_ntop(AF_INET,
&onbr->router_id, buf,
sizeof(buf)));
continue; continue;
} }
} }
@ -550,7 +557,11 @@ static int ospf_flood_through_interface(struct ospf_interface *oi,
&onbr->router_id)) { &onbr->router_id)) {
if (IS_DEBUG_OSPF(lsa, LSA_FLOODING)) if (IS_DEBUG_OSPF(lsa, LSA_FLOODING))
zlog_debug( zlog_debug(
"Skip this neighbor: inbr == onbr"); "%s: Skipping neighbor %s via %s -- inbr == onbr.",
__func__, IF_NAME(oi),
inet_ntop(AF_INET,
&inbr->router_id, buf,
sizeof(buf)));
continue; continue;
} }
} else { } else {
@ -562,7 +573,11 @@ static int ospf_flood_through_interface(struct ospf_interface *oi,
&onbr->router_id)) { &onbr->router_id)) {
if (IS_DEBUG_OSPF(lsa, LSA_FLOODING)) if (IS_DEBUG_OSPF(lsa, LSA_FLOODING))
zlog_debug( zlog_debug(
"Skip this neighbor: lsah->adv_router == onbr"); "%s: Skipping neighbor %s via %s -- lsah->adv_router == onbr.",
__func__, IF_NAME(oi),
inet_ntop(AF_INET,
&onbr->router_id, buf,
sizeof(buf)));
continue; continue;
} }
} }
@ -591,9 +606,9 @@ static int ospf_flood_through_interface(struct ospf_interface *oi,
received the LSA already. */ received the LSA already. */
if (NBR_IS_DR(inbr) || NBR_IS_BDR(inbr)) { if (NBR_IS_DR(inbr) || NBR_IS_BDR(inbr)) {
if (IS_DEBUG_OSPF_NSSA) if (IS_DEBUG_OSPF_NSSA)
zlog_debug( zlog_debug("%s: DR/BDR NOT SEND to int %s (%s)",
"ospf_flood_through_interface(): DR/BDR NOT SEND to int %s", __func__, IF_NAME(oi),
IF_NAME(oi)); ospf_get_name(oi->ospf));
return 1; return 1;
} }
@ -606,8 +621,9 @@ static int ospf_flood_through_interface(struct ospf_interface *oi,
if (oi->state == ISM_Backup) { if (oi->state == ISM_Backup) {
if (IS_DEBUG_OSPF_NSSA) if (IS_DEBUG_OSPF_NSSA)
zlog_debug( zlog_debug(
"ospf_flood_through_interface(): ISM_Backup NOT SEND to int %s", "%s: ISM_Backup NOT SEND to int %s (%s)",
IF_NAME(oi)); __func__, IF_NAME(oi),
ospf_get_name(oi->ospf));
return 1; return 1;
} }
} }
@ -620,9 +636,8 @@ static int ospf_flood_through_interface(struct ospf_interface *oi,
value of MaxAge). */ value of MaxAge). */
/* XXX HASSO: Is this IS_DEBUG_OSPF_NSSA really correct? */ /* XXX HASSO: Is this IS_DEBUG_OSPF_NSSA really correct? */
if (IS_DEBUG_OSPF_NSSA) if (IS_DEBUG_OSPF_NSSA)
zlog_debug( zlog_debug("%s: DR/BDR sending upd to int %s (%s)", __func__,
"ospf_flood_through_interface(): DR/BDR sending upd to int %s", IF_NAME(oi), ospf_get_name(oi->ospf));
IF_NAME(oi));
/* RFC2328 Section 13.3 /* RFC2328 Section 13.3
On non-broadcast networks, separate Link State Update On non-broadcast networks, separate Link State Update