summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2024-08-18 13:34:12 -0400
committerGitHub <noreply@github.com>2024-08-18 13:34:12 -0400
commit5dd2b67ff546f7febc7bd2869d8e0ff4966b3d8c (patch)
treeaeab9f14db38704c83fd18bbc3f81a561af55bfd
parentc61069c34186d0de2b4eb4b3d35a4682eae93525 (diff)
parent354f9e9009326d695edf4b39d6fcc5feb9f3e8cf (diff)
Merge pull request #16603 from cscarpitta/fix/fix-compilation-warnings
lib, zebra: Fix a couple compilation warnings
-rw-r--r--lib/srv6.h11
-rw-r--r--zebra/zebra_srv6_vty.c2
2 files changed, 6 insertions, 7 deletions
diff --git a/lib/srv6.h b/lib/srv6.h
index 03ada7fcfc..f25c5cfcaa 100644
--- a/lib/srv6.h
+++ b/lib/srv6.h
@@ -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;
diff --git a/zebra/zebra_srv6_vty.c b/zebra/zebra_srv6_vty.c
index c664a9c69f..5a80524149 100644
--- a/zebra/zebra_srv6_vty.c
+++ b/zebra/zebra_srv6_vty.c
@@ -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,