Skip to content

Commit

Permalink
Merge pull request #16603 from cscarpitta/fix/fix-compilation-warnings
Browse files Browse the repository at this point in the history
lib, zebra: Fix a couple compilation warnings
  • Loading branch information
donaldsharp authored Aug 18, 2024
2 parents c61069c + 354f9e9 commit 5dd2b67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions lib/srv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion zebra/zebra_srv6_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5dd2b67

Please sign in to comment.