/*
* Some messages get printed out only in debugging mode.
*/
-#define FR_DEBUG_STRERROR_PRINTF if (fr_debug_lvl) fr_strerror_printf_push
+#define FR_DEBUG_STRERROR_PRINTF if (fr_debug_lvl) fr_strerror_printf
+#define FR_DEBUG_STRERROR_PRINTF_PUSH if (fr_debug_lvl) fr_strerror_printf_push
fr_table_num_sorted_t const fr_radius_require_ma_table[] = {
{ L("auto"), FR_RADIUS_REQUIRE_MA_AUTO },
FR_DEBUG_STRERROR_PRINTF("Expected at least 4 bytes of header data, got %zd bytes", data_len);
invalid:
- FR_DEBUG_STRERROR_PRINTF("Invalid data from %s",
- inet_ntop(src_ipaddr->af, &src_ipaddr->addr, buffer, sizeof(buffer)));
+ FR_DEBUG_STRERROR_PRINTF_PUSH("Invalid data from %s",
+ inet_ntop(src_ipaddr->af, &src_ipaddr->addr, buffer, sizeof(buffer)));
(void) udp_recv_discard(sockfd);
return 0;
* "The minimum length is 20 ..."
*/
if (packet_len < RADIUS_HEADER_LENGTH) {
- FR_DEBUG_STRERROR_PRINTF("packet is too short (received %zu < minimum 20)",
+ FR_DEBUG_STRERROR_PRINTF("Packet is too short (received %zu < minimum 20)",
packet_len);
failure = DECODE_FAIL_MIN_LENGTH_PACKET;
goto finish;
*/
if ((packet[0] == 0) ||
(packet[0] >= FR_RADIUS_CODE_MAX)) {
- FR_DEBUG_STRERROR_PRINTF("unknown packet code %d", packet[0]);
+ FR_DEBUG_STRERROR_PRINTF("Unknown packet code %d", packet[0]);
failure = DECODE_FAIL_UNKNOWN_PACKET_CODE;
goto finish;
}
* "The minimum length is 20 ..."
*/
if (totallen < RADIUS_HEADER_LENGTH) {
- FR_DEBUG_STRERROR_PRINTF("length in header is too small (length %zu < minimum 20)",
+ FR_DEBUG_STRERROR_PRINTF("Length in header is too small (length %zu < minimum 20)",
totallen);
failure = DECODE_FAIL_MIN_LENGTH_FIELD;
goto finish;
* i.e. No response to the NAS.
*/
if (totallen > packet_len) {
- FR_DEBUG_STRERROR_PRINTF("packet is truncated (received %zu < packet header length of %zu)",
+ FR_DEBUG_STRERROR_PRINTF("Packet is truncated (received %zu < packet header length of %zu)",
packet_len, totallen);
failure = DECODE_FAIL_MIN_LENGTH_MISMATCH;
goto finish;
* attribute header.
*/
if ((end - attr) < 2) {
- FR_DEBUG_STRERROR_PRINTF("attribute header overflows the packet");
+ FR_DEBUG_STRERROR_PRINTF("Attribute header overflows the packet");
failure = DECODE_FAIL_HEADER_OVERFLOW;
goto finish;
}
* Attribute number zero is NOT defined.
*/
if (attr[0] == 0) {
- FR_DEBUG_STRERROR_PRINTF("invalid attribute 0 at offset %zd", attr - packet);
+ FR_DEBUG_STRERROR_PRINTF("Invalid attribute 0 at offset %zd", attr - packet);
failure = DECODE_FAIL_INVALID_ATTRIBUTE;
goto finish;
}
* fields. Anything shorter is an invalid attribute.
*/
if (attr[1] < 2) {
- FR_DEBUG_STRERROR_PRINTF("attribute %u is too short at offset %zd",
+ FR_DEBUG_STRERROR_PRINTF("Attribute %u is too short at offset %zd",
attr[0], attr - packet);
failure = DECODE_FAIL_ATTRIBUTE_TOO_SHORT;
goto finish;
* attribute, it's a bad packet.
*/
if ((attr + attr[1]) > end) {
- FR_DEBUG_STRERROR_PRINTF("attribute %u data overflows the packet starting at offset %zd",
- attr[0], attr - packet);
+ FR_DEBUG_STRERROR_PRINTF("Attribute %u data overflows the packet starting at offset %zd",
+ attr[0], attr - packet);
failure = DECODE_FAIL_ATTRIBUTE_OVERFLOW;
goto finish;
}
* If not, we complain, and throw the packet away.
*/
if (attr != end) {
- FR_DEBUG_STRERROR_PRINTF("attributes do NOT exactly fill the packet");
+ FR_DEBUG_STRERROR_PRINTF("Attributes do NOT exactly fill the packet");
failure = DECODE_FAIL_ATTRIBUTE_UNDERFLOW;
goto finish;
}
* Message-Authenticator attributes.
*/
if (require_message_authenticator && !seen_ma) {
- FR_DEBUG_STRERROR_PRINTF("we require Message-Authenticator attribute, but it is not in the packet");
+ FR_DEBUG_STRERROR_PRINTF("We require Message-Authenticator attribute, but it is not in the packet");
failure = DECODE_FAIL_MA_MISSING;
goto finish;
}