diff options
author | Stephen Fisher <steve@stephen-fisher.com> | 2008-03-22 05:50:19 +0000 |
---|---|---|
committer | Stephen Fisher <steve@stephen-fisher.com> | 2008-03-22 05:50:19 +0000 |
commit | c4571a6ad5dcefe5803ecfe95ad4b8631c960229 (patch) | |
tree | 2b1212d4f75cb2c2be1e8a74ec9139f70d10ce20 /gtk/follow_ssl.c | |
parent | b906bf1708957ae3067a50999f1f79aa38e88ae7 (diff) |
Fix bug #1212: Follow SSL/UDP Stream gets direction wrong ...
svn path=/trunk/; revision=24715
Diffstat (limited to 'gtk/follow_ssl.c')
-rw-r--r-- | gtk/follow_ssl.c | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/gtk/follow_ssl.c b/gtk/follow_ssl.c index e18c796129..fbd9e71a5c 100644 --- a/gtk/follow_ssl.c +++ b/gtk/follow_ssl.c @@ -103,12 +103,11 @@ ssl_queue_packet_data(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_ if (follow_info->client_port == 0) { follow_info->client_port = pinfo->srcport; - memcpy(follow_info->client_ip, pinfo->src.data, pinfo->src.len); + COPY_ADDRESS(&follow_info->client_ip, &pinfo->src); } - if (memcmp(follow_info->client_ip, pinfo->src.data, pinfo->src.len) == 0 && - follow_info->client_port == pinfo->srcport) { + if (ADDRESSES_EQUAL(&follow_info->client_ip, &pinfo->src) && + follow_info->client_port == pinfo->srcport) rec->is_server = 0; - } else rec->is_server = 1; @@ -247,20 +246,32 @@ follow_ssl_stream_cb(GtkWidget * w, gpointer data _U_) /* Both Stream Directions */ both_directions_string = g_strdup_printf("Entire conversation (%u bytes)", follow_info->bytes_written[0] + follow_info->bytes_written[1]); - /* Host 0 --> Host 1 */ - server_to_client_string = - g_strdup_printf("%s:%s --> %s:%s (%u bytes)", - hostname0, port0, - hostname1, port1, - follow_info->bytes_written[0]); - - /* Host 1 --> Host 0 */ - client_to_server_string = - g_strdup_printf("%s:%s --> %s:%s (%u bytes)", - hostname1, port1, - hostname0, port0, - follow_info->bytes_written[1]); - + if(follow_info->client_port == stats.port[0]) { + server_to_client_string = + g_strdup_printf("%s:%s --> %s:%s (%u bytes)", + hostname0, port0, + hostname1, port1, + follow_info->bytes_written[0]); + + client_to_server_string = + g_strdup_printf("%s:%s --> %s:%s (%u bytes)", + hostname1, port1, + hostname0, port0, + follow_info->bytes_written[1]); + } else { + server_to_client_string = + g_strdup_printf("%s:%s --> %s:%s (%u bytes)", + hostname1, port1, + hostname0, port0, + follow_info->bytes_written[0]); + + client_to_server_string = + g_strdup_printf("%s:%s --> %s:%s (%u bytes)", + hostname0, port0, + hostname1, port1, + follow_info->bytes_written[1]); + } + follow_stream("Follow SSL Stream", follow_info, both_directions_string, server_to_client_string, client_to_server_string); @@ -312,8 +323,7 @@ follow_read_ssl_stream(follow_info_t *follow_info, if (follow_info->show_stream == FROM_SERVER) { skip = TRUE; } - } - else { + } else { global_pos = &global_server_pos; if (follow_info->show_stream == FROM_CLIENT) { skip = TRUE; |