diff options
author | Laurent Deniel <laurent.deniel@free.fr> | 2003-02-16 20:55:10 +0000 |
---|---|---|
committer | Laurent Deniel <laurent.deniel@free.fr> | 2003-02-16 20:55:10 +0000 |
commit | 33b251a58ff1e9d556f88ef5ff0de13927c9b551 (patch) | |
tree | fc6a587df09567993094273b411d8255105cc361 /packet-x25.c | |
parent | f9a0be9c6b7e82f1ffc3c48cecf9230548e551e0 (diff) |
According to ITU/X.25 (refer to table G.2), only the bits 1 to 6
represent the number of semi-octets in the calling/called address
extension facility. So bits 7 and 8 shall be masked.
This fix avoids an incorrect detection of malformed packets.
svn path=/trunk/; revision=7157
Diffstat (limited to 'packet-x25.c')
-rw-r--r-- | packet-x25.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packet-x25.c b/packet-x25.c index 863141f4e6..cd52d02ccf 100644 --- a/packet-x25.c +++ b/packet-x25.c @@ -2,7 +2,7 @@ * Routines for X.25 packet disassembly * Olivier Abad <oabad@noos.fr> * - * $Id: packet-x25.c,v 1.76 2003/01/31 03:17:47 guy Exp $ + * $Id: packet-x25.c,v 1.77 2003/02/16 20:55:10 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1003,7 +1003,7 @@ dump_facilities(proto_tree *tree, int *offset, tvbuff_t *tvb) byte1 = tvb_get_guint8(tvb, *offset+1); proto_tree_add_text(fac_subtree, tvb, *offset+1, 1, "Length : %u", byte1); - byte2 = tvb_get_guint8(tvb, *offset+2); + byte2 = tvb_get_guint8(tvb, *offset+2) & 0x3F; proto_tree_add_text(fac_subtree, tvb, *offset+2, 1, "Number of semi-octets in DTE address : %u", byte2); for (i = 0; i < byte2; i++) { @@ -1036,7 +1036,7 @@ dump_facilities(proto_tree *tree, int *offset, tvbuff_t *tvb) byte1 = tvb_get_guint8(tvb, *offset+1); proto_tree_add_text(fac_subtree, tvb, *offset+1, 1, "Length : %u", byte1); - byte2 = tvb_get_guint8(tvb, *offset+2); + byte2 = tvb_get_guint8(tvb, *offset+2) & 0x3F; proto_tree_add_text(fac_subtree, tvb, *offset+2, 1, "Number of semi-octets in DTE address : %u", byte2); for (i = 0; i < byte2; i++) { |