vrrpd: Make clang 11 happy

Recent changes to remove PRIu... in commit:
6cde4b4552

causes clang 11 to be unhappy, with length of field warnings.
Modify the offending code to compile properly using that compiler.
I've tested against clang 11 and gcc 9.3

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2020-07-26 19:05:09 -04:00
parent ced26d3d49
commit 0b1321e218
3 changed files with 4 additions and 4 deletions

View File

@ -2351,7 +2351,7 @@ int vrrp_config_write_global(struct vty *vty)
if (vd.advertisement_interval != VRRP_DEFAULT_ADVINT && ++writes)
vty_out(vty,
"vrrp default advertisement-interval %hu\n",
"vrrp default advertisement-interval %u\n",
vd.advertisement_interval * CS2MS);
if (vd.preempt_mode != VRRP_DEFAULT_PREEMPT && ++writes)
@ -2374,7 +2374,7 @@ static unsigned int vrrp_hash_key(const void *arg)
const struct vrrp_vrouter *vr = arg;
char key[IFNAMSIZ + 64];
snprintf(key, sizeof(key), "%s@%hhu", vr->ifp->name, vr->vrid);
snprintf(key, sizeof(key), "%s@%u", vr->ifp->name, vr->vrid);
return string_hash_make(key);
}

View File

@ -296,7 +296,7 @@ ssize_t vrrp_pkt_parse_datagram(int family, int version, struct msghdr *m,
(*pkt)->hdr.chksum, chksum);
/* Type check */
VRRP_PKT_VCHECK(((*pkt)->hdr.vertype & 0x0F) == 1, "Bad type %hhu",
VRRP_PKT_VCHECK(((*pkt)->hdr.vertype & 0x0F) == 1, "Bad type %u",
(*pkt)->hdr.vertype & 0x0f);
/* Exact size check */

View File

@ -653,7 +653,7 @@ DEFPY(vrrp_vrid_show_summary,
continue;
ttable_add_row(
tt, "%s|%hhu|%hhu|%d|%d|%s|%s",
tt, "%s|%u|%hhu|%d|%d|%s|%s",
vr->ifp->name, vr->vrid, vr->priority,
vr->v4->addrs->count, vr->v6->addrs->count,
vr->v4->fsm.state == VRRP_STATE_MASTER ? "Master"