diff options
author | Carmine Scarpitta <carmine.scarpitta@uniroma2.it> | 2022-10-30 09:15:06 +0100 |
---|---|---|
committer | Carmine Scarpitta <carmine.scarpitta@uniroma2.it> | 2022-10-30 09:15:06 +0100 |
commit | 84410eb0fe0add2f22723bdde64c8d7dc17e7480 (patch) | |
tree | 53623925eaaa69ee5959774447e029aa790d9b4e /lib/srv6.c | |
parent | Merge pull request #11673 from cscarpitta/srv6-per-vrf-sid (diff) | |
download | frr-84410eb0fe0add2f22723bdde64c8d7dc17e7480.tar.xz frr-84410eb0fe0add2f22723bdde64c8d7dc17e7480.zip |
lib: Use `%pI6`/`%pI4` to print SRv6 seg6local ctx
This commit changes `seg6local_context2str()` to use `%pI6`/`%pI4`
instead of `inet_ntop` to print the SRv6 seg6local context information.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
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 306d92ae3..f1870fac6 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: |