From ea12cf1125ef21b334c1f1703ed6224242c15bf8 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 25 Oct 2017 22:38:50 -0400 Subject: [PATCH] bgpd: When not fully connected to zebra gracefully ignore the issue When bgp is coming up and is reading a non-integrated config. The bgp connection to zebra has not fully had a chance to start. As such when a redistribute line is parsed the attempt is made to install it but it was erroring out with a warning. This caused the `redistribute XXX` line to create a error message to the end user. Since bgp calls zclient_send_reg_requests which re-registers the redistribute call once the actual zebra connection is up and once bgp comes alive this is ok. Signed-off-by: Donald Sharp --- bgpd/bgp_zebra.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 0d1d768294..bec7050226 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1338,12 +1338,14 @@ int bgp_redistribute_set(struct bgp *bgp, afi_t afi, int type, u_short instance) vrf_bitmap_set(zclient->redist[afi][type], bgp->vrf_id); } - /* Don't try to register if we're not connected to Zebra or Zebra - * doesn't - * know of this instance. + /* + * Don't try to register if we're not connected to Zebra or Zebra + * doesn't know of this instance. + * + * When we come up later well resend if needed. */ if (!bgp_install_info_to_zebra(bgp)) - return CMD_WARNING_CONFIG_FAILED; + return CMD_SUCCESS; if (BGP_DEBUG(zebra, ZEBRA)) zlog_debug("Tx redistribute add VRF %u afi %d %s %d", -- 2.39.5