Ethereal-dev: [Ethereal-dev] PPP dissector bug

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

From: Irfan Khan <ikhan@xxxxxxxxxxxx>
Date: Mon, 10 Mar 2003 19:38:08 -0700
Hi,

I was looking at a log, using ethereal, where the packets were PPP over L2TP. The L2TP dissector was calling the PPP HDLC handler correctly however the PPP dissector was unable to make make sense of the packets because they had a 0x7e in the beginning. The fix would seem to be to modify the PPP dissector to handle beginning 0x7es'. Attached is a patch containing a possible solution.

Thanks,
Irfan
Index: packet-ppp.c
===================================================================
RCS file: /cvsroot/ethereal/packet-ppp.c,v
retrieving revision 1.108
diff -u -r1.108 packet-ppp.c
--- packet-ppp.c	7 Feb 2003 20:09:33 -0000	1.108
+++ packet-ppp.c	11 Mar 2003 02:33:43 -0000
@@ -2804,8 +2804,14 @@
   int        rx_fcs_offset;
   guint32    rx_fcs_exp;
   guint32    rx_fcs_got;
+  int        index = 0;
 
-  byte0 = tvb_get_guint8(tvb, 0);
+  while( (byte0 = tvb_get_guint8(tvb, index)) == 0x7e )
+    index++;
+
+  if( index != 0 )
+    tvb = tvb_new_subset(tvb, index, -1, -1);
+    
   if (byte0 == CHDLC_ADDR_UNICAST || byte0 == CHDLC_ADDR_MULTICAST) {
     /* Cisco HDLC encapsulation */
     call_dissector(chdlc_handle, tvb, pinfo, tree);