summaryrefslogtreecommitdiff
path: root/epan
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2014-11-25 23:14:50 +0100
committerAnders Broman <a.broman58@gmail.com>2014-11-28 09:27:29 +0000
commite8cda3b1bd17b60aaddd3340faaa22940640e7a6 (patch)
tree9ab784478e20dfe67d3f7ddaf60c8850a41e25a2 /epan
parentafcdff0874edea41ecc1bd23b8b7c142c7890045 (diff)
downloadwireshark-e8cda3b1bd17b60aaddd3340faaa22940640e7a6.tar.gz
TCP: move Windows Scaling and SCPS checks after options decoding
This was changed in g8881f3f in an attempt to avoid throwing an exception when decoding the options field Bug: 10514 Change-Id: Ia4b49f484d6255090c5a6e425a9716b48ccc4cb5 Reviewed-on: https://code.wireshark.org/review/5495 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-tcp.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index f801e42955..af711ed029 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -4801,24 +4801,6 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
tcph->num_sack_ranges = 0;
- if(!pinfo->fd->flags.visited) {
- if((tcph->th_flags & TH_SYN)==TH_SYN) {
- /* Check the validity of the window scale value
- */
- verify_tcp_window_scaling((tcph->th_flags&TH_ACK)==TH_ACK,tcpd);
- }
-
- if((tcph->th_flags & (TH_SYN|TH_ACK))==(TH_SYN|TH_ACK)) {
- /* If the SYN or the SYN+ACK offered SCPS capabilities,
- * validate the flow's bidirectional scps capabilities.
- * The or protects against broken implementations offering
- * SCPS capabilities on SYN+ACK even if it wasn't offered with the SYN
- */
- if(tcpd && ((tcpd->rev->scps_capable) || (tcpd->fwd->scps_capable))) {
- verify_scps(pinfo, tf_syn, tcpd);
- }
- }
- }
/* handle TCP seq# analysis, print any extra SEQ/ACK data for this segment*/
if(tcp_analyze_seq) {
@@ -4847,6 +4829,25 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
options_item, tcph);
}
+ if(!pinfo->fd->flags.visited) {
+ if((tcph->th_flags & TH_SYN)==TH_SYN) {
+ /* Check the validity of the window scale value
+ */
+ verify_tcp_window_scaling((tcph->th_flags&TH_ACK)==TH_ACK,tcpd);
+ }
+
+ if((tcph->th_flags & (TH_SYN|TH_ACK))==(TH_SYN|TH_ACK)) {
+ /* If the SYN or the SYN+ACK offered SCPS capabilities,
+ * validate the flow's bidirectional scps capabilities.
+ * The or protects against broken implementations offering
+ * SCPS capabilities on SYN+ACK even if it wasn't offered with the SYN
+ */
+ if(tcpd && ((tcpd->rev->scps_capable) || (tcpd->fwd->scps_capable))) {
+ verify_scps(pinfo, tf_syn, tcpd);
+ }
+ }
+ }
+
/* Skip over header + options */
offset += tcph->th_hlen;