In print_mtrace() the check was just before a GET that fetches the last
field of the structure. The other three checks tested exactly the space
from that GET_IPADDR_STRING() would fetch anyway.
{
const struct tr_query *tr = (const struct tr_query *)(bp + 8);
{
const struct tr_query *tr = (const struct tr_query *)(bp + 8);
if (len < 8 + sizeof (struct tr_query)) {
ND_PRINT(" [invalid len %u]", len);
return;
if (len < 8 + sizeof (struct tr_query)) {
ND_PRINT(" [invalid len %u]", len);
return;
GET_IPADDR_STRING(tr->tr_raddr));
if (IN_CLASSD(GET_BE_U_4(tr->tr_raddr)))
ND_PRINT(" with-ttl %u", GET_U_1(tr->tr_rttl));
GET_IPADDR_STRING(tr->tr_raddr));
if (IN_CLASSD(GET_BE_U_4(tr->tr_raddr)))
ND_PRINT(" with-ttl %u", GET_U_1(tr->tr_rttl));
- return;
-trunc:
- nd_print_trunc(ndo);
ND_PRINT(" [invalid number of groups]");
return;
}
ND_PRINT(" [invalid number of groups]");
return;
}
- ND_TCHECK_4(bp + (group + 4));
ND_PRINT(" [gaddr %s", GET_IPADDR_STRING(bp + group + 4));
ND_PRINT(" %s", tok2str(igmpv3report2str, " [v3-report-#%u]",
GET_U_1(bp + group)));
ND_PRINT(" [gaddr %s", GET_IPADDR_STRING(bp + group + 4));
ND_PRINT(" %s", tok2str(igmpv3report2str, " [v3-report-#%u]",
GET_U_1(bp + group)));
/* Print the sources */
ND_PRINT(" {");
for (j=0; j<nsrcs; j++) {
/* Print the sources */
ND_PRINT(" {");
for (j=0; j<nsrcs; j++) {
- ND_TCHECK_4(bp + (group + 8 + (j << 2)));
ND_PRINT(" %s", GET_IPADDR_STRING(bp + group + 8 + (j << 2)));
}
ND_PRINT(" }");
ND_PRINT(" %s", GET_IPADDR_STRING(bp + group + 8 + (j << 2)));
}
ND_PRINT(" }");
- return;
-trunc:
- nd_print_trunc(ndo);
else if (ndo->ndo_vflag > 1) {
ND_PRINT(" {");
for (i=0; i<nsrcs; i++) {
else if (ndo->ndo_vflag > 1) {
ND_PRINT(" {");
for (i=0; i<nsrcs; i++) {
- ND_TCHECK_4(bp + (12 + (i << 2)));
ND_PRINT(" %s", GET_IPADDR_STRING(bp + 12 + (i << 2)));
}
ND_PRINT(" }");
ND_PRINT(" %s", GET_IPADDR_STRING(bp + 12 + (i << 2)));
}
ND_PRINT(" }");
ND_PRINT(", %u source(s)", nsrcs);
}
ND_PRINT("]");
ND_PRINT(", %u source(s)", nsrcs);
}
ND_PRINT("]");
- return;
-trunc:
- nd_print_trunc(ndo);