Merge pull request #12967 from pguibert6WIND/show_zebra_mpls_empty

This commit is contained in:
Donald Sharp 2023-03-10 17:53:46 -05:00 committed by GitHub
commit 3bde1a53cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3730,14 +3730,20 @@ void zebra_mpls_print_lsp(struct vty *vty, struct zebra_vrf *zvrf,
/* Lookup table. */ /* Lookup table. */
lsp_table = zvrf->lsp_table; lsp_table = zvrf->lsp_table;
if (!lsp_table) if (!lsp_table) {
if (use_json)
vty_out(vty, "{}\n");
return; return;
}
/* If entry is not present, exit. */ /* If entry is not present, exit. */
tmp_ile.in_label = label; tmp_ile.in_label = label;
lsp = hash_lookup(lsp_table, &tmp_ile); lsp = hash_lookup(lsp_table, &tmp_ile);
if (!lsp) if (!lsp) {
if (use_json)
vty_out(vty, "{}\n");
return; return;
}
if (use_json) { if (use_json) {
json = lsp_json(lsp); json = lsp_json(lsp);