uint8_t *data; //!< Packet data (body).
size_t data_len; //!< Length of packet data.
VALUE_PAIR *vps; //!< Result of decoding the packet into VALUE_PAIRs.
- ssize_t offset;
uint32_t rounds; //!< for State[0]
if (fr_radius_packet_verify(request->packet, NULL,
request->client->secret) < 0) {
+ if (request->reply) request->reply->id = -1;
return -1;
}
* authenticator.
*/
case 0:
- if (request->packet->code == PW_CODE_ACCESS_REQUEST) {
- if (request->reply->offset == -2) {
+ switch (request->packet->code) {
+ case PW_CODE_ACCESS_REQUEST:
+ if (request->reply->id == -1) {
INC_AUTH(total_bad_authenticators);
} else {
INC_AUTH(total_packets_dropped);
}
- } else if (request->packet->code == PW_CODE_ACCOUNTING_REQUEST) {
- if (request->reply->offset == -2) {
+ break;
+
+
+#ifdef WITH_ACCOUNTING
+ case PW_CODE_ACCOUNTING_REQUEST:
+ if (request->reply->id == -1) {
INC_ACCT(total_bad_authenticators);
} else {
INC_ACCT(total_packets_dropped);
}
+ break;
+#endif
+
+#ifdef WITH_COA
+ case PW_CODE_COA_REQUEST:
+ if (request->reply->id == -1) {
+ INC_COA(total_bad_authenticators);
+ } else {
+ INC_COA(total_packets_dropped);
+ }
+ break;
+
+ case PW_CODE_DISCONNECT_REQUEST:
+ if (request->reply->id == -1) {
+ INC_DSC(total_bad_authenticators);
+ } else {
+ INC_DSC(total_packets_dropped);
+ }
+ break;
+#endif
+
+ default:
+ break;
}
break;
* Load up the configuration values for the user
*/
ptr = hdr->data;
- packet->offset = 0;
/*
* Loop over the reply attributes for the packet.
* length and initial value.
*/
if (!vp->da->vendor && (vp->da->attr == PW_MESSAGE_AUTHENTICATOR)) {
- /*
- * Cache the offset to the
- * Message-Authenticator
- */
- packet->offset = total_length;
last_len = 16;
} else {
last_len = vp->vp_length;