diff options
author | Christian Franke <chris@opensourcerouting.org> | 2013-05-25 14:01:36 +0000 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2013-08-06 12:41:46 +0200 |
commit | a12afd5e8e57c95505d4d0166af234c7f19e9fe1 (patch) | |
tree | 62f3d6a2d92ce06d857fd90240a8a8806ff38951 /bgpd/bgp_nexthop.c | |
parent | bb97e4622ed6f48e2b8e07f1f94edd03162223a1 (diff) |
bgpd, zebra: support NEXTHOP_IPV4_IFINDEX in bgp import check
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_nexthop.c')
-rw-r--r-- | bgpd/bgp_nexthop.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index 7d8d8665..e23155c7 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; } |