diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-07-26 19:05:09 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-07-26 19:05:09 -0400 |
| commit | 0b1321e2185a216a4135ad92973e440a1ba3f08e (patch) | |
| tree | c38cb30677793a3faa34537b7c4d69592734ef5c | |
| parent | ced26d3d49360dd9c0a1a275721f652ffcb9f34e (diff) | |
vrrpd: Make clang 11 happy
Recent changes to remove PRIu... in commit:
6cde4b45528e52819c803de92d10d4be3abddf29
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>
| -rw-r--r-- | vrrpd/vrrp.c | 4 | ||||
| -rw-r--r-- | vrrpd/vrrp_packet.c | 2 | ||||
| -rw-r--r-- | vrrpd/vrrp_vty.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/vrrpd/vrrp.c b/vrrpd/vrrp.c index 3e79cff391..d3f9b0c730 100644 --- a/vrrpd/vrrp.c +++ b/vrrpd/vrrp.c @@ -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); } diff --git a/vrrpd/vrrp_packet.c b/vrrpd/vrrp_packet.c index 61fcc4e85d..3cb13bd71b 100644 --- a/vrrpd/vrrp_packet.c +++ b/vrrpd/vrrp_packet.c @@ -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 */ diff --git a/vrrpd/vrrp_vty.c b/vrrpd/vrrp_vty.c index 1a12337086..dc7f023e8f 100644 --- a/vrrpd/vrrp_vty.c +++ b/vrrpd/vrrp_vty.c @@ -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" |
