register u_int length = h->len;
register const struct ip *ip;
- if (caplen < SLIP_HDRLEN) {
+ if (caplen < SLIP_HDRLEN || length < SLIP_HDRLEN) {
ND_PRINT((ndo, "%s", tstr));
return (caplen);
}
case 4:
ip_print(ndo, (u_char *)ip, length);
break;
-#ifdef INET6
case 6:
ip6_print(ndo, (u_char *)ip, length);
break;
-#endif
default:
- printf ("ip v%d", IP_V(ip));
+ ND_PRINT((ndo, "ip v%d", IP_V(ip)));
}
return (SLIP_HDRLEN);