summaryrefslogtreecommitdiffstats
path: root/ldpd
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-08-08 20:57:13 +0200
committerRenato Westphal <renato@opensourcerouting.org>2019-09-10 05:01:10 +0200
commitea6b290bf6a29aa06888c93dae9bec4581ce686f (patch)
tree87adcd62077218a576850849b302cfa556ec3ee2 /ldpd
parentzebra: improve cleanup of MPLS labels when zclient disconnects (diff)
downloadfrr-ea6b290bf6a29aa06888c93dae9bec4581ce686f.tar.xz
frr-ea6b290bf6a29aa06888c93dae9bec4581ce686f.zip
lib, zebra: add new MPLS zapi message with route replace semantics
This new message makes it possible to install/reinstall LSPs with multiple nexthops using a single ZAPI message. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ldpd')
-rw-r--r--ldpd/ldp_zebra.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/ldpd/ldp_zebra.c b/ldpd/ldp_zebra.c
index 5582b95c8..884ae159b 100644
--- a/ldpd/ldp_zebra.c
+++ b/ldpd/ldp_zebra.c
@@ -109,6 +109,7 @@ static int
ldp_zebra_send_mpls_labels(int cmd, struct kroute *kr)
{
struct zapi_labels zl = {};
+ struct zapi_nexthop_label *znh;
if (kr->local_label < MPLS_LABEL_RESERVED_MAX ||
kr->remote_label == NO_LABEL)
@@ -141,28 +142,30 @@ ldp_zebra_send_mpls_labels(int cmd, struct kroute *kr)
zl.route.instance = kr->route_instance;
/* Set nexthop. */
+ zl.nexthop_num = 1;
+ znh = &zl.nexthops[0];
switch (kr->af) {
case AF_INET:
- zl.nexthop.family = AF_INET;
- zl.nexthop.address.ipv4 = kr->nexthop.v4;
+ znh->family = AF_INET;
+ znh->address.ipv4 = kr->nexthop.v4;
if (kr->ifindex)
- zl.nexthop.type = NEXTHOP_TYPE_IPV4_IFINDEX;
+ znh->type = NEXTHOP_TYPE_IPV4_IFINDEX;
else
- zl.nexthop.type = NEXTHOP_TYPE_IPV4;
+ znh->type = NEXTHOP_TYPE_IPV4;
break;
case AF_INET6:
- zl.nexthop.family = AF_INET6;
- zl.nexthop.address.ipv6 = kr->nexthop.v6;
+ znh->family = AF_INET6;
+ znh->address.ipv6 = kr->nexthop.v6;
if (kr->ifindex)
- zl.nexthop.type = NEXTHOP_TYPE_IPV6_IFINDEX;
+ znh->type = NEXTHOP_TYPE_IPV6_IFINDEX;
else
- zl.nexthop.type = NEXTHOP_TYPE_IPV6;
+ znh->type = NEXTHOP_TYPE_IPV6;
break;
default:
break;
}
- zl.nexthop.ifindex = kr->ifindex;
- zl.nexthop.label = kr->remote_label;
+ znh->ifindex = kr->ifindex;
+ znh->label = kr->remote_label;
return zebra_send_mpls_labels(zclient, cmd, &zl);
}