#include "extract.h"
void
-carp_print(netdissect_options *ndo, register const u_char *bp, register u_int len, int ttl)
+carp_print(netdissect_options *ndo, const u_char *bp, u_int len, int ttl)
{
int version, type;
const char *type_s;
ND_TCHECK_1(bp);
- version = (bp[0] & 0xf0) >> 4;
- type = bp[0] & 0x0f;
+ version = (EXTRACT_U_1(bp) & 0xf0) >> 4;
+ type = EXTRACT_U_1(bp) & 0x0f;
if (type == 1)
type_s = "advertise";
else
struct cksum_vec vec[1];
vec[0].ptr = (const uint8_t *)bp;
vec[0].len = len;
- if (ND_TTEST2(bp[0], len) && in_cksum(vec, 1))
+ if (ND_TTEST_LEN(bp, len) && in_cksum(vec, 1))
ND_PRINT((ndo, " (bad carp cksum %x!)",
EXTRACT_BE_U_2(bp + 6)));
}