summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_nht.c
diff options
context:
space:
mode:
authorLou Berger <lberger@labn.net>2016-10-07 15:44:42 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-10-18 14:33:05 +0200
commitafbb1c59a3b4dbbe41b1869642b31e39fb0136d2 (patch)
tree298acb423c829ec89ab8c58b13e5748613c1b8b3 /bgpd/bgp_nht.c
parentrfapi: cleanup some warnings (diff)
downloadfrr-afbb1c59a3b4dbbe41b1869642b31e39fb0136d2.tar.xz
frr-afbb1c59a3b4dbbe41b1869642b31e39fb0136d2.zip
bgp: ignore NHT when bgpd has never connected to zebra
Diffstat (limited to 'bgpd/bgp_nht.c')
-rw-r--r--bgpd/bgp_nht.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c
index ef70d0e4f..d1f7fe341 100644
--- a/bgpd/bgp_nht.c
+++ b/bgpd/bgp_nht.c
@@ -41,6 +41,7 @@
#include "bgpd/bgp_debug.h"
#include "bgpd/bgp_nht.h"
#include "bgpd/bgp_fsm.h"
+#include "bgpd/bgp_zebra.h"
extern struct zclient *zclient;
@@ -234,7 +235,8 @@ bgp_find_or_add_nexthop (struct bgp *bgp, afi_t afi, struct bgp_info *ri,
else if (peer)
bnc->nht_info = (void *)peer;
- return (CHECK_FLAG(bnc->flags, BGP_NEXTHOP_VALID));
+ return (bgp_zebra_num_connects() == 0 ||
+ CHECK_FLAG(bnc->flags, BGP_NEXTHOP_VALID));
}
void