zebra: Fix incorrectly flagged nexthop

A valid BGP nexthop is sometimes flagged as invalid, this patch
fixes that issue.

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Edited-by: Paul Jakma <paul.jakma@hpe.com>, also add the check for
NEXTHOP_FLAG_ACTIVE which was added in a separate, route-map related commit
(6baeed5 lib, zebra: Add route-map support for Next Hop Tracking)
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c
index db2a34d..02a1468 100644
--- a/zebra/zebra_rnh.c
+++ b/zebra/zebra_rnh.c
@@ -490,7 +490,9 @@
       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))
+	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);
 	    switch (nexthop->type)