From: Christian Franke Date: Sat, 25 May 2013 14:01:36 +0000 (+0000) Subject: bgpd, zebra: support NEXTHOP_IPV4_IFINDEX in bgp import check X-Git-Tag: frr-2.0-rc1~1650 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=a12afd5e8e57c95505d4d0166af234c7f19e9fe1;p=matthieu%2Ffrr.git bgpd, zebra: support NEXTHOP_IPV4_IFINDEX in bgp import check Signed-off-by: Christian Franke Signed-off-by: David Lamparter --- diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index 7d8d866585..e23155c7ef 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -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; } diff --git a/zebra/zserv.c b/zebra/zserv.c index f792c83884..1182937800 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);