the VENDOR macro operates on signed quantities, which is
authoraland <aland>
Thu, 26 Jun 2003 15:21:33 +0000 (15:21 +0000)
committeraland <aland>
Thu, 26 Jun 2003 15:21:33 +0000 (15:21 +0000)
annoying.  So when it's shifted right, it carries the sign with it.

The solution is to keep only the lower 16 bits, so that vendor
codes higher than 32768 can work.

Bug noted by Jacob S. Barrett

src/include/libradius.h

index 1027c64..91181c0 100644 (file)
@@ -68,7 +68,7 @@
 #ifdef _LIBRADIUS
 #  define AUTH_HDR_LEN         20
 #  define VENDORPEC_USR                429
-#  define VENDOR(x)            (x >> 16)
+#  define VENDOR(x)            ((x >> 16) & 0xffff)
 #  define DEBUG                        if (librad_debug) printf
 #  define debug_pair(vp)       do { if (librad_debug) { \
                                        putchar('\t'); \