Add "T.38 handle protection" inside t38_add_address() so dissectors calling it don't need to find "t38" just for the handle check.

svn path=/trunk/; revision=53283
This commit is contained in:
Michael Mann 2013-11-12 21:10:20 +00:00
parent f56aa72157
commit a661864f48
5 changed files with 12 additions and 20 deletions

View File

@ -62,7 +62,6 @@
static dissector_handle_t rtp_handle=NULL;
static dissector_handle_t rtcp_handle=NULL;
static dissector_handle_t t38_handle=NULL;
static dissector_table_t nsp_object_dissector_table;
static dissector_table_t nsp_h221_dissector_table;
static dissector_table_t gef_name_dissector_table;
@ -346,7 +345,7 @@ static void h245_setup_channels(packet_info *pinfo, channel_info_t *upcoming_cha
/* T.38 */
if (!strcmp(upcoming_channel_lcl->data_type_str, "t38fax")) {
if (upcoming_channel_lcl->media_addr.addr.type!=AT_NONE && upcoming_channel_lcl->media_addr.port!=0 && t38_handle) {
if (upcoming_channel_lcl->media_addr.addr.type!=AT_NONE && upcoming_channel_lcl->media_addr.port!=0) {
t38_add_address(pinfo, &upcoming_channel_lcl->media_addr.addr,
upcoming_channel_lcl->media_addr.port, 0,
"H245", pinfo->fd->num);
@ -579,7 +578,6 @@ void proto_reg_handoff_h245(void) {
rtp_handle = find_dissector("rtp");
rtcp_handle = find_dissector("rtcp");
t38_handle = find_dissector("t38");
data_handle = find_dissector("data");
h263_handle = find_dissector("h263data");
amr_handle = find_dissector("amr_if2_nb");

View File

@ -227,7 +227,7 @@ void t38_add_address(packet_info *pinfo,
* we've already done this work, so we don't need to do it
* again.
*/
if (pinfo->fd->flags.visited)
if ((pinfo->fd->flags.visited) || (t38_udp_handle == NULL))
{
return;
}

View File

@ -70,7 +70,6 @@
static dissector_handle_t rtp_handle=NULL;
static dissector_handle_t rtcp_handle=NULL;
static dissector_handle_t t38_handle=NULL;
static dissector_table_t nsp_object_dissector_table;
static dissector_table_t nsp_h221_dissector_table;
static dissector_table_t gef_name_dissector_table;
@ -215,7 +214,7 @@ typedef enum _IndicationMessage_enum {
} IndicationMessage_enum;
/*--- End of included file: packet-h245-val.h ---*/
#line 88 "../../asn1/h245/packet-h245-template.c"
#line 87 "../../asn1/h245/packet-h245-template.c"
static const value_string h245_RequestMessage_short_vals[] = {
{ RequestMessage_nonStandard , "NSM" },
@ -477,7 +476,7 @@ static void h245_setup_channels(packet_info *pinfo, channel_info_t *upcoming_cha
/* T.38 */
if (!strcmp(upcoming_channel_lcl->data_type_str, "t38fax")) {
if (upcoming_channel_lcl->media_addr.addr.type!=AT_NONE && upcoming_channel_lcl->media_addr.port!=0 && t38_handle) {
if (upcoming_channel_lcl->media_addr.addr.type!=AT_NONE && upcoming_channel_lcl->media_addr.port!=0) {
t38_add_address(pinfo, &upcoming_channel_lcl->media_addr.addr,
upcoming_channel_lcl->media_addr.port, 0,
"H245", pinfo->fd->num);
@ -1923,7 +1922,7 @@ static int hf_h245_encrypted = -1; /* OCTET_STRING */
static int hf_h245_encryptedAlphanumeric = -1; /* EncryptedAlphanumeric */
/*--- End of included file: packet-h245-hf.c ---*/
#line 389 "../../asn1/h245/packet-h245-template.c"
#line 388 "../../asn1/h245/packet-h245-template.c"
/* Initialize the subtree pointers */
static int ett_h245 = -1;
@ -2424,7 +2423,7 @@ static gint ett_h245_FlowControlIndication = -1;
static gint ett_h245_MobileMultilinkReconfigurationIndication = -1;
/*--- End of included file: packet-h245-ett.c ---*/
#line 394 "../../asn1/h245/packet-h245-template.c"
#line 393 "../../asn1/h245/packet-h245-template.c"
/* Forward declarations */
static int dissect_h245_MultimediaSystemControlMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
@ -14491,7 +14490,7 @@ static void dissect_OpenLogicalChannel_PDU(tvbuff_t *tvb _U_, packet_info *pinfo
/*--- End of included file: packet-h245-fn.c ---*/
#line 403 "../../asn1/h245/packet-h245-template.c"
#line 402 "../../asn1/h245/packet-h245-template.c"
static void
dissect_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
@ -20185,7 +20184,7 @@ void proto_register_h245(void) {
NULL, HFILL }},
/*--- End of included file: packet-h245-hfarr.c ---*/
#line 484 "../../asn1/h245/packet-h245-template.c"
#line 483 "../../asn1/h245/packet-h245-template.c"
};
/* List of subtrees */
@ -20688,7 +20687,7 @@ void proto_register_h245(void) {
&ett_h245_MobileMultilinkReconfigurationIndication,
/*--- End of included file: packet-h245-ettarr.c ---*/
#line 491 "../../asn1/h245/packet-h245-template.c"
#line 490 "../../asn1/h245/packet-h245-template.c"
};
module_t *h245_module;
@ -20780,7 +20779,6 @@ void proto_reg_handoff_h245(void) {
rtp_handle = find_dissector("rtp");
rtcp_handle = find_dissector("rtcp");
t38_handle = find_dissector("t38");
data_handle = find_dissector("data");
h263_handle = find_dissector("h263data");
amr_handle = find_dissector("amr_if2_nb");

View File

@ -77,7 +77,6 @@
static dissector_handle_t rtp_handle;
static dissector_handle_t rtcp_handle;
static dissector_handle_t t38_handle;
static dissector_handle_t sprt_handle;
static dissector_handle_t msrp_handle;
static dissector_handle_t h264_handle;
@ -1886,8 +1885,7 @@ setup_sdp_transport(tvbuff_t *tvb, packet_info *pinfo, enum sdp_exchange_type ex
if ((transport_info->media_port[n] != 0) &&
!transport_info->media[n].set_rtp &&
(transport_info->proto_bitmask[n] & SDP_T38_PROTO) &&
(transport_info->proto_bitmask[n] & SDP_IPv4) &&
t38_handle) {
(transport_info->proto_bitmask[n] & SDP_IPv4)) {
t38_add_address(pinfo, &transport_info->src_addr[n], transport_info->media_port[n], 0, "SDP", pinfo->fd->num);
}
@ -2231,8 +2229,7 @@ dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
(transport_info->media_port[n] != 0) &&
!transport_info->media[n].set_rtp &&
(transport_info->proto_bitmask[n] & SDP_T38_PROTO) &&
(transport_info->proto_bitmask[n] & SDP_IPv4) &&
t38_handle) {
(transport_info->proto_bitmask[n] & SDP_IPv4)) {
t38_add_address(pinfo, &transport_info->src_addr[n], transport_info->media_port[n], 0, "SDP", pinfo->fd->num);
}
@ -2740,7 +2737,6 @@ proto_reg_handoff_sdp(void)
rtp_handle = find_dissector("rtp");
rtcp_handle = find_dissector("rtcp");
msrp_handle = find_dissector("msrp");
t38_handle = find_dissector("t38");
sprt_handle = find_dissector("sprt");
h264_handle = find_dissector("h264");
mp4ves_handle = find_dissector("mp4ves");

View File

@ -272,7 +272,7 @@ void t38_add_address(packet_info *pinfo,
* we've already done this work, so we don't need to do it
* again.
*/
if (pinfo->fd->flags.visited)
if ((pinfo->fd->flags.visited) || (t38_udp_handle == NULL))
{
return;
}