summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-03-16 15:53:58 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-03-16 17:27:22 +0100
commit0acf4df0953ce594eee793d51fa79e2d9d097b60 (patch)
tree858e14d27ff9e3f178faf747ec5447688892f9ce /lib
parentzebra: Apply label to all nexthops when needed (diff)
downloadfrr-0acf4df0953ce594eee793d51fa79e2d9d097b60.tar.xz
frr-0acf4df0953ce594eee793d51fa79e2d9d097b60.zip
lib, zebra: Signal the existence of labels on a nexthop for nht
When we are signaling to a client from zebra that a nexthop has changed, include the labels on the nexthop as well. Upper level protocols need to know if the labels exist in order to make intelligent decisions about what to do. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/zclient.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index 777f6fcf9..2cac71ac4 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -1340,6 +1340,16 @@ bool zapi_nexthop_update_decode(struct stream *s, struct zapi_route *nhr)
case NEXTHOP_TYPE_BLACKHOLE:
break;
}
+ STREAM_GETC(s, nhr->nexthops[i].label_num);
+ if (nhr->nexthops[i].label_num > MPLS_MAX_LABELS) {
+ zlog_warn("%s: invalid number of MPLS labels (%u)",
+ __func__, nhr->nexthops[i].label_num);
+ return false;
+ }
+ if (nhr->nexthops[i].label_num)
+ STREAM_GET(&nhr->nexthops[i].labels[0], s,
+ nhr->nexthops[i].label_num
+ * sizeof(mpls_label_t));
}
return true;