fix for bug 1045
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 10 Sep 2006 14:34:57 +0000 (14:34 +0000)
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 10 Sep 2006 14:34:57 +0000 (14:34 +0000)
windows in SYN and SYN+ACK packets are not scaled so dont apply window scaling to them when displaying them in the tree

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@19186 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-tcp.c

index dcb8e2bcd0ec35b586ed28448bbc2ae46b1e43f4..52fde13a16285ff4b38dd4ee5ac38ade6f279c2d 100644 (file)
@@ -2266,10 +2266,12 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     tf_rst = proto_tree_add_boolean(field_tree, hf_tcp_flags_reset, tvb, offset + 13, 1, tcph->th_flags);
     tf_syn = proto_tree_add_boolean(field_tree, hf_tcp_flags_syn, tvb, offset + 13, 1, tcph->th_flags);
     tf_fin = proto_tree_add_boolean(field_tree, hf_tcp_flags_fin, tvb, offset + 13, 1, tcph->th_flags);
-    if(tcp_relative_seq && (tcph->th_win!=real_window)){
+    if(tcp_relative_seq 
+    && (tcph->th_win!=real_window) 
+    && !(tcph->th_flags&TH_SYN) ){   /* SYNs are never scaled */
       proto_tree_add_uint_format(tcp_tree, hf_tcp_window_size, tvb, offset + 14, 2, tcph->th_win, "Window size: %u (scaled)", tcph->th_win);
     } else {
-      proto_tree_add_uint(tcp_tree, hf_tcp_window_size, tvb, offset + 14, 2, tcph->th_win);
+      proto_tree_add_uint(tcp_tree, hf_tcp_window_size, tvb, offset + 14, 2, real_window);
     }
   }