]> The Tcpdump Group git mirrors - tcpdump/commitdiff
better print the IP addresses native than using getname();
authorhannes <hannes>
Mon, 22 Jul 2002 23:16:12 +0000 (23:16 +0000)
committerhannes <hannes>
Mon, 22 Jul 2002 23:16:12 +0000 (23:16 +0000)
as we have a finite set of charbuffer this might cause overflows
otherwise; thats ok as the RD is typically not resolveable;

print-bgp.c

index aeac676fd1d0ac537535e189e5eecc58d0ab1ebb..92f567c950e430cf1b0607976946d3242d14ddc5 100644 (file)
@@ -33,7 +33,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-     "@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.40 2002-07-22 23:00:22 hannes Exp $";
+     "@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.41 2002-07-22 23:16:12 hannes Exp $";
 #endif
 
 #include <sys/param.h>
@@ -382,14 +382,20 @@ bgp_vpn_rd_print (const u_char *pptr) {
     switch (EXTRACT_16BITS(pptr)) {
         /* AS:IP-address fmt*/
     case 0:
-        pos+=sprintf(pos, "%u:%s",
+        pos+=sprintf(pos, "%u:%u.%u.%u.%u",
                      EXTRACT_16BITS(pptr+2),
-                     getname(pptr+4));
+                     *(pptr+4),
+                     *(pptr+5),
+                     *(pptr+6),
+                     *(pptr+7));
         break;
         /* IP-address:AS fmt*/
     case 1:
-        pos+=sprintf(pos, "%s:%u",
-                     getname(pptr+2),
+        pos+=sprintf(pos, "%u.%u.%u.%u:%u",
+                     *(pptr+2),
+                     *(pptr+3),
+                     *(pptr+4),
+                     *(pptr+5),
                      EXTRACT_16BITS(pptr+6));
         break;
     default: