summaryrefslogtreecommitdiff
path: root/zebra/zebra_mpls_openbsd.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-08-22 17:01:54 -0300
committerRenato Westphal <renato@opensourcerouting.org>2017-08-22 17:37:58 -0300
commit5e8c8947e3fb53d2fdbdf804c6014d6ecdb0b904 (patch)
tree6d88033457ec6eb6022ba189b90afc47827f85d1 /zebra/zebra_mpls_openbsd.c
parent1d84515ca9d0a5e543be7e8e7ca9afc8b744e662 (diff)
zebra: increase maximum label stack depth
* Bump MPLS_MAX_LABELS from 2 to 16; * Adjust the static_nh_label structure and the mpls_label2str() function; * On OpenBSD, print an error message when trying to push more than one label at once (kernel limitation). While here, add support for MPLSv6 FTNs in OpenBSD. This is not the full package. We still can't pop multiple labels at once, or do things like swap a label and push other ones. We'll address that in the future. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'zebra/zebra_mpls_openbsd.c')
-rw-r--r--zebra/zebra_mpls_openbsd.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/zebra/zebra_mpls_openbsd.c b/zebra/zebra_mpls_openbsd.c
index 119cd5b700..33f0d49d4d 100644
--- a/zebra/zebra_mpls_openbsd.c
+++ b/zebra/zebra_mpls_openbsd.c
@@ -256,6 +256,15 @@ static int kernel_lsp_cmd(int action, zebra_lsp_t *lsp)
|| (action == RTM_DELETE
&& (CHECK_FLAG(nhlfe->flags, NHLFE_FLAG_INSTALLED)
&& CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB)))) {
+ if (nhlfe->nexthop->nh_label->num_labels > 1) {
+ zlog_warn(
+ "%s: can't push %u labels at once "
+ "(maximum is 1)",
+ __func__,
+ nhlfe->nexthop->nh_label->num_labels);
+ continue;
+ }
+
nexthop_num++;
switch (NHLFE_FAMILY(nhlfe)) {