summaryrefslogtreecommitdiff
path: root/lib/mpls.c
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2023-02-14 09:16:41 -0500
committerGitHub <noreply@github.com>2023-02-14 09:16:41 -0500
commit91b6db4868507dc8c2e7587360ef16ee7887666a (patch)
tree3732e659525c376e81da757ff8a595c126848d0e /lib/mpls.c
parent7809df20643ab9f731930dcef9661a70ef261e5b (diff)
parent51c33a572442719a66c9f7e4582a22049cb2156f (diff)
Merge pull request #12364 from sworleys/SVD-DVNI-PR
Single Vxlan Device/Multiple Vlan Aware Bridges/Downstream VNI
Diffstat (limited to 'lib/mpls.c')
-rw-r--r--lib/mpls.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/mpls.c b/lib/mpls.c
index ac5792a686..1b21dd29ff 100644
--- a/lib/mpls.c
+++ b/lib/mpls.c
@@ -80,7 +80,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;
@@ -90,9 +90,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);
}