Ethereal-dev: [Ethereal-dev] incorrect L2TP tie breaker decode

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

From: Jim Sienicki <jsienicki@xxxxxxxxxxx>
Date: Fri, 08 Jun 2001 19:57:00 -0400
Platform: RedHat linux 7.0 kernel 2.2.16
         (altough the problem should exist on all platforms)
Ethereal Version: 0.8.18

The problem is that the Tie Breaker AVP for L2TP is a 64-bit value, but
Ethereal is decoding it as a 32-bit value.  The problem is compounded
by the fact that  it is also reading the 32-bit value from an incorrect
offset within the AVP (tmp_index+=8 instead of tmp_index+=2), which
causes it to run into the next AVP or off the end of the packet if it
is the last AVP.  This AVP should probably be treated like the Challenge
and Challenge Response AVPs, which are arbitarily long byte sequences.
These sequences are not displayed, but can be seen in the raw byte
window
(I didn't know of an easy way to dump a sequence of 8-bytes).  I have
attached the diff -u output of the packet-l2tp.c file.  Hope this helps.


-------------------------
Jim Sienicki
Senior Software Engineer
Issanni Communications
Index: packet-l2tp.c
===================================================================
RCS file: /cvsroot/ethereal/packet-l2tp.c,v
retrieving revision 1.22
diff -u -r1.22 packet-l2tp.c
--- packet-l2tp.c	2001/03/30 06:10:54	1.22
+++ packet-l2tp.c	2001/06/08 23:15:01
@@ -540,9 +540,8 @@
 			break;
 
 		case TIE_BREAKER:
-			long_type = tvb_get_ntohl(tvb, (tmp_index+=8));
-			proto_tree_add_uint_format(l2tp_avp_tree,hf_l2tp_code, tvb, index + 6, 1,
-			  rhcode, " TIE_BREAKER %lu 0x%lx", long_type,long_type );
+			proto_tree_add_uint_format(l2tp_avp_tree,hf_l2tp_code, tvb,index + 6,
+			  (avp_len - 6 ), rhcode, "  Tie Breaker: ");
 			break;
 
 		case FIRMWARE_REVISION: