Mask out unnecessary bits in control guint16 in order to properly
authorGilbert Ramirez <gram@alumni.rice.edu>
Mon, 27 Sep 1999 03:12:55 +0000 (03:12 -0000)
committerGilbert Ramirez <gram@alumni.rice.edu>
Mon, 27 Sep 1999 03:12:55 +0000 (03:12 -0000)
compare against XDLC_I, XDLC_UI, and XDLC_U in XDLC_HAS_PAYLOAD() and
XDLC_CONTROL_LEN() macros.

svn path=/trunk/; revision=729

xdlc.h

diff --git a/xdlc.h b/xdlc.h
index d3092719c0ee4599c442515a732b841601187896..878f90389081e77f8fc56080f3cd367b59916762 100644 (file)
--- a/xdlc.h
+++ b/xdlc.h
@@ -2,7 +2,7 @@
  * Define *DLC frame types, and routine to dissect the control field of
  * a *DLC frame.
  *
- * $Id: xdlc.h,v 1.4 1999/09/26 20:31:51 guy Exp $
+ * $Id: xdlc.h,v 1.5 1999/09/27 03:12:55 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@unicom.net>
@@ -64,7 +64,7 @@
  * Unnumbered Information frame) and FALSE if it doesn't.
  */
 #define XDLC_HAS_PAYLOAD(control) \
-       ((control) == XDLC_I || (control) == (XDLC_UI|XDLC_U))
+       ((control & 0x3) == XDLC_I || (control & 0x3) == (XDLC_UI|XDLC_U))
 
 /*
  * This macro takes the control field of an xDLC frame, and a flag saying
@@ -73,7 +73,7 @@
  * in extended mode, it's 3 bytes long, otherwise it's 4 bytes long).
  */
 #define XDLC_CONTROL_LEN(control, is_extended) \
-       (((control) == XDLC_U || !(is_extended)) ? 3 : 4)
+       (((control & 0x3) == XDLC_U || !(is_extended)) ? 3 : 4)
 
 int get_xdlc_control(const u_char *pd, int offset, int is_response,
   int extended);