]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Make pim_pkt_dump use standard lib functions
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 7 Jun 2016 15:00:53 +0000 (11:00 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 7 Jun 2016 15:00:53 +0000 (11:00 -0400)
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>
pimd/pim_util.c

index fdfed2bf23e71ad9a69826836abc28d9983520db..57a8488ecab721a0a12cea57d9f97f40dd6f1b8e 100644 (file)
@@ -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);
 }