summaryrefslogtreecommitdiff
path: root/ui/gtk/follow_tcp.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2014-05-11 15:07:25 +0200
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2014-05-11 17:01:54 +0000
commit98f608cc0ddd5493a18e87ffe09ed551969b8ae3 (patch)
tree73262480e9b0da27362ae9bf332967ab6ed8dbeb /ui/gtk/follow_tcp.c
parent44d83c2f4f9256f7436e43dee940c922d864d57d (diff)
downloadwireshark-98f608cc0ddd5493a18e87ffe09ed551969b8ae3.tar.gz
Identify client/server by their IP address and port number in follow streams dialog box
This allows to properly identify hosts that use the same port number Change-Id: I93bf5b53e4df1d339fb06b372b90f88fce6785a0 Reviewed-on: https://code.wireshark.org/review/1588 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'ui/gtk/follow_tcp.c')
-rw-r--r--ui/gtk/follow_tcp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/gtk/follow_tcp.c b/ui/gtk/follow_tcp.c
index 71b7d54b72..3b93865937 100644
--- a/ui/gtk/follow_tcp.c
+++ b/ui/gtk/follow_tcp.c
@@ -265,7 +265,9 @@ follow_tcp_stream_cb(GtkWidget * w _U_, gpointer data _U_)
port1 = ep_tcp_port_to_display(stats.port[1]);
/* Host 0 --> Host 1 */
- if(sc.src_port == stats.port[0]) {
+ if ((sc.src_port == stats.port[0]) &&
+ ((stats.is_ipv6 && (memcmp(sc.src_addr, stats.ip_address[0], 16) == 0)) ||
+ (!stats.is_ipv6 && (memcmp(sc.src_addr, stats.ip_address[0], 4) == 0)))) {
server_to_client_string =
g_strdup_printf("%s:%s " UTF8_RIGHTWARDS_ARROW " %s:%s (%u bytes)",
hostname0, port0,
@@ -280,7 +282,9 @@ follow_tcp_stream_cb(GtkWidget * w _U_, gpointer data _U_)
}
/* Host 1 --> Host 0 */
- if(sc.src_port == stats.port[1]) {
+ if ((sc.src_port == stats.port[1]) &&
+ ((stats.is_ipv6 && (memcmp(sc.src_addr, stats.ip_address[1], 16) == 0)) ||
+ (!stats.is_ipv6 && (memcmp(sc.src_addr, stats.ip_address[1], 4) == 0)))) {
client_to_server_string =
g_strdup_printf("%s:%s " UTF8_RIGHTWARDS_ARROW " %s:%s (%u bytes)",
hostname0, port0,