summaryrefslogtreecommitdiffstats
path: root/ldpd
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2020-04-21 15:08:06 +0200
committerGitHub <noreply@github.com>2020-04-21 15:08:06 +0200
commite805a969acaa3dad61e205b49a21cdff32646034 (patch)
tree7b1bd4d0bc63fe5eb477b9caac3a111fb6557c28 /ldpd
parentMerge pull request #6263 from opensourcerouting/zlog-coverity-20200420 (diff)
parentldpd: don't drop packets coming through a broken LSP (diff)
downloadfrr-e805a969acaa3dad61e205b49a21cdff32646034.tar.xz
frr-e805a969acaa3dad61e205b49a21cdff32646034.zip
Merge pull request #6147 from opensourcerouting/ldpd-broken-lsps
ldpd: don't drop packets coming through a broken LSP
Diffstat (limited to 'ldpd')
-rw-r--r--ldpd/ldp_zebra.c42
1 files changed, 26 insertions, 16 deletions
diff --git a/ldpd/ldp_zebra.c b/ldpd/ldp_zebra.c
index b3ccb7760..28e56ecd6 100644
--- a/ldpd/ldp_zebra.c
+++ b/ldpd/ldp_zebra.c
@@ -108,8 +108,7 @@ ldp_zebra_send_mpls_labels(int cmd, struct kroute *kr)
struct zapi_labels zl = {};
struct zapi_nexthop *znh;
- if (kr->local_label < MPLS_LABEL_RESERVED_MAX ||
- kr->remote_label == NO_LABEL)
+ if (kr->local_label < MPLS_LABEL_RESERVED_MAX)
return (0);
debug_zebra_out("prefix %s/%u nexthop %s ifindex %u labels %s/%s (%s)",
@@ -122,21 +121,32 @@ ldp_zebra_send_mpls_labels(int cmd, struct kroute *kr)
zl.local_label = kr->local_label;
/* Set prefix. */
- SET_FLAG(zl.message, ZAPI_LABELS_FTN);
- zl.route.prefix.family = kr->af;
- switch (kr->af) {
- case AF_INET:
- zl.route.prefix.u.prefix4 = kr->prefix.v4;
- break;
- case AF_INET6:
- zl.route.prefix.u.prefix6 = kr->prefix.v6;
- break;
- default:
- fatalx("ldp_zebra_send_mpls_labels: unknown af");
+ if (kr->remote_label != NO_LABEL) {
+ SET_FLAG(zl.message, ZAPI_LABELS_FTN);
+ zl.route.prefix.family = kr->af;
+ switch (kr->af) {
+ case AF_INET:
+ zl.route.prefix.u.prefix4 = kr->prefix.v4;
+ break;
+ case AF_INET6:
+ zl.route.prefix.u.prefix6 = kr->prefix.v6;
+ break;
+ default:
+ fatalx("ldp_zebra_send_mpls_labels: unknown af");
+ }
+ zl.route.prefix.prefixlen = kr->prefixlen;
+ zl.route.type = kr->route_type;
+ zl.route.instance = kr->route_instance;
}
- zl.route.prefix.prefixlen = kr->prefixlen;
- zl.route.type = kr->route_type;
- zl.route.instance = kr->route_instance;
+
+ /*
+ * For broken LSPs, instruct the forwarding plane to pop the top-level
+ * label and forward packets normally. This is a best-effort attempt
+ * to deliver labeled IP packets to their final destination (instead of
+ * dropping them).
+ */
+ if (kr->remote_label == NO_LABEL)
+ kr->remote_label = MPLS_LABEL_IMPLICIT_NULL;
/* Set nexthop. */
zl.nexthop_num = 1;