[quagga-dev 10542] [PATCH 3/3] bgpd, zebra: support NEXTHOP_IPV4_IFINDEX in bgp import check

Christian Franke chris at opensourcerouting.org
Sat May 25 16:01:36 BST 2013


Signed-off-by: Christian Franke <chris at opensourcerouting.org>
---
 bgpd/bgp_nexthop.c |   16 +++++++++++-----
 zebra/zserv.c      |    4 ++++
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c
index 69440ce..75b1e9e 100644
--- a/bgpd/bgp_nexthop.c
+++ b/bgpd/bgp_nexthop.c
@@ -1088,14 +1088,20 @@ bgp_import_check (struct prefix *p, u_int32_t *igpmetric,
     {
       nexthop.s_addr = 0;
       nexthop_type = stream_getc (s);
-      if (nexthop_type == ZEBRA_NEXTHOP_IPV4)
+      switch (nexthop_type)
 	{
+	case ZEBRA_NEXTHOP_IPV4:
 	  nexthop.s_addr = stream_get_ipv4 (s);
-	  if (igpnexthop)
-	    *igpnexthop = nexthop;
+	  break;
+	case ZEBRA_NEXTHOP_IPV4_IFINDEX:
+	  nexthop.s_addr = stream_get_ipv4 (s);
+	  /* ifindex */ (void)stream_getl (s);
+	  break;
+	default:
+	  /* do nothing */
+	  break;
 	}
-      else
-	*igpnexthop = nexthop;
+      *igpnexthop = nexthop;
 
       return 1;
     }
diff --git a/zebra/zserv.c b/zebra/zserv.c
index bcb1680..fa289c5 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -627,6 +627,10 @@ zsend_ipv4_import_lookup (struct zserv *client, struct prefix_ipv4 *p)
 	      case ZEBRA_NEXTHOP_IPV4:
 		stream_put_in_addr (s, &nexthop->gate.ipv4);
 		break;
+	      case ZEBRA_NEXTHOP_IPV4_IFINDEX:
+		stream_put_in_addr (s, &nexthop->gate.ipv4);
+		stream_putl (s, nexthop->ifindex);
+		break;
 	      case ZEBRA_NEXTHOP_IFINDEX:
 	      case ZEBRA_NEXTHOP_IFNAME:
 		stream_putl (s, nexthop->ifindex);
-- 
1.7.10.4





More information about the Quagga-dev mailing list