const u_char *ep;
u_int prot;
+ ndo->ndo_protocol = "icmp6";
dp = (const struct icmp6_hdr *)bp;
ip = (const struct ip6_hdr *)bp2;
oip = (const struct ip6_hdr *)(dp + 1);
/* 'ep' points to the end of available data. */
ep = ndo->ndo_snapend;
+ if (length == 0) {
+ ND_PRINT("ICMP6, length 0");
+ ND_PRINT("%s", istr);
+ return;
+ }
if (ndo->ndo_vflag && !fragmented) {
uint16_t sum, udp_sum;
p = (const struct nd_router_advert *)dp;
ND_TCHECK_4(p->nd_ra_retransmit);
ND_PRINT("\n\thop limit %u, Flags [%s]"
- ", pref %s, router lifetime %us, reachable time %us, retrans time %us",
+ ", pref %s, router lifetime %us, reachable time %ums, retrans timer %ums",
EXTRACT_U_1(p->nd_ra_curhoplimit),
bittok2str(icmp6_opt_ra_flag_values,"none",EXTRACT_U_1(p->nd_ra_flags_reserved)),
get_rtpref(EXTRACT_U_1(p->nd_ra_flags_reserved)),
size_t l;
u_int i;
-#define ECHECK(var) if ((const u_char *)&(var) > ep - sizeof(var)) return
-
cp = bp;
/* 'ep' points to the end of available data. */
ep = ndo->ndo_snapend;
while (cp < ep) {
op = (const struct nd_opt_hdr *)cp;
- ECHECK(op->nd_opt_len);
+ ND_TCHECK_1(op->nd_opt_len);
if (resid <= 0)
return;
opt_type = EXTRACT_U_1(op->nd_opt_type);
while (domp < cp + (opt_len << 3) && EXTRACT_U_1(domp) != '\0')
{
ND_PRINT(" ");
- if ((domp = ns_nprint (ndo, domp, bp)) == NULL)
+ if ((domp = ns_nprint(ndo, domp, bp)) == NULL)
goto trunc;
}
break;
trunc:
ND_PRINT("[ndp opt]");
return;
-#undef ECHECK
}
static void
break;
}
while (i-- && cp < ep) {
- safeputchar(ndo, EXTRACT_U_1(cp));
+ fn_print_char(ndo, EXTRACT_U_1(cp));
cp++;
}
if (cp + 1 < ep && EXTRACT_U_1(cp))
cp++;
ND_PRINT(", \"");
while (cp < ep) {
- safeputchar(ndo, EXTRACT_U_1(cp));
+ fn_print_char(ndo, EXTRACT_U_1(cp));
cp++;
}
ND_PRINT("\"");
cp++;
ND_PRINT(", \"");
while (cp < ep) {
- safeputchar(ndo, EXTRACT_U_1(cp));
+ fn_print_char(ndo, EXTRACT_U_1(cp));
cp++;
}
ND_PRINT("\"");
trunc:
ND_PRINT("[|icmp6]");
}
-
-/*
- * Local Variables:
- * c-style: whitesmith
- * c-basic-offset: 8
- * End:
- */