diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-03-07 19:46:02 +0100 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-05-17 02:27:08 +0200 |
commit | 613b45b008bd473704b341ce4d8247ddceeba494 (patch) | |
tree | 2cd53b18fffbd25cb8bb8a2e45e91dfcf15cc25a /vrrpd/vrrp_packet.c | |
parent | Revert "vrrpd: use parent interface LLA for advert tx" (diff) | |
download | frr-613b45b008bd473704b341ce4d8247ddceeba494.tar.xz frr-613b45b008bd473704b341ce4d8247ddceeba494.zip |
vrrpd: clean up logging
* Always include address family when available
* Log advertisement decodes on one line
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'vrrpd/vrrp_packet.c')
-rw-r--r-- | vrrpd/vrrp_packet.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/vrrpd/vrrp_packet.c b/vrrpd/vrrp_packet.c index 551e142e5..970c8d7d7 100644 --- a/vrrpd/vrrp_packet.c +++ b/vrrpd/vrrp_packet.c @@ -156,22 +156,22 @@ size_t vrrp_pkt_adver_dump(char *buf, size_t buflen, struct vrrp_pkt *pkt) struct vrrp_hdr *hdr = &pkt->hdr; buf[0] = 0x00; - snprintf(tmpbuf, sizeof(tmpbuf), "Version: %u\n", (hdr->vertype >> 4)); + snprintf(tmpbuf, sizeof(tmpbuf), "version %u, ", (hdr->vertype >> 4)); rs += strlcat(buf, tmpbuf, buflen); - snprintf(tmpbuf, sizeof(tmpbuf), "Type: %u (%s)\n", + snprintf(tmpbuf, sizeof(tmpbuf), "type %u (%s), ", (hdr->vertype & 0x0F), vrrp_packet_names[(hdr->vertype & 0x0F)]); rs += strlcat(buf, tmpbuf, buflen); - snprintf(tmpbuf, sizeof(tmpbuf), "VRID: %u\n", hdr->vrid); + snprintf(tmpbuf, sizeof(tmpbuf), "vrid %u, ", hdr->vrid); rs += strlcat(buf, tmpbuf, buflen); - snprintf(tmpbuf, sizeof(tmpbuf), "Priority: %u\n", hdr->priority); + snprintf(tmpbuf, sizeof(tmpbuf), "priority %u, ", hdr->priority); rs += strlcat(buf, tmpbuf, buflen); - snprintf(tmpbuf, sizeof(tmpbuf), "Count IPvX: %u\n", hdr->naddr); + snprintf(tmpbuf, sizeof(tmpbuf), "#%u addresses, ", hdr->naddr); rs += strlcat(buf, tmpbuf, buflen); - snprintf(tmpbuf, sizeof(tmpbuf), "Max Adver Int: %u\n", + snprintf(tmpbuf, sizeof(tmpbuf), "max adver int %u, ", ntohs(hdr->v3.adver_int)); rs += strlcat(buf, tmpbuf, buflen); - snprintf(tmpbuf, sizeof(tmpbuf), "Checksum: %x\n", ntohs(hdr->chksum)); + snprintf(tmpbuf, sizeof(tmpbuf), "checksum %x", ntohs(hdr->chksum)); rs += strlcat(buf, tmpbuf, buflen); return rs; |