tcp: (trivial) remove some unnecessary if (tree) checks

Doing the checks ourselves doesn't save a lot of time.

Change-Id: Icd96d6487ba88bc8a0f9d475e8f569803b40cf1a
Reviewed-on: https://code.wireshark.org/review/20859
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Martin Kaiser 2017-04-01 12:00:47 +02:00 committed by Michael Mann
parent 7b0e5f87ce
commit 877b9a0d52
1 changed files with 25 additions and 33 deletions

View File

@ -5878,19 +5878,15 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
" (might be NMAP or someone else deliberately sending unusual packets)");
tcph->th_have_seglen = FALSE;
} else {
proto_item *pi;
/* Compute the length of data in this segment. */
tcph->th_seglen = reported_len - tcph->th_hlen;
tcph->th_have_seglen = TRUE;
if (tree) {
proto_item *pi;
pi = proto_tree_add_uint(ti, hf_tcp_len, tvb, offset+12, 1, tcph->th_seglen);
PROTO_ITEM_SET_GENERATED(pi);
}
/* handle TCP seq# analysis parse all new segments we see */
if(tcp_analyze_seq) {
if(!(pinfo->fd->flags.visited)) {
@ -5938,7 +5934,6 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
tcp_info_append_uint(pinfo, "Win", tcph->th_win);
if (tree) {
if (tcp_summary_in_tree) {
proto_item_append_text(ti, ", Seq: %u", tcph->th_seq);
}
@ -5947,7 +5942,6 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
} else {
proto_tree_add_uint(tcp_tree, hf_tcp_seq, tvb, offset + 4, 4, tcph->th_seq);
}
}
if (tcph->th_hlen < TCPH_MIN_LEN) {
/* Give up at this point; we put the source and destination port in
@ -5964,7 +5958,6 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
return offset+12;
}
if (tree) {
if (tcp_summary_in_tree) {
if(tcph->th_flags&TH_ACK) {
proto_item_append_text(ti, ", Ack: %u", tcph->th_ack);
@ -5983,7 +5976,6 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
PROTO_ITEM_SET_GENERATED(tf);
}
}
}
tf = proto_tree_add_uint(tcp_tree, hf_tcp_ack, tvb, offset + 8, 4, tcph->th_ack);
if (tcph->th_flags & TH_ACK) {