diff options
| author | mobash-rasool <mobash.rasool@gmail.com> | 2022-10-31 12:04:26 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-31 12:04:26 +0530 |
| commit | 6863cf6a5a93cfd5f2719d1acc4be3896dede5a9 (patch) | |
| tree | f07f7d5a9cffbb513b7c02f28eab392b6fedd515 /lib/srv6.c | |
| parent | b7128471c6c4022b90cfd56667f767cf50931e6c (diff) | |
| parent | 84410eb0fe0add2f22723bdde64c8d7dc17e7480 (diff) | |
Merge pull request #12230 from cscarpitta/fix/replace-inet-top-in-srv6-lib
lib: Use `%pI6`/`%pI4` to print SRv6 seg6local ctx
Diffstat (limited to 'lib/srv6.c')
| -rw-r--r-- | lib/srv6.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/srv6.c b/lib/srv6.c index a8ec6f2b71..1c2c8913d5 100644 --- a/lib/srv6.c +++ b/lib/srv6.c @@ -85,8 +85,6 @@ const char *seg6local_context2str(char *str, size_t size, const struct seg6local_context *ctx, uint32_t action) { - char b0[128]; - switch (action) { case ZEBRA_SEG6_LOCAL_ACTION_END: @@ -95,13 +93,11 @@ const char *seg6local_context2str(char *str, size_t size, case ZEBRA_SEG6_LOCAL_ACTION_END_X: case ZEBRA_SEG6_LOCAL_ACTION_END_DX6: - inet_ntop(AF_INET6, &ctx->nh6, b0, 128); - snprintf(str, size, "nh6 %s", b0); + snprintfrr(str, size, "nh6 %pI6", &ctx->nh6); return str; case ZEBRA_SEG6_LOCAL_ACTION_END_DX4: - inet_ntop(AF_INET, &ctx->nh4, b0, 128); - snprintf(str, size, "nh4 %s", b0); + snprintfrr(str, size, "nh4 %pI4", &ctx->nh4); return str; case ZEBRA_SEG6_LOCAL_ACTION_END_T: |
