diff options
| author | Mark Stapp <mjs@voltanet.io> | 2020-02-13 16:47:41 -0500 |
|---|---|---|
| committer | Mark Stapp <mjs@voltanet.io> | 2020-02-14 16:16:21 -0500 |
| commit | 4945002d715ac449f6e59e6355234799dfde6d50 (patch) | |
| tree | 85c4c968d960f6ca4c57b43bf4430bd49121f1f7 /ldpd/ldp_zebra.c | |
| parent | efa618369a8cd05c245fae58e125a3451c098b66 (diff) | |
*: encode zapi labels message using nexthops
Use the zapi_nexthop struct with the mpls_labels
zapi messages instead of the special-purpose (and
more limited) nexthop struct that was being used.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'ldpd/ldp_zebra.c')
| -rw-r--r-- | ldpd/ldp_zebra.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ldpd/ldp_zebra.c b/ldpd/ldp_zebra.c index 946b51e4ee..b3ccb77602 100644 --- a/ldpd/ldp_zebra.c +++ b/ldpd/ldp_zebra.c @@ -106,7 +106,7 @@ static int ldp_zebra_send_mpls_labels(int cmd, struct kroute *kr) { struct zapi_labels zl = {}; - struct zapi_nexthop_label *znh; + struct zapi_nexthop *znh; if (kr->local_label < MPLS_LABEL_RESERVED_MAX || kr->remote_label == NO_LABEL) @@ -143,16 +143,14 @@ ldp_zebra_send_mpls_labels(int cmd, struct kroute *kr) znh = &zl.nexthops[0]; switch (kr->af) { case AF_INET: - znh->family = AF_INET; - znh->address.ipv4 = kr->nexthop.v4; + znh->gate.ipv4 = kr->nexthop.v4; if (kr->ifindex) znh->type = NEXTHOP_TYPE_IPV4_IFINDEX; else znh->type = NEXTHOP_TYPE_IPV4; break; case AF_INET6: - znh->family = AF_INET6; - znh->address.ipv6 = kr->nexthop.v6; + znh->gate.ipv6 = kr->nexthop.v6; if (kr->ifindex) znh->type = NEXTHOP_TYPE_IPV6_IFINDEX; else @@ -162,7 +160,8 @@ ldp_zebra_send_mpls_labels(int cmd, struct kroute *kr) break; } znh->ifindex = kr->ifindex; - znh->label = kr->remote_label; + znh->label_num = 1; + znh->labels[0] = kr->remote_label; return zebra_send_mpls_labels(zclient, cmd, &zl); } |
