summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-10-05 09:43:28 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-10-31 06:31:41 -0400
commitbb4ef1aec80227d318e48ed65c261b812e356f1b (patch)
tree00506354697ffa88f2a23cc46484abb815485ce0
parentab5990d8b9756d880f7e3f21772362d9c161b3e0 (diff)
bgpd: Add some debugs to note when we are not talking to zebra
Allow some debug notification when we are unable to talk to zebra due to the connection not being there yet. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--bgpd/bgp_evpn.c13
-rw-r--r--bgpd/bgp_nht.c6
-rw-r--r--bgpd/bgp_zebra.c23
-rw-r--r--bgpd/bgpd.c13
4 files changed, 44 insertions, 11 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c
index 574ece8cc5..c91a2ab6bd 100644
--- a/bgpd/bgp_evpn.c
+++ b/bgpd/bgp_evpn.c
@@ -558,9 +558,12 @@ static int bgp_zebra_send_remote_macip(struct bgp *bgp, struct bgpevpn *vpn,
return 0;
/* Don't try to register if Zebra doesn't know of this instance. */
- if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
+ if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
+ if (BGP_DEBUG(zebra, ZEBRA))
+ zlog_debug("%s: No zebra instance to talk to, not installing remote macip",
+ __PRETTY_FUNCTION__);
return 0;
-
+ }
s = zclient->obuf;
stream_reset(s);
@@ -616,8 +619,12 @@ static int bgp_zebra_send_remote_vtep(struct bgp *bgp, struct bgpevpn *vpn,
return 0;
/* Don't try to register if Zebra doesn't know of this instance. */
- if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
+ if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
+ if (BGP_DEBUG(zebra, ZEBRA))
+ zlog_debug("%s: No zebra instance to talk to, not installing remote vtep",
+ __PRETTY_FUNCTION__);
return 0;
+ }
s = zclient->obuf;
stream_reset(s);
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c
index e764860bcc..2e7f17fdae 100644
--- a/bgpd/bgp_nht.c
+++ b/bgpd/bgp_nht.c
@@ -587,8 +587,12 @@ static void sendmsg_zebra_rnh(struct bgp_nexthop_cache *bnc, int command)
return;
/* Don't try to register if Zebra doesn't know of this instance. */
- if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bnc->bgp))
+ if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bnc->bgp)) {
+ if (BGP_DEBUG(zebra, ZEBRA))
+ zlog_debug("%s: No zebra instance to talk to, not installing NHT entry",
+ __PRETTY_FUNCTION__);
return;
+ }
p = &(bnc->node->p);
if ((command == ZEBRA_NEXTHOP_REGISTER
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index 81a5be9d0c..0b79a9ee18 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -68,8 +68,11 @@ static inline int bgp_install_info_to_zebra(struct bgp *bgp)
if (zclient->sock <= 0)
return 0;
- if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
+ if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
+ zlog_debug("%s: No zebra instance to talk to, not installing information",
+ __PRETTY_FUNCTION__);
return 0;
+ }
return 1;
}
@@ -1895,8 +1898,12 @@ int bgp_zebra_advertise_subnet(struct bgp *bgp, int advertise, vni_t vni)
return 0;
/* Don't try to register if Zebra doesn't know of this instance. */
- if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
+ if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
+ if (BGP_DEBUG(zebra, ZEBRA))
+ zlog_debug("%s: No zebra instance to talk to, cannot advertise subnet",
+ __PRETTY_FUNCTION__);
return 0;
+ }
s = zclient->obuf;
stream_reset(s);
@@ -1918,8 +1925,12 @@ int bgp_zebra_advertise_gw_macip(struct bgp *bgp, int advertise, vni_t vni)
return 0;
/* Don't try to register if Zebra doesn't know of this instance. */
- if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
+ if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
+ if (BGP_DEBUG(zebra, ZEBRA))
+ zlog_debug("%s: No zebra instance to talk to, not installing gw_macip",
+ __PRETTY_FUNCTION__);
return 0;
+ }
s = zclient->obuf;
stream_reset(s);
@@ -1942,8 +1953,12 @@ int bgp_zebra_vxlan_flood_control(struct bgp *bgp,
return 0;
/* Don't try to register if Zebra doesn't know of this instance. */
- if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
+ if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
+ if (BGP_DEBUG(zebra, ZEBRA))
+ zlog_debug("%s: No zebra instance to talk to, not installing all vni",
+ __PRETTY_FUNCTION__);
return 0;
+ }
s = zclient->obuf;
stream_reset(s);
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index be092e9501..19384eec2f 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -3072,9 +3072,12 @@ int bgp_get(struct bgp **bgp_val, as_t *as, const char *name,
bgp_handle_socket(bgp, vrf, VRF_UNKNOWN, true);
listnode_add(bm->bgp, bgp);
- if (IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
+ if (IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
+ if (BGP_DEBUG(zebra, ZEBRA))
+ zlog_debug("%s: Registering BGP instance %s to zebra",
+ __PRETTY_FUNCTION__, name);
bgp_zebra_instance_register(bgp);
-
+ }
return 0;
}
@@ -3218,8 +3221,12 @@ int bgp_delete(struct bgp *bgp)
}
/* Deregister from Zebra, if needed */
- if (IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
+ if (IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
+ if (BGP_DEBUG(zebra, ZEBRA))
+ zlog_debug("%s: deregistering this bgp %s instance from zebra",
+ __PRETTY_FUNCTION__, bgp->name);
bgp_zebra_instance_deregister(bgp);
+ }
/* Remove visibility via the master list - there may however still be
* routes to be processed still referencing the struct bgp.