aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUli Heilmeier <uh@heilmeier.eu>2017-12-08 18:21:04 +0100
committerMichael Mann <mmann78@netscape.net>2017-12-10 02:04:16 +0000
commit22a7d8fa8d8b8c7171ede55e7f413d004cb7b099 (patch)
treea576ba3b3dd82cb797dd05153e8b10b3ebc4dd6f
parent8cb9a094bf1d08ffb100a384de03a9774f7183c0 (diff)
SOCKS: Display right version in pseudo header
Use the previous recorded version as version and set field as generated. Bug: 14262 Change-Id: I0872ed826ccd8a5a1b75b071d810404d08ddc7b3 Reviewed-on: https://code.wireshark.org/review/24741 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--epan/dissectors/packet-socks.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/epan/dissectors/packet-socks.c b/epan/dissectors/packet-socks.c
index f57ea07c66..e2251c6741 100644
--- a/epan/dissectors/packet-socks.c
+++ b/epan/dissectors/packet-socks.c
@@ -1088,23 +1088,12 @@ dissect_socks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) {
ti = proto_tree_add_item( tree, proto_socks, tvb, offset, -1, ENC_NA );
socks_tree = proto_item_add_subtree(ti, ett_socks);
- if (hash_info->server_port == pinfo->destport) {
- if ( hash_info->version == 4) {
- display_socks_v4(tvb, offset, pinfo, socks_tree, hash_info, state_info);
- } else if ( hash_info->version == 5) {
- client_display_socks_v5(tvb, offset, pinfo, socks_tree, hash_info, state_info);
- }
- } else {
- if ( hash_info->version == 4) {
- display_socks_v4(tvb, offset, pinfo, socks_tree, hash_info, state_info);
- } else if ( hash_info->version == 5) {
- server_display_socks_v5(tvb, offset, pinfo, socks_tree, hash_info, state_info);
- }
- }
-
/* if past startup, add the faked stuff */
if ( pinfo->num > hash_info->start_done_frame){
/* add info to tree */
+ ti = proto_tree_add_uint( socks_tree, hf_socks_ver, tvb, offset, 0, hash_info->version);
+ PROTO_ITEM_SET_GENERATED(ti);
+
ti = proto_tree_add_uint( socks_tree, hf_socks_cmd, tvb, offset, 0, hash_info->command);
PROTO_ITEM_SET_GENERATED(ti);
@@ -1125,6 +1114,20 @@ dissect_socks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) {
ti = proto_tree_add_uint( socks_tree, hf_socks_dstport, tvb, offset, 0, hash_info->port);
PROTO_ITEM_SET_GENERATED(ti);
}
+ } else {
+ if (hash_info->server_port == pinfo->destport) {
+ if ( hash_info->version == 4) {
+ display_socks_v4(tvb, offset, pinfo, socks_tree, hash_info, state_info);
+ } else if ( hash_info->version == 5) {
+ client_display_socks_v5(tvb, offset, pinfo, socks_tree, hash_info, state_info);
+ }
+ } else {
+ if ( hash_info->version == 4) {
+ display_socks_v4(tvb, offset, pinfo, socks_tree, hash_info, state_info);
+ } else if ( hash_info->version == 5) {
+ server_display_socks_v5(tvb, offset, pinfo, socks_tree, hash_info, state_info);
+ }
+ }
}
}