ICMPv6: Squelch a GCC warning

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);
          ^
This commit is contained in:
Francois-Xavier Le Bail 2018-02-14 11:51:09 +01:00
parent a7ca1167ed
commit e048961ec1

View File

@ -1275,16 +1275,17 @@ icmp6_print(netdissect_options *ndo,
break;
case ICMP6_HADISCOV_REPLY:
if (ndo->ndo_vflag) {
const nd_ipv6 *in6;
const u_char *cp;
const u_char *p;
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;
}
}
break;