Merge pull request #16603 from cscarpitta/fix/fix-compilation-warnings

lib, zebra: Fix a couple compilation warnings
This commit is contained in:
Donald Sharp 2024-08-18 13:34:12 -04:00 committed by GitHub
commit 5dd2b67ff5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 7 deletions

View File

@ -335,24 +335,23 @@ static inline const char *srv6_sid_ctx2str(char *str, size_t size,
break;
case ZEBRA_SEG6_LOCAL_ACTION_END:
len += snprintf(str + len, size - len, " USP");
snprintf(str + len, size - len, " USP");
break;
case ZEBRA_SEG6_LOCAL_ACTION_END_X:
case ZEBRA_SEG6_LOCAL_ACTION_END_DX6:
len += snprintfrr(str + len, size - len, " nh6 %pI6", &ctx->nh6);
snprintfrr(str + len, size - len, " nh6 %pI6", &ctx->nh6);
break;
case ZEBRA_SEG6_LOCAL_ACTION_END_DX4:
len += snprintfrr(str + len, size - len, " nh4 %pI4", &ctx->nh4);
snprintfrr(str + len, size - len, " nh4 %pI4", &ctx->nh4);
break;
case ZEBRA_SEG6_LOCAL_ACTION_END_T:
case ZEBRA_SEG6_LOCAL_ACTION_END_DT6:
case ZEBRA_SEG6_LOCAL_ACTION_END_DT4:
case ZEBRA_SEG6_LOCAL_ACTION_END_DT46:
len += snprintf(str + len, size - len, " vrf_id %u",
ctx->vrf_id);
snprintf(str + len, size - len, " vrf_id %u", ctx->vrf_id);
break;
case ZEBRA_SEG6_LOCAL_ACTION_END_DX2:
@ -364,7 +363,7 @@ static inline const char *srv6_sid_ctx2str(char *str, size_t size,
case ZEBRA_SEG6_LOCAL_ACTION_END_AM:
case ZEBRA_SEG6_LOCAL_ACTION_END_BPF:
default:
len += snprintf(str + len, size - len, " unknown(%s)", __func__);
snprintf(str + len, size - len, " unknown(%s)", __func__);
}
return str;

View File

@ -969,7 +969,7 @@ static int zebra_sr_config(struct vty *vty)
&srv6->encap_src_addr);
}
}
if (zebra_srv6_is_enable()) {
if (srv6 && zebra_srv6_is_enable()) {
vty_out(vty, " locators\n");
for (ALL_LIST_ELEMENTS_RO(srv6->locators, node, locator)) {
inet_ntop(AF_INET6, &locator->prefix.prefix,