ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] [Patch] bug fix in follow_dlg.c

From: Stephen Fisher <stephentfisher@xxxxxxxxx>
Date: Tue, 17 Oct 2006 13:02:40 -0700
While researching another bug in follow_dlg.c, I spotted a different one 
that causes the from and to hostnames/ip addresses to be the same in the 
follow tcp stream dialog only with IPv6.  Please apply attached patch 
that corrects the code as shown below:

	if (stats.is_ipv6) {
	  struct e_in6_addr ipaddr;
	  memcpy(&ipaddr, stats.ip_address[0], 16);
	  hostname0 = get_hostname6(&ipaddr);
	  memcpy(&ipaddr, stats.ip_address[0], 16); <- should should be [1]
	  hostname1 = get_hostname6(&ipaddr);
	} else {
	  guint32 ipaddr;
	  memcpy(&ipaddr, stats.ip_address[0], 4);
	  hostname0 = get_hostname(ipaddr);
	  memcpy(&ipaddr, stats.ip_address[1], 4);
	  hostname1 = get_hostname(ipaddr);

Thanks,
  Steve

Index: gtk/follow_dlg.c
===================================================================
--- gtk/follow_dlg.c	(revision 19580)
+++ gtk/follow_dlg.c	(working copy)
@@ -332,7 +332,7 @@
 	  struct e_in6_addr ipaddr;
 	  memcpy(&ipaddr, stats.ip_address[0], 16);
 	  hostname0 = get_hostname6(&ipaddr);
-	  memcpy(&ipaddr, stats.ip_address[0], 16);
+	  memcpy(&ipaddr, stats.ip_address[1], 16);
 	  hostname1 = get_hostname6(&ipaddr);
 	} else {
 	  guint32 ipaddr;