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);
}
+ if (!ND_TTEST2(*bp, sizeof(*lp))) {
+ ND_PRINT((ndo, " [|llap]"));
+ return (0); /* cut short by the snapshot length */
+ }
lp = (const struct LAP *)bp;
bp += sizeof(*lp);
length -= sizeof(*lp);
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);
}
+ if (!ND_TTEST2(*bp, ddpSSize)) {
+ ND_PRINT((ndo, " [|sddp]"));
+ return (0); /* cut short by the snapshot length */
+ }
sdp = (const struct atShortDDP *)bp;
ND_PRINT((ndo, "%s.%s",
ataddr_string(ndo, 0, lp->src), ddpskt_string(ndo, sdp->srcSkt)));
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 (!ND_TTEST2(*bp, ddpSize)) {
+ ND_PRINT((ndo, " [|ddp]"));
+ return (0); /* cut short by the snapshot length */
+ }
dp = (const struct atDDP *)bp;
snet = EXTRACT_16BITS(&dp->srcNet);
ND_PRINT((ndo, "%s.%s", ataddr_string(ndo, snet, dp->srcNode),
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;
}
+ if (!ND_TTEST2(*bp, ddpSize)) {
+ ND_PRINT((ndo, " [|ddp]"));
+ return;
+ }
dp = (const struct atDDP *)bp;
snet = EXTRACT_16BITS(&dp->srcNet);
ND_PRINT((ndo, "%s.%s", ataddr_string(ndo, snet, dp->srcNode),