followed by a sequence of TLVs. TLVs of known types are also checked to meet
minimum length constraints defined for each. Return 0 for no errors. */
static int
-babel_packet_examin(const unsigned char *packet, int packetlen)
+babel_packet_examin(const unsigned char *packet, int packetlen, int *blength)
{
int i = 0, bodylen;
const unsigned char *message;
}
i += len + 2;
}
+
+ *blength = bodylen;
return 0;
}
return;
}
- if (babel_packet_examin (packet, packetlen)) {
+ if (babel_packet_examin (packet, packetlen, &bodylen)) {
flog_err(EC_BABEL_PACKET,
"Received malformed packet on %s from %s.",
ifp->name, format_address(from));
return;
}
- DO_NTOHS(bodylen, packet + 2);
-
i = 0;
while(i < bodylen) {
message = packet + 4 + i;