ltalk_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{
- return (llap_print(ndo, p, h->caplen));
+ u_int hdrlen;
+
+ hdrlen = llap_print(ndo, p, h->caplen);
+ if (hdrlen == 0) {
+ /* Cut short by the snapshot length. */
+ return (h->caplen);
+ }
+ return (hdrlen);
}
/*
u_short snet;
u_int hdrlen;
+ if (!ND_TTEST2(*bp, sizeof(*lp))) {
+ ND_PRINT((ndo, " [|llap]"));
+ return (0); /* cut short by the snapshot length */
+ }
if (length < sizeof(*lp)) {
ND_PRINT((ndo, " [|llap %u]", length));
return (length);
switch (lp->type) {
case lapShortDDP:
+ if (!ND_TTEST2(*bp, ddpSSize)) {
+ ND_PRINT((ndo, " [|sddp]"));
+ return (0); /* cut short by the snapshot length */
+ }
if (length < ddpSSize) {
ND_PRINT((ndo, " [|sddp %u]", length));
return (length);
break;
case lapDDP:
+ if (!ND_TTEST2(*bp, ddpSize)) {
+ ND_PRINT((ndo, " [|ddp]"));
+ return (0); /* cut short by the snapshot length */
+ }
if (length < ddpSize) {
ND_PRINT((ndo, " [|ddp %u]", length));
return (length);
if(!ndo->ndo_eflag)
ND_PRINT((ndo, "AT "));
+ if (!ND_TTEST2(*bp, ddpSize)) {
+ ND_PRINT((ndo, " [|ddp]"));
+ return;
+ }
if (length < ddpSize) {
ND_PRINT((ndo, " [|ddp %u]", length));
return;