The warning was:
./print-icmp6.c: In function 'icmp6_print':
./print-icmp6.c:1284:10: warning: cast discards '__attribute__((const))'
qualifier from pointer target type [-Wcast-qual]
in6 = (const nd_ipv6 *)(dp + 1);
^
break;
case ICMP6_HADISCOV_REPLY:
if (ndo->ndo_vflag) {
break;
case ICMP6_HADISCOV_REPLY:
if (ndo->ndo_vflag) {
ND_TCHECK_2(dp->icmp6_data16[0]);
ND_PRINT(", id 0x%04x", EXTRACT_BE_U_2(dp->icmp6_data16[0]));
cp = (const u_char *)dp + length;
ND_TCHECK_2(dp->icmp6_data16[0]);
ND_PRINT(", id 0x%04x", EXTRACT_BE_U_2(dp->icmp6_data16[0]));
cp = (const u_char *)dp + length;
- in6 = (const nd_ipv6 *)(dp + 1);
- for (; (const u_char *)in6 < cp; in6++) {
- ND_TCHECK_SIZE(in6);
- ND_PRINT(", %s", ip6addr_string(ndo, (const u_char *)in6));
+ p = (const u_char *)(dp + 1);
+ while (p < cp) {
+ ND_TCHECK_16(p);
+ ND_PRINT(", %s", ip6addr_string(ndo, p));
+ p += 16;