From ea6b290bf6a29aa06888c93dae9bec4581ce686f Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Thu, 8 Aug 2019 15:57:13 -0300 Subject: 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 --- ospfd/ospf_sr.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'ospfd') 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); } -- cgit v1.2.3