forked from Mirror/frr
vrrpd: Convert to using %pFX
Signed-off-by: Pat Ruddy <pat@voltanet.io>
This commit is contained in:
parent
f000b7c144
commit
26b6d034b0
21
vrrpd/vrrp.c
21
vrrpd/vrrp.c
|
@ -700,7 +700,6 @@ static int vrrp_master_down_timer_expire(struct thread *thread);
|
||||||
*/
|
*/
|
||||||
static int vrrp_bind_to_primary_connected(struct vrrp_router *r)
|
static int vrrp_bind_to_primary_connected(struct vrrp_router *r)
|
||||||
{
|
{
|
||||||
char ipstr[INET6_ADDRSTRLEN];
|
|
||||||
struct interface *ifp;
|
struct interface *ifp;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -754,20 +753,15 @@ static int vrrp_bind_to_primary_connected(struct vrrp_router *r)
|
||||||
if (bind(r->sock_tx, (const struct sockaddr *)&su, sizeof(su)) < 0) {
|
if (bind(r->sock_tx, (const struct sockaddr *)&su, sizeof(su)) < 0) {
|
||||||
zlog_err(
|
zlog_err(
|
||||||
VRRP_LOGPFX VRRP_LOGPFX_VRID VRRP_LOGPFX_FAM
|
VRRP_LOGPFX VRRP_LOGPFX_VRID VRRP_LOGPFX_FAM
|
||||||
"Failed to bind Tx socket to primary IP address %s: %s",
|
"Failed to bind Tx socket to primary IP address %pFX: %s",
|
||||||
r->vr->vrid, family2str(r->family),
|
r->vr->vrid, family2str(r->family), c->address,
|
||||||
inet_ntop(r->family,
|
|
||||||
(const void *)&c->address->u.prefix, ipstr,
|
|
||||||
sizeof(ipstr)),
|
|
||||||
safe_strerror(errno));
|
safe_strerror(errno));
|
||||||
ret = -1;
|
ret = -1;
|
||||||
} else {
|
} else {
|
||||||
DEBUGD(&vrrp_dbg_sock,
|
DEBUGD(&vrrp_dbg_sock,
|
||||||
VRRP_LOGPFX VRRP_LOGPFX_VRID VRRP_LOGPFX_FAM
|
VRRP_LOGPFX VRRP_LOGPFX_VRID VRRP_LOGPFX_FAM
|
||||||
"Bound Tx socket to primary IP address %s",
|
"Bound Tx socket to primary IP address %pFX",
|
||||||
r->vr->vrid, family2str(r->family),
|
r->vr->vrid, family2str(r->family), c->address);
|
||||||
inet_ntop(r->family, (const void *)&c->address->u.prefix,
|
|
||||||
ipstr, sizeof(ipstr)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1717,7 +1711,6 @@ static void vrrp_autoconfig_autoaddrupdate(struct vrrp_router *r)
|
||||||
struct listnode *ln;
|
struct listnode *ln;
|
||||||
struct connected *c = NULL;
|
struct connected *c = NULL;
|
||||||
bool is_v6_ll;
|
bool is_v6_ll;
|
||||||
char ipbuf[INET6_ADDRSTRLEN];
|
|
||||||
|
|
||||||
if (!r->mvl_ifp)
|
if (!r->mvl_ifp)
|
||||||
return;
|
return;
|
||||||
|
@ -1730,12 +1723,10 @@ static void vrrp_autoconfig_autoaddrupdate(struct vrrp_router *r)
|
||||||
is_v6_ll = (c->address->family == AF_INET6
|
is_v6_ll = (c->address->family == AF_INET6
|
||||||
&& IN6_IS_ADDR_LINKLOCAL(&c->address->u.prefix6));
|
&& IN6_IS_ADDR_LINKLOCAL(&c->address->u.prefix6));
|
||||||
if (c->address->family == r->family && !is_v6_ll) {
|
if (c->address->family == r->family && !is_v6_ll) {
|
||||||
inet_ntop(r->family, &c->address->u.prefix, ipbuf,
|
|
||||||
sizeof(ipbuf));
|
|
||||||
DEBUGD(&vrrp_dbg_auto,
|
DEBUGD(&vrrp_dbg_auto,
|
||||||
VRRP_LOGPFX VRRP_LOGPFX_VRID VRRP_LOGPFX_FAM
|
VRRP_LOGPFX VRRP_LOGPFX_VRID VRRP_LOGPFX_FAM
|
||||||
"Adding %s",
|
"Adding %pFX",
|
||||||
r->vr->vrid, family2str(r->family), ipbuf);
|
r->vr->vrid, family2str(r->family), c->address);
|
||||||
if (r->family == AF_INET)
|
if (r->family == AF_INET)
|
||||||
vrrp_add_ipv4(r->vr, c->address->u.prefix4);
|
vrrp_add_ipv4(r->vr, c->address->u.prefix4);
|
||||||
else if (r->vr->version == 3)
|
else if (r->vr->version == 3)
|
||||||
|
|
|
@ -56,8 +56,8 @@ static void vrrp_zebra_debug_if_dump_address(struct interface *ifp,
|
||||||
for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, ifc)) {
|
for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, ifc)) {
|
||||||
struct prefix *p = ifc->address;
|
struct prefix *p = ifc->address;
|
||||||
|
|
||||||
DEBUGD(&vrrp_dbg_zebra, "%s: interface %s address %s %s", func,
|
DEBUGD(&vrrp_dbg_zebra, "%s: interface %s address %pFX %s",
|
||||||
ifp->name, inet_ntoa(p->u.prefix4),
|
func, ifp->name, p,
|
||||||
CHECK_FLAG(ifc->flags, ZEBRA_IFA_SECONDARY) ? "secondary"
|
CHECK_FLAG(ifc->flags, ZEBRA_IFA_SECONDARY) ? "secondary"
|
||||||
: "primary");
|
: "primary");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue