diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-03-22 23:49:20 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-03-22 23:49:20 +0000 |
commit | fbaa21263490c812555e214ad747b0f71b697d1c (patch) | |
tree | dc1e85d772ae414f9a012101ce697a92b4edade2 /packet-l2tp.c | |
parent | 0df6b59a9145f038abfcf76a9fc5fc979a9d7429 (diff) | |
download | wireshark-fbaa21263490c812555e214ad747b0f71b697d1c.tar.gz wireshark-fbaa21263490c812555e214ad747b0f71b697d1c.tar.bz2 wireshark-fbaa21263490c812555e214ad747b0f71b697d1c.zip |
Florian Lohoff's fixes to L2TP result and error code dissection.
svn path=/trunk/; revision=1743
Diffstat (limited to 'packet-l2tp.c')
-rw-r--r-- | packet-l2tp.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/packet-l2tp.c b/packet-l2tp.c index 80a12fed1a..69133653e6 100644 --- a/packet-l2tp.c +++ b/packet-l2tp.c @@ -7,7 +7,7 @@ * Laurent Cazalet <laurent.cazalet@mailclub.net> * Thomas Parvais <thomas.parvais@advalvas.be> * - * $Id: packet-l2tp.c,v 1.5 2000/03/14 06:03:23 guy Exp $ + * $Id: packet-l2tp.c,v 1.6 2000/03/22 23:49:20 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -253,7 +253,8 @@ void dissect_l2tp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree unsigned short avp_type; unsigned short msg_type; unsigned short avp_len; - unsigned short error_type; + unsigned short result_code; + unsigned short error_code; unsigned short avp_ver; unsigned short avp_rev; unsigned short framing; @@ -395,20 +396,25 @@ void dissect_l2tp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree break; case RESULT_ERROR_CODE: - if ( avp_len >= 10 ) { - memcpy(&error_type,(tmp_ptr+=2),sizeof(unsigned short)); - error_type=htons(error_type); + if ( avp_len >= 8 ) { + memcpy(&result_code,(tmp_ptr+=2),sizeof(unsigned short)); + result_code=htons(result_code); proto_tree_add_uint_format(l2tp_avp_tree,hf_l2tp_code,offset + 6, 2, rhcode, - " Error Type: %d", error_type ); + " Result code: %d", result_code ); } - + if ( avp_len >= 10 ) { + memcpy(&error_code,(tmp_ptr+=2),sizeof(unsigned short)); + error_code=htons(error_code); + proto_tree_add_uint_format(l2tp_avp_tree,hf_l2tp_code,offset + 8, + 2, rhcode, + " Error code: %d", error_code); + } if ( avp_len > 10 ) { memset(error_string,'\0' ,sizeof(error_string)); - tmp_ptr+=4; strncpy(error_string,(tmp_ptr),(avp_len - 10)); - proto_tree_add_uint_format(l2tp_avp_tree,hf_l2tp_code, offset + 9, (avp_len - 10), + proto_tree_add_uint_format(l2tp_avp_tree,hf_l2tp_code, offset + 10, (avp_len - 10), rhcode, " Error Message: %s", error_string ); } break; |