summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_sr.c
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 /ospfd/ospf_sr.c
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 'ospfd/ospf_sr.c')
-rw-r--r--ospfd/ospf_sr.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/ospfd/ospf_sr.c b/ospfd/ospf_sr.c
index 2d06ae77f..91737085b 100644
--- a/ospfd/ospf_sr.c
+++ b/ospfd/ospf_sr.c
@@ -609,6 +609,7 @@ static int compute_prefix_nhlfe(struct sr_prefix *srp)
static int ospf_zebra_send_mpls_labels(int cmd, struct sr_nhlfe nhlfe)
{
struct zapi_labels zl = {};
+ struct zapi_nexthop_label *znh;
if (IS_DEBUG_OSPF_SR)
zlog_debug(" |- %s LSP %u/%u for %s/%u via %u",
@@ -627,11 +628,13 @@ static int ospf_zebra_send_mpls_labels(int cmd, struct sr_nhlfe nhlfe)
zl.route.type = ZEBRA_ROUTE_OSPF;
zl.route.instance = 0;
- zl.nexthop.type = NEXTHOP_TYPE_IPV4_IFINDEX;
- zl.nexthop.family = AF_INET;
- zl.nexthop.address.ipv4 = nhlfe.nexthop;
- zl.nexthop.ifindex = nhlfe.ifindex;
- zl.nexthop.label = nhlfe.label_out;
+ zl.nexthop_num = 1;
+ znh = &zl.nexthops[0];
+ znh->type = NEXTHOP_TYPE_IPV4_IFINDEX;
+ znh->family = AF_INET;
+ znh->address.ipv4 = nhlfe.nexthop;
+ znh->ifindex = nhlfe.ifindex;
+ znh->label = nhlfe.label_out;
return zebra_send_mpls_labels(zclient, cmd, &zl);
}