diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-12-04 09:06:09 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-12-04 09:06:09 -0500 |
| commit | 0e21e01c4fb79356a52f1ab0b19b14024e89b0a4 (patch) | |
| tree | 9c3670fcd7a835ddbccae4bf3b71427f06489466 /ldpd/ldp_zebra.c | |
| parent | 6bbda63df7eb3dc89c84869ec36fc53432f4828a (diff) | |
| parent | cddef813e1fee33937d1e56fce84f708e17a4aa6 (diff) | |
Merge pull request #1500 from opensourcerouting/ldpd-fixes
ldpd: small improvements
Diffstat (limited to 'ldpd/ldp_zebra.c')
| -rw-r--r-- | ldpd/ldp_zebra.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/ldpd/ldp_zebra.c b/ldpd/ldp_zebra.c index e703a9ff61..a12a4b913e 100644 --- a/ldpd/ldp_zebra.c +++ b/ldpd/ldp_zebra.c @@ -450,18 +450,38 @@ ldp_zebra_read_route(int command, struct zclient *zclient, zebra_size_t length, /* loop through all the nexthops */ for (i = 0; i < api.nexthop_num; i++) { api_nh = &api.nexthops[i]; - - switch (kr.af) { - case AF_INET: + switch (api_nh->type) { + case NEXTHOP_TYPE_IPV4: + if (kr.af != AF_INET) + continue; + kr.nexthop.v4 = api_nh->gate.ipv4; + kr.ifindex = 0; + break; + case NEXTHOP_TYPE_IPV4_IFINDEX: + if (kr.af != AF_INET) + continue; kr.nexthop.v4 = api_nh->gate.ipv4; + kr.ifindex = api_nh->ifindex; break; - case AF_INET6: + case NEXTHOP_TYPE_IPV6: + if (kr.af != AF_INET6) + continue; kr.nexthop.v6 = api_nh->gate.ipv6; + kr.ifindex = 0; break; - default: + case NEXTHOP_TYPE_IPV6_IFINDEX: + if (kr.af != AF_INET6) + continue; + kr.nexthop.v6 = api_nh->gate.ipv6; + kr.ifindex = api_nh->ifindex; + break; + case NEXTHOP_TYPE_IFINDEX: + if (!(kr.flags & F_CONNECTED)) + continue; break; + default: + continue; } - kr.ifindex = api_nh->ifindex;; debug_zebra_in("route %s %s/%d nexthop %s ifindex %u (%s)", (add) ? "add" : "delete", log_addr(kr.af, &kr.prefix), |
