#include <config.h>
#endif
-#include <string.h>
-
#include "netdissect-stdinc.h"
#include "netdissect.h"
length -= 4 - netlen;
if (length < 1)
goto trunc;
- ND_TCHECK_1(cp);
distances = GET_U_1(cp);
cp++;
length--;
ND_PRINT(" %s %s ",
gateways < intgw ? "int" : "ext",
- ipaddr_string(ndo, (const u_char *)&addr));
+ ipaddr_string(ndo, (const u_char *)&addr)); /* local buffer, not packet data; don't use GET_IPADDR_STRING() */
comma = "";
ND_PRINT("(");
while (distances != 0) {
if (length < 2)
goto trunc;
- ND_TCHECK_2(cp);
ND_PRINT("%sd%u:", comma, GET_U_1(cp));
cp++;
comma = ", ";
/* Pickup network number */
if (length < 1)
goto trunc;
- ND_TCHECK_1(cp);
addr = ((uint32_t) GET_U_1(cp)) << 24;
cp++;
length--;
if (IN_CLASSB(addr)) {
if (length < 1)
goto trunc;
- ND_TCHECK_1(cp);
addr |= ((uint32_t) GET_U_1(cp)) << 16;
cp++;
length--;
} else if (!IN_CLASSA(addr)) {
if (length < 2)
goto trunc;
- ND_TCHECK_2(cp);
addr |= ((uint32_t) GET_U_1(cp)) << 16;
cp++;
addr |= ((uint32_t) GET_U_1(cp)) << 8;
cp++;
length -= 2;
}
- ND_PRINT(" %s", ipaddr_string(ndo, (const u_char *)&addr));
+ ND_PRINT(" %s", ipaddr_string(ndo, (const u_char *)&addr)); /* local buffer, not packet data; don't use GET_IPADDR_STRING() */
networks--;
}
distances--;