Update the UDP and the TCP conversation list tool so that it can handle IPv6 as well.
[obnox/wireshark/wip.git] / epan / to_str.c
index da56c45a936c4f2f6ae956acaac04971199c1cf7..3588da8f7edbb59b7c1502a1d723cdf6273824b2 100644 (file)
@@ -1,7 +1,7 @@
 /* to_str.c
  * Routines for utilities to convert various other types to strings.
  *
- * $Id: to_str.c,v 1.29 2003/08/23 13:35:06 sahlberg Exp $
+ * $Id: to_str.c,v 1.30 2003/08/23 13:56:39 sahlberg Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -183,10 +183,17 @@ ip6_to_str(const struct e_in6_addr *ad) {
 #ifndef INET6_ADDRSTRLEN
 #define INET6_ADDRSTRLEN 46
 #endif
-  static gchar buf[INET6_ADDRSTRLEN];
+  static int i=0;
+  static gchar *strp, str[4][INET6_ADDRSTRLEN];
 
-  inet_ntop(AF_INET6, (const guchar*)ad, (gchar*)buf, sizeof(buf));
-  return buf;
+  i++;
+  if(i>=4){
+    i=0;
+  }
+  strp=str[i];
+
+  inet_ntop(AF_INET6, (const guchar*)ad, (gchar*)strp, INET6_ADDRSTRLEN);
+  return strp;
 }
 
 gchar*