Ethereal-dev: [ethereal-dev] Another xdlc bug

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

From: Gilbert Ramirez <gram@xxxxxxxxxx>
Date: Sun, 26 Sep 1999 00:41:25 -0500
If you look at the packet trace I just sent out, you'll see another
bug in frame 8. N(R) in LLC should be 112, but it's shown as 0.

The "is_extended" variable was not taken into account for information
frames. This diff fixes that problem.

I'm no LLC expert; I'm reading up on it now. The "is_extended" variable
is also ignored w/regard to the control field for Unnumbered Frames.
Should the is_extended variable be taken into consideration there too?
And if so, can we move the assignment of control to before the
switch() statement on line 237 of xdlc.c, instead of having
it set in each case?

--gilbert

--- xdlc.c.orig	Sun Sep 26 00:32:34 1999
+++ xdlc.c	Sun Sep 26 00:33:52 1999
@@ -385,7 +385,10 @@
 	/*
 	 * Information frame.
 	 */
-	control = pd[offset];
+	if (is_extended)
+		control = pletohs(&pd[offset]);
+	else
+		control = pd[offset];
 	if (is_extended) {
 	    sprintf(info, "I%s, N(R) = %u, N(S) = %u",
 			((control & XDLC_P_F_EXT) ? " P" : ""),