[quagga-dev,16312,2/5] zebra: fix nht validity checking to be same as when it's resolved

Message ID 20161019130235.26602-3-timo.teras@iki.fi
State Under Review
Headers show
Series
  • NHRP implementation
Related show

Commit Message

Timo Teräs Oct. 19, 2016, 1:02 p.m.
This reverts commit 7e3a435bd99 "A valid BGP nexthop is flagged as invalid"

Problem is BGP thinks the nexthop is accessible when it's recursive, and
selects it, but zebra rejects it at route install time. Causing FIB and
BGP state to be out-of-sync. Fix nht to follow same rules as zebra rib.
---
 zebra/zebra_rnh.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c
index 97d3597..5762d3f 100644
--- a/zebra/zebra_rnh.c
+++ b/zebra/zebra_rnh.c
@@ -498,8 +498,8 @@  send_client (struct rnh *rnh, struct zserv *client, vrf_id_t vrf_id)
       nump = stream_get_endp(s);
       stream_putc (s, 0);
       for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next)
-	if ((CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB) ||
-             CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE)) &&
+	if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB) &&
+            ! CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE) &&
 	    CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
 	  {
 	    stream_putc (s, nexthop->type);