diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2010-05-18 22:00:17 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2010-05-18 22:00:17 +0000 |
commit | 415f314c53641e6c1e90acc04d8954dccd991ac1 (patch) | |
tree | da0dd2b28b717a987422a3a81aeaf21b67ce9ba3 /epan/dissectors/packet-iscsi.c | |
parent | 1eeb3442b205e939bafaeabd33b1816acb57708b (diff) |
iscsi also has a system port (860) registered in addition to the more common
port (3260).
add knowledge about the registered system port for iscsi to the heuristics
so we automatically detect when iscsi is transported over this optional port.
svn path=/trunk/; revision=32881
Diffstat (limited to 'epan/dissectors/packet-iscsi.c')
-rw-r--r-- | epan/dissectors/packet-iscsi.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/epan/dissectors/packet-iscsi.c b/epan/dissectors/packet-iscsi.c index 6357dd20e6..c9e4f5ae53 100644 --- a/epan/dissectors/packet-iscsi.c +++ b/epan/dissectors/packet-iscsi.c @@ -89,7 +89,8 @@ static int dataDigestIsCRC32 = TRUE; static guint dataDigestSize = 4; -static guint iscsi_port = 3260; +static guint iscsi_port = 3260; +static guint iscsi_system_port = 860; /* Initialize the protocol and registered fields */ static int proto_iscsi = -1; @@ -2251,12 +2252,25 @@ dissect_iscsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean chec if(opcode_str == NULL) { badPdu = TRUE; } - else if(check_port && iscsi_port != 0 && - (((opcode & TARGET_OPCODE_BIT) && pinfo->srcport != iscsi_port) || - (!(opcode & TARGET_OPCODE_BIT) && pinfo->destport != iscsi_port))) { + + + if(!badPdu && check_port) { badPdu = TRUE; + if ((opcode & TARGET_OPCODE_BIT) && pinfo->srcport == iscsi_port) { + badPdu = FALSE; + } + if (!(opcode & TARGET_OPCODE_BIT) && pinfo->destport == iscsi_port) { + badPdu = FALSE; + } + if ((opcode & TARGET_OPCODE_BIT) && pinfo->srcport == iscsi_system_port) { + badPdu = FALSE; + } + if (!(opcode & TARGET_OPCODE_BIT) && pinfo->destport == iscsi_system_port) { + badPdu = FALSE; + } } - else if(enable_bogosity_filter) { + + if(!badPdu && enable_bogosity_filter) { /* try and distinguish between data and real headers */ if(data_segment_len > bogus_pdu_data_length_threshold) { badPdu = TRUE; @@ -3075,6 +3089,13 @@ proto_register_iscsi(void) 10, &iscsi_port); + prefs_register_uint_preference(iscsi_module, + "target_system_port", + "Target system port", + "System port number of iSCSI target", + 10, + &iscsi_system_port); + prefs_register_bool_preference(iscsi_module, "enable_data_digests", "Enable data digests", |