Ethereal-dev: [Ethereal-dev] FW: Patch for x.25

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Martin Thomas (EUS)" <Martin.Thomas@xxxxxxxxxxxxxxx>
Date: Thu, 9 May 2002 00:32:52 -0500
Title: FW: Patch for x.25

<<my.patch>>
 
I noticed that when called and calling addresses were different lengths,
they got mangled depending on the value of the TOA bit.

This patch fixes that. If anyone needs a sample capture, I can provide one.

Cheers / Martin Thomas


 <<my.patch>>

Index: packet-x25.c
===================================================================
RCS file: /cvsroot/ethereal/packet-x25.c,v
retrieving revision 1.65
diff -u -r1.65 packet-x25.c
--- packet-x25.c	2002/04/09 08:15:02	1.65
+++ packet-x25.c	2002/05/09 05:15:36
@@ -1313,6 +1313,13 @@
     byte = tvb_get_guint8(tvb, *offset);
     len1 = (byte >> 4) & 0x0F;
     len2 = (byte >> 0) & 0x0F;
+
+    if (!toa) { /* then switch the length indicators.. */
+      i = len1;
+      len1 = len2;
+      len2 = i;
+    }
+
     if (tree) {
 	proto_tree_add_text(tree, tvb, *offset, 1,
 		decode_numeric_bitfield(byte, 0xF0, 1*8,