diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-06-07 11:00:53 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-06-07 11:00:53 -0400 |
| commit | 95ff066772b10e534ea235482d1f93c97bc49d85 (patch) | |
| tree | 955b33a745411981c8dd177a42bc9845ce570748 /pimd/pim_util.c | |
| parent | 934a4c5975814bc966107a7bca4d16d882aa39ea (diff) | |
pimd: Make pim_pkt_dump use standard lib functions
pim_pkt_dump was creating a custom function to dump
detailed packet data. Switch it over to use
zlog_hexdump.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_util.c')
| -rw-r--r-- | pimd/pim_util.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/pimd/pim_util.c b/pimd/pim_util.c index fdfed2bf23..57a8488eca 100644 --- a/pimd/pim_util.c +++ b/pimd/pim_util.c @@ -100,23 +100,8 @@ uint16_t igmp_msg_decode8to16(uint8_t code) void pim_pkt_dump(const char *label, const uint8_t *buf, int size) { - char dump_buf[1000]; - int i = 0; - int j = 0; - - for (; i < size; ++i, j += 2) { - int left = sizeof(dump_buf) - j; - if (left < 4) { - if (left > 1) { - strcat(dump_buf + j, "!"); /* mark as truncated */ - } - break; - } - snprintf(dump_buf + j, left, "%02x", buf[i]); - } - - zlog_debug("%s: pkt dump size=%d: %s", + zlog_debug("%s: pkt dump size=%d", label, - size, - dump_buf); + size); + zlog_hexdump(buf, size); } |
