diff options
Diffstat (limited to 'lib/mpls.c')
| -rw-r--r-- | lib/mpls.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/mpls.c b/lib/mpls.c index 8dad807b9f..8c656f78ff 100644 --- a/lib/mpls.c +++ b/lib/mpls.c @@ -67,7 +67,7 @@ int mpls_str2label(const char *label_str, uint8_t *num_labels, * Label to string conversion, labels in string separated by '/'. */ char *mpls_label2str(uint8_t num_labels, const mpls_label_t *labels, char *buf, - int len, int pretty) + int len, enum lsp_types_t type, int pretty) { char label_buf[BUFSIZ]; int i; @@ -77,9 +77,14 @@ char *mpls_label2str(uint8_t num_labels, const mpls_label_t *labels, char *buf, if (i != 0) strlcat(buf, "/", len); if (pretty) - label2str(labels[i], label_buf, sizeof(label_buf)); + label2str(labels[i], type, label_buf, + sizeof(label_buf)); else - snprintf(label_buf, sizeof(label_buf), "%u", labels[i]); + snprintf(label_buf, sizeof(label_buf), "%u", + ((type == ZEBRA_LSP_EVPN) + ? label2vni(&labels[i]) + : labels[i])); + strlcat(buf, label_buf, len); } |
