mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-17 16:47:47 +00:00
zebra,fpm: fix configuration display
Use `pI4` and `pI6` to format addresses and fix a bug when displaying IPv6 addresses. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
2a437850fd
commit
a3adec468e
@ -377,7 +377,6 @@ static int fpm_write_config(struct vty *vty)
|
|||||||
struct sockaddr_in *sin;
|
struct sockaddr_in *sin;
|
||||||
struct sockaddr_in6 *sin6;
|
struct sockaddr_in6 *sin6;
|
||||||
int written = 0;
|
int written = 0;
|
||||||
char addrstr[INET6_ADDRSTRLEN];
|
|
||||||
|
|
||||||
if (gfnc->disabled)
|
if (gfnc->disabled)
|
||||||
return written;
|
return written;
|
||||||
@ -386,8 +385,7 @@ static int fpm_write_config(struct vty *vty)
|
|||||||
case AF_INET:
|
case AF_INET:
|
||||||
written = 1;
|
written = 1;
|
||||||
sin = (struct sockaddr_in *)&gfnc->addr;
|
sin = (struct sockaddr_in *)&gfnc->addr;
|
||||||
inet_ntop(AF_INET, &sin->sin_addr, addrstr, sizeof(addrstr));
|
vty_out(vty, "fpm address %pI4", &sin->sin_addr);
|
||||||
vty_out(vty, "fpm address %s", addrstr);
|
|
||||||
if (sin->sin_port != htons(SOUTHBOUND_DEFAULT_PORT))
|
if (sin->sin_port != htons(SOUTHBOUND_DEFAULT_PORT))
|
||||||
vty_out(vty, " port %d", ntohs(sin->sin_port));
|
vty_out(vty, " port %d", ntohs(sin->sin_port));
|
||||||
|
|
||||||
@ -396,8 +394,7 @@ static int fpm_write_config(struct vty *vty)
|
|||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
written = 1;
|
written = 1;
|
||||||
sin6 = (struct sockaddr_in6 *)&gfnc->addr;
|
sin6 = (struct sockaddr_in6 *)&gfnc->addr;
|
||||||
inet_ntop(AF_INET, &sin6->sin6_addr, addrstr, sizeof(addrstr));
|
vty_out(vty, "fpm address %pI6", &sin6->sin6_addr);
|
||||||
vty_out(vty, "fpm address %s", addrstr);
|
|
||||||
if (sin6->sin6_port != htons(SOUTHBOUND_DEFAULT_PORT))
|
if (sin6->sin6_port != htons(SOUTHBOUND_DEFAULT_PORT))
|
||||||
vty_out(vty, " port %d", ntohs(sin6->sin6_port));
|
vty_out(vty, " port %d", ntohs(sin6->sin6_port));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user