]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd, zebra: support NEXTHOP_IPV4_IFINDEX in bgp import check
authorChristian Franke <chris@opensourcerouting.org>
Sat, 25 May 2013 14:01:36 +0000 (14:01 +0000)
committerDavid Lamparter <equinox@opensourcerouting.org>
Tue, 6 Aug 2013 10:41:46 +0000 (12:41 +0200)
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd/bgp_nexthop.c
zebra/zserv.c

index 7d8d866585d48d508f91fdd17a063cf856fd5384..e23155c7ef6d93601dd418b8708fd9dbd0314d07 100644 (file)
@@ -1093,14 +1093,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;
     }
index f792c83884971f27f04e7a16715faaac67920d9a..1182937800c1081520c96e9d687c59b85542bde4 100644 (file)
@@ -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);