summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_sr.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-08-08 20:51:05 +0200
committerRenato Westphal <renato@opensourcerouting.org>2019-09-07 02:06:11 +0200
commitb3c49d0e772f4b555c59f72f2e1aa92be33c1510 (patch)
treea9b414951c8a18761d8128e12159a5ce1bae76cf /ospfd/ospf_sr.c
parentlib, zebra: rename LSP type used for OSPF SR (diff)
downloadfrr-b3c49d0e772f4b555c59f72f2e1aa92be33c1510.tar.xz
frr-b3c49d0e772f4b555c59f72f2e1aa92be33c1510.zip
lib, zebra: enhance the MPLS zapi messages
* Add ability to specify the nexthop type; * Add ability to install or not a FTN (in addition to an LSP). These two additions will be useful to install local SR Prefix-SIDs configured with the no-PHP option. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ospfd/ospf_sr.c')
-rw-r--r--ospfd/ospf_sr.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/ospfd/ospf_sr.c b/ospfd/ospf_sr.c
index 70a4d9395..2d06ae77f 100644
--- a/ospfd/ospf_sr.c
+++ b/ospfd/ospf_sr.c
@@ -618,15 +618,20 @@ static int ospf_zebra_send_mpls_labels(int cmd, struct sr_nhlfe nhlfe)
nhlfe.prefv4.prefixlen, nhlfe.ifindex);
zl.type = ZEBRA_LSP_OSPF_SR;
- zl.prefix.family = nhlfe.prefv4.family;
- zl.prefix.prefixlen = nhlfe.prefv4.prefixlen;
- zl.prefix.u.prefix4 = nhlfe.prefv4.prefix;
- zl.nexthop.ipv4 = nhlfe.nexthop;
- zl.ifindex = nhlfe.ifindex;
- zl.route_type = ZEBRA_ROUTE_OSPF;
- zl.route_instance = 0;
zl.local_label = nhlfe.label_in;
- zl.remote_label = nhlfe.label_out;
+
+ SET_FLAG(zl.message, ZAPI_LABELS_FTN);
+ zl.route.prefix.family = nhlfe.prefv4.family;
+ zl.route.prefix.prefixlen = nhlfe.prefv4.prefixlen;
+ zl.route.prefix.u.prefix4 = nhlfe.prefv4.prefix;
+ 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;
return zebra_send_mpls_labels(zclient, cmd, &zl);
}