#define LCPOPT_SDLOS 29
#define LCPOPT_PPPMUX 30
-#define LCPOPT_MIN LCPOPT_VEXT
-#define LCPOPT_MAX LCPOPT_PPPMUX
-
static const char *lcpconfopts[] = {
"Vend-Ext", /* (0) */
"MRU", /* (1) */
"PPP-Muxing", /* (30) */
};
+#define NUM_LCPOPTS (sizeof lcpconfopts / sizeof lcpconfopts[0])
+
/* ECP - to be supported */
/* CCP Config Options */
if (length < len)
return 0;
if (len < 2) {
- if ((opt >= LCPOPT_MIN) && (opt <= LCPOPT_MAX))
+ if (opt < NUM_LCPOPTS)
ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)",
lcpconfopts[opt], opt, len));
else
ND_PRINT((ndo, "\n\tunknown LCP option 0x%02x", opt));
return 0;
}
- if ((opt >= LCPOPT_MIN) && (opt <= LCPOPT_MAX))
+ if (opt < NUM_LCPOPTS)
ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u", lcpconfopts[opt], opt, len));
else {
ND_PRINT((ndo, "\n\tunknown LCP option 0x%02x", opt));