MEGACO: fix dissection of packets
Bug introduced in g841f636 Bug: 12059 Change-Id: I02a33f95baf2670fb491c951ba85a1bacdeb6386 Reviewed-on: https://code.wireshark.org/review/13613 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
parent
c9d148c077
commit
18afa39e52
|
@ -561,7 +561,7 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
|
||||||
gint tvb_transaction_end_offset;
|
gint tvb_transaction_end_offset;
|
||||||
proto_tree *megaco_tree, *message_body_tree, *megaco_tree_command_line, *ti, *sub_ti;
|
proto_tree *megaco_tree, *message_body_tree, *megaco_tree_command_line, *ti, *sub_ti;
|
||||||
|
|
||||||
guint8 word[7];
|
guint8 word[15];
|
||||||
guint8 TermID[30];
|
guint8 TermID[30];
|
||||||
guint8 tempchar;
|
guint8 tempchar;
|
||||||
gint tvb_RBRKT, tvb_LBRKT, RBRKT_counter, LBRKT_counter;
|
gint tvb_RBRKT, tvb_LBRKT, RBRKT_counter, LBRKT_counter;
|
||||||
|
@ -611,11 +611,18 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
|
||||||
*/
|
*/
|
||||||
tvb_offset = megaco_tvb_skip_wsp(tvb, tvb_offset);
|
tvb_offset = megaco_tvb_skip_wsp(tvb, tvb_offset);
|
||||||
|
|
||||||
|
/* Quick fix for MEGACO not following the RFC, hopefully not breaking any thing
|
||||||
|
* Turned out to be TPKT in case of TCP, added some code to handle that.
|
||||||
|
*
|
||||||
|
* tvb_offset = tvb_find_guint8(tvb, tvb_offset, 5, 'M');
|
||||||
|
*/
|
||||||
|
if(!tvb_get_nstringz0(tvb,tvb_offset,sizeof(word),word)) return tvb_captured_length(tvb);
|
||||||
|
|
||||||
/* Quick fix for MEGACO packet with Authentication Header,
|
/* Quick fix for MEGACO packet with Authentication Header,
|
||||||
* marked as "AU" or "Authentication".
|
* marked as "AU" or "Authentication".
|
||||||
*/
|
*/
|
||||||
if (g_ascii_strncasecmp(word, "Authentication", 14) ||
|
if ((g_ascii_strncasecmp(word, "Authentication", 14) == 0) ||
|
||||||
g_ascii_strncasecmp(word, "AU", 2) ) {
|
(g_ascii_strncasecmp(word, "AU", 2) == 0)) {
|
||||||
gint counter;
|
gint counter;
|
||||||
guint8 next;
|
guint8 next;
|
||||||
|
|
||||||
|
@ -633,13 +640,6 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Quick fix for MEGACO not following the RFC, hopefully not breaking any thing
|
|
||||||
* Turned out to be TPKT in case of TCP, added some code to handle that.
|
|
||||||
*
|
|
||||||
* tvb_offset = tvb_find_guint8(tvb, tvb_offset, 5, 'M');
|
|
||||||
*/
|
|
||||||
if(!tvb_get_nstringz0(tvb,tvb_offset,sizeof(word),word)) return tvb_captured_length(tvb);
|
|
||||||
|
|
||||||
short_form = (tvb_get_guint8(tvb, tvb_offset ) == '!');
|
short_form = (tvb_get_guint8(tvb, tvb_offset ) == '!');
|
||||||
|
|
||||||
if (g_ascii_strncasecmp(word, "MEGACO", 6) != 0 && !short_form){
|
if (g_ascii_strncasecmp(word, "MEGACO", 6) != 0 && !short_form){
|
||||||
|
|
Loading…
Reference in New Issue