In: switch (... p[n] ...) ...
} else {
ND_PRINT((ndo, " (%s): ", etheraddr_string(ndo, src)));
}
- switch (p[0]) {
+ switch (EXTRACT_U_1(p)) {
case 0: ND_PRINT((ndo, "Spectrum Management Act#%d", EXTRACT_U_1(p + 1))); break;
case 1: ND_PRINT((ndo, "QoS Act#%d", EXTRACT_U_1(p + 1))); break;
case 2: ND_PRINT((ndo, "DLS Act#%d", EXTRACT_U_1(p + 1))); break;
ND_PRINT((ndo, " %d", EXTRACT_U_1(cp + 1)));
}
- switch(cp[1]) {
+ switch(EXTRACT_U_1(cp + 1)) {
case 2:
babel_print_v2(ndo, cp, length);
break;
if (i + optlen > len)
goto trunc;
- switch (bp[i]) {
+ switch (EXTRACT_U_1(bp + i)) {
case IP6OPT_PAD1:
ND_PRINT((ndo, ", pad1"));
break;
if (i + optlen > len)
goto trunc;
- switch (bp[i]) {
+ switch (EXTRACT_U_1(bp + i)) {
case IP6OPT_PAD1:
ND_PRINT((ndo, "(pad1)"));
break;
ip_heuristic_guess(netdissect_options *ndo,
register const u_char *p, u_int length)
{
- switch(p[0]) {
+ switch(EXTRACT_U_1(p)) {
case 0x45:
case 0x46:
case 0x47:
l2info->cookie_len += lp->cookie_len;
- switch (p[0]) {
+ switch (EXTRACT_U_1(p)) {
case LS_COOKIE_ID:
l2info->cookie_type = LS_COOKIE_ID;
l2info->cookie_len += 2;
goto trunc;
ND_TCHECK(bp[i + optlen]);
- switch (bp[i]) {
+ switch (EXTRACT_U_1(bp + i)) {
case IP6MOPT_PAD1:
ND_PRINT((ndo, "(pad1)"));
break;
if (len < 2)
goto trunc;
ND_TCHECK(bp[1]);
- switch (bp[0]) {
+ switch (EXTRACT_U_1(bp)) {
case 1:
af = AF_INET;
addr_len = (u_int)sizeof(struct in_addr);