* Can't add v4 networks to a v6 socket, or vice versa.
*/
if (allow[i].af != af) {
- fr_strerror_printf("Address family in entry %zd - 'allow = %pV' "
+ fr_strerror_printf("Address family in entry %zu - 'allow = %pV' "
"does not match 'ipaddr'", i + 1, fr_box_ipaddr(allow[i]));
fail:
talloc_free(trie);
* Can't add v4 networks to a v6 socket, or vice versa.
*/
if (deny[i].af != af) {
- fr_strerror_printf("Address family in entry %zd - 'deny = %pV' "
+ fr_strerror_printf("Address family in entry %zu - 'deny = %pV' "
"does not match 'ipaddr'", i + 1, fr_box_ipaddr(deny[i]));
goto fail;
}
*/
value = fr_trie_lookup_by_key(trie, &deny[i].addr, deny[i].prefix);
if (!value) {
- fr_strerror_printf("The network in entry %zd - 'deny = %pV' is not "
+ fr_strerror_printf("The network in entry %zu - 'deny = %pV' is not "
"contained within a previous 'allow'", i + 1, fr_box_ipaddr(deny[i]));
goto fail;
}
* A "deny" cannot be within a previous "deny".
*/
if (value == FR_BIO_NETWORK_DENY) {
- fr_strerror_printf("The network in entry %zd - 'deny = %pV' is overlaps "
+ fr_strerror_printf("The network in entry %zu - 'deny = %pV' is overlaps "
"with another 'deny' rule", i + 1, fr_box_ipaddr(deny[i]));
goto fail;
}
*/
packet_len = talloc_array_length((uint8_t *) eap_packet);
if (packet_len <= EAP_HEADER_LEN) {
- fr_strerror_printf("Invalid EAP data length %zd <= 4", packet_len);
+ fr_strerror_printf("Invalid EAP data length %zu <= 4", packet_len);
return false;
}
len = ntohs(len);
if ((len <= EAP_HEADER_LEN) || (len > packet_len)) {
- fr_strerror_printf("Invalid EAP length field. Expected value in range %u-%zu, was %u bytes",
+ fr_strerror_printf("Invalid EAP length field. Expected value in range %d-%zu, was %u bytes",
EAP_HEADER_LEN, packet_len, len);
return false;
}
default:
/* Should never enter here */
- REDEBUG("Reply code %d is unknown, rejecting the request", reply->code);
+ REDEBUG("Reply code %u is unknown, rejecting the request", reply->code);
request->reply->code = FR_RADIUS_CODE_ACCESS_REJECT;
reply->code = FR_EAP_CODE_FAILURE;
rcode = RLM_MODULE_REJECT;
break;
}
- RDEBUG2("Sending EAP %s (code %i) ID %d length %i",
+ RDEBUG2("Sending EAP %s (code %d) ID %d length %i",
eap_codes[eap_packet->code], eap_packet->code, reply->id,
eap_packet->length[0] * 256 + eap_packet->length[1]);
if (p[0] == FR_MAC) {
len = p[1] << 2;
if ((p + len) > end) {
- fr_strerror_printf("Malformed AT_MAC: Length (%zu) exceeds buffer (%zu)", len, end - p);
+ fr_strerror_printf("Malformed AT_MAC: Length (%zu) exceeds buffer (%zu)", len, (size_t) (end - p));
return -1;
}
for (i = 0; i < keys->gsm.num_vectors; i++) {
RHEXDUMP_INLINE3(keys->gsm.vector[i].rand, AKA_SIM_VECTOR_GSM_RAND_SIZE,
- "[%i] RAND :", i);
+ "[%u] RAND :", i);
RHEXDUMP_INLINE3(keys->gsm.vector[i].sres, AKA_SIM_VECTOR_GSM_SRES_SIZE,
- "[%i] SRES :", i);
+ "[%u] SRES :", i);
RHEXDUMP_INLINE3(keys->gsm.vector[i].kc, AKA_SIM_VECTOR_GSM_KC_SIZE,
- "[%i] KC :", i);
+ "[%u] KC :", i);
}
}
break;
if ((p + sim_at_len) > end) {
fr_strerror_printf("%s: Malformed nested attribute %d: Length field (%zu bytes) value "
"longer than remaining data in parent (%zu bytes)",
- __FUNCTION__, sim_at, sim_at_len, end - p);
+ __FUNCTION__, sim_at, sim_at_len, (size_t) (end - p));
error:
talloc_free(decr);
res_len /= 8;
if (res_len > (attr_len - 2)) {
- fr_strerror_printf("%s: RES Length field value (%u bits) > attribute value length (%zu bits)",
+ fr_strerror_printf("%s: RES Length field value (%d bits) > attribute value length (%zu bits)",
__FUNCTION__, res_len * 8, (attr_len - 2) * 8);
return -1;
}
if ((res_len < 4) || (res_len > 16)) {
- fr_strerror_printf("%s: RES Length field value must be between 32-128 bits, got %u bits",
+ fr_strerror_printf("%s: RES Length field value must be between 32-128 bits, got %d bits",
__FUNCTION__, (res_len * 8));
return -1;
}
PAIR_VERIFY(vp);
if (vp->da->depth > FR_DICT_MAX_TLV_STACK) {
- fr_strerror_printf("%s: Attribute depth %i exceeds maximum nesting depth %i",
+ fr_strerror_printf("%s: Attribute depth %u exceeds maximum nesting depth %d",
__FUNCTION__, vp->da->depth, FR_DICT_MAX_TLV_STACK);
return PAIR_ENCODE_FATAL_ERROR;
}
u_p += 3;
}
if ((out_p - out) != AKA_SIM_3GPP_PSEUDONYM_LEN) {
- fr_strerror_printf("Base64 output length invalid, expected %i bytes, got %zu bytes",
- AKA_SIM_3GPP_PSEUDONYM_LEN, out_p - out);
+ fr_strerror_printf("Base64 output length invalid, expected %u bytes, got %zu bytes",
+ AKA_SIM_3GPP_PSEUDONYM_LEN, (size_t) (out_p - out));
return -1;
}
* some sort of memory corruption has occurred.
*/
if (unlikely(decr_len > (AKA_SIM_IMSI_MAX_LEN + 1))) {
- fr_strerror_printf("Decrypted data len invalid. Expected %i bytes, got %zu bytes",
+ fr_strerror_printf("Decrypted data len invalid. Expected %u bytes, got %zu bytes",
(AKA_SIM_IMSI_MAX_LEN + 1), decr_len);
goto error;
}
opc_vp = fr_pair_find_by_da(list, NULL, attr_sim_opc);
if (opc_vp) {
if (opc_vp->vp_length != MILENAGE_OPC_SIZE) {
- REDEBUG("&control.%s has incorrect length, expected %u bytes got %zu bytes",
+ REDEBUG("&control.%s has incorrect length, expected %d bytes got %zu bytes",
attr_sim_opc->name, MILENAGE_OPC_SIZE, opc_vp->vp_length);
return -1;
}
op_vp = fr_pair_find_by_da(list, NULL, attr_sim_op);
if (op_vp) {
if (op_vp->vp_length != MILENAGE_OP_SIZE) {
- REDEBUG("&control.%s has incorrect length, expected %u bytes got %zu bytes",
+ REDEBUG("&control.%s has incorrect length, expected %d bytes got %zu bytes",
attr_sim_op->name, MILENAGE_OP_SIZE, op_vp->vp_length);
return -1;
}
break;
default:
- REDEBUG("Unknown/unsupported algorithm %i", version);
+ REDEBUG("Unknown/unsupported algorithm %u", version);
return -1;
}
return -1;
default:
- REDEBUG("Unknown/unsupported algorithm %i", version);
+ REDEBUG("Unknown/unsupported algorithm %u", version);
return -1;
}
fr_value_box_t *vb;
if (id->vb_length != AKA_SIM_3GPP_PSEUDONYM_LEN) {
- REDEBUG2("3gpp pseudonym incorrect length, expected %i bytes, got %zu bytes",
+ REDEBUG2("3gpp pseudonym incorrect length, expected %u bytes, got %zu bytes",
AKA_SIM_3GPP_PSEUDONYM_LEN, id->vb_length);
return XLAT_ACTION_FAIL;
}
if (tag_vb) include_tag = tag_vb->vb_bool;
if (id_len != (AKA_SIM_3GPP_PSEUDONYM_LEN)) {
- REDEBUG2("3gpp pseudonym incorrect length, expected %i bytes, got %zu bytes",
+ REDEBUG2("3gpp pseudonym incorrect length, expected %u bytes, got %zu bytes",
AKA_SIM_3GPP_PSEUDONYM_LEN, id_len);
error:
return XLAT_ACTION_FAIL;
id_p = id;
id_end = id_p + id_len;
} else {
- REDEBUG2("IMSI incorrect length, expected %i bytes, got %zu bytes", AKA_SIM_IMSI_MAX_LEN + 1,
+ REDEBUG2("IMSI incorrect length, expected %u bytes, got %zu bytes", AKA_SIM_IMSI_MAX_LEN + 1,
id_len);
goto error;
if (buf.st_size >= ((output + outsize) - p)) {
close(fd);
- ERROR("%s[%d]: Reference \"${%s}\" file is too large (%zd >= %zd)", cf, lineno, name,
- (size_t) buf.st_size, ((output + outsize) - p));
+ ERROR("%s[%d]: Reference \"${%s}\" file is too large (%zu >= %zu)", cf, lineno, name,
+ (size_t) buf.st_size, (size_t) ((output + outsize) - p));
return NULL;
}
if ((conf_check_gid != (gid_t)-1) && ((egid = getegid()) != conf_check_gid)) {
if (setegid(conf_check_gid) < 0) {
- cf_log_perr(cp, "Failed setting effective group ID (%i) for file check: %s",
- conf_check_gid, fr_syserror(errno));
+ cf_log_perr(cp, "Failed setting effective group ID (%d) for file check: %s",
+ (int) conf_check_gid, fr_syserror(errno));
goto error;
}
}
if ((conf_check_uid != (uid_t)-1) && ((euid = geteuid()) != conf_check_uid)) {
if (seteuid(conf_check_uid) < 0) {
- cf_log_perr(cp, "Failed setting effective user ID (%i) for file check: %s",
- conf_check_uid, fr_syserror(errno));
+ cf_log_perr(cp, "Failed setting effective user ID (%d) for file check: %s",
+ (int) conf_check_uid, fr_syserror(errno));
goto error;
}
}
fd = open(filename, O_RDONLY);
if (conf_check_uid != euid) {
if (seteuid(euid) < 0) {
- cf_log_perr(cp, "Failed restoring effective user ID (%i) after file check: %s",
- euid, fr_syserror(errno));
+ cf_log_perr(cp, "Failed restoring effective user ID (%d) after file check: %s",
+ (int) euid, fr_syserror(errno));
goto error;
}
}
if (conf_check_gid != egid) {
if (setegid(egid) < 0) {
- cf_log_perr(cp, "Failed restoring effective group ID (%i) after file check: %s",
- egid, fr_syserror(errno));
+ cf_log_perr(cp, "Failed restoring effective group ID (%d) after file check: %s",
+ (int) egid, fr_syserror(errno));
goto error;
}
}
p = cp->value;
q = str;
while (*p) {
- int x;
+ unsigned int x;
if (*p != '\\') {
*(q++) = *(p++);
#define FR_INTEGER_COND_CHECK(_name, _var, _cond, _new)\
do {\
if (!(_cond)) {\
- WARN("Ignoring \"" _name " = %i\", forcing to \"" _name " = %i\"", _var, _new);\
+ WARN("Ignoring \"" _name " = %u\", forcing to \"" _name " = %u\"", (unsigned int) (_var), (unsigned int) (_new));\
_var = _new;\
}\
} while (0)
DEBUG(" name1 : %s", cs->name1);
DEBUG(" name2 : %s", cs->name2 ? cs->name2 : "<none>");
DEBUG(" name2_quote : %s", fr_table_str_by_value(fr_token_quotes_table, cs->name2_quote, "<INVALID>"));
- DEBUG(" argc : %u", cs->argc);
+ DEBUG(" argc : %d", cs->argc);
for (i = 0; i < cs->argc; i++) {
char const *quote = fr_table_str_by_value(fr_token_quotes_table, cs->argv_quote[i], "<INVALID>");
{
connection_t *conn = talloc_get_type_abort(uctx, connection_t);
- ERROR("Connection failed for fd (%u): %s", fd, fr_syserror(fd_errno));
+ ERROR("Connection failed for fd (%d): %s", fd, fr_syserror(fd_errno));
connection_state_enter_failed(conn);
}
_connection_writable,
_connection_error,
conn) < 0) {
- PERROR("Failed inserting fd (%u) into event loop %p",
+ PERROR("Failed inserting fd (%d) into event loop %p",
fd, conn->pub.el);
connection_state_enter_failed(conn);
return -1;
*/
static inline CC_HINT(nonnull) void fr_time_tracking_debug(fr_time_tracking_t *tt, FILE *fp)
{
-#define DPRINT_TIME(_x) fprintf(fp, "\t" #_x " = %"PRIu64"\n", fr_time_unwrap(tt->_x))
-#define DPRINT(_x) fprintf(fp, "\t" #_x " = %"PRIu64"\n", fr_time_delta_unwrap(tt->_x))
+#define DPRINT_TIME(_x) fprintf(fp, "\t" #_x " = %"PRId64"\n", fr_time_unwrap(tt->_x))
+#define DPRINT(_x) fprintf(fp, "\t" #_x " = %"PRId64"\n", fr_time_delta_unwrap(tt->_x))
DPRINT_TIME(started);
DPRINT_TIME(ended);
chunk = talloc_array(ssl_talloc_ctx, uint8_t, len);
#ifndef NDEBUG
- talloc_set_name(chunk, "%s:%u", file, line);
+ talloc_set_name(chunk, "%s:%d", file, line);
#endif
return chunk;
}
chunk = talloc_realloc_size(ssl_talloc_ctx, old, len);
#ifndef NDEBUG
- talloc_set_name(chunk, "%s:%u", file, line);
+ talloc_set_name(chunk, "%s:%d", file, line);
#endif
return chunk;
}
DEBUG3("Configured ciphers (by priority)");
while ((cipher = SSL_get_cipher_list(ssl, i))) {
- DEBUG3("[%i] %s", i, cipher);
+ DEBUG3("[%u] %s", i, cipher);
i++; /* Print index starting at zero */
}
}
# endif
} else {
- ROPTIONAL(RDEBUG2, DEBUG2, "Handshake state - %s%s (%i)", role, state, SSL_get_state(ssl));
+ ROPTIONAL(RDEBUG2, DEBUG2, "Handshake state - %s%s (%u)", role, state, SSL_get_state(ssl));
}
return;
}
if (((size_t)tls_session->info.version >= NUM_ELEMENTS(tls_version_str)) ||
!tls_version_str[tls_session->info.version]) {
- snprintf(unknown_version, sizeof(unknown_version), "unknown_tls_version_0x%04x", tls_session->info.version);
+ snprintf(unknown_version, sizeof(unknown_version), "unknown_tls_version_0x%04x",
+ (unsigned int) tls_session->info.version);
version = unknown_version;
} else {
version = tls_version_str[tls_session->info.version];
if (((size_t)tls_session->info.content_type >= NUM_ELEMENTS(tls_content_type_str)) ||
!tls_content_type_str[tls_session->info.content_type]) {
snprintf(unknown_content_type, sizeof(unknown_content_type),
- "unknown_content_type_0x%04x", tls_session->info.content_type);
+ "unknown_content_type_0x%04x", (unsigned int) tls_session->info.content_type);
content_type = unknown_content_type;
} else {
content_type = tls_content_type_str[tls_session->info.content_type];
ret = BIO_write(tls_session->into_ssl, tls_session->dirty_in.data, tls_session->dirty_in.used);
if (ret != (int) tls_session->dirty_in.used) {
record_init(&tls_session->dirty_in);
- REDEBUG("Failed writing %zd bytes to SSL BIO: %d", tls_session->dirty_in.used, ret);
+ REDEBUG("Failed writing %zu bytes to SSL BIO: %d", tls_session->dirty_in.used, ret);
goto error;
}
if (tls_session->dirty_in.used) {
ret = BIO_write(tls_session->into_ssl, tls_session->dirty_in.data, tls_session->dirty_in.used);
if (ret != (int)tls_session->dirty_in.used) {
- REDEBUG("Failed writing %zd bytes to TLS BIO: %d", tls_session->dirty_in.used, ret);
+ REDEBUG("Failed writing %zu bytes to TLS BIO: %d", tls_session->dirty_in.used, ret);
record_init(&tls_session->dirty_in);
goto error;
}
{
int ret;
- RDEBUG3("%s[%u] - Binding SSL * (%p) to request (%p)", file, line, ssl, request);
+ RDEBUG3("%s[%d] - Binding SSL * (%p) to request (%p)", file, line, ssl, request);
#ifndef NDEBUG
{
(void)talloc_get_type_abort(request, request_t);
#endif
- RDEBUG3("%s[%u] - Unbinding SSL * (%p) from request (%p)", file, line, ssl, request);
+ RDEBUG3("%s[%d] - Unbinding SSL * (%p) from request (%p)", file, line, ssl, request);
ret = SSL_set_ex_data(ssl, FR_TLS_EX_INDEX_REQUEST, NULL);
if (unlikely(ret == 0)) {
fr_assert(0);
if (asn1->type == V_ASN1_UTCTIME) {/* two digit year */
if ((end - p) < 2) {
fr_strerror_printf("ASN1 date string too short, expected 2 additional bytes, got %zu bytes",
- end - p);
+ (size_t) (end - p));
return -1;
}
} else if (asn1->type == V_ASN1_GENERALIZEDTIME) {/* four digit year */
if ((end - p) < 4) {
fr_strerror_printf("ASN1 string too short, expected 4 additional bytes, got %zu bytes",
- end - p);
+ (size_t) (end - p));
return -1;
}
if ((end - p) < 4) {
fr_strerror_printf("ASN1 string too short, expected 10 additional bytes, got %zu bytes",
- end - p);
+ (size_t) (end - p));
return -1;
}
packet_type_vp = fr_pair_find_by_da(&request->request_pairs, NULL, gext->attr_packet_type);
if (!packet_type_vp) {
bad_packet_type:
- REDEBUG("No such value '%d' of attribute 'Packet-Type' for server %s",
+ REDEBUG("No such value '%u' of attribute 'Packet-Type' for server %s",
request->packet->code, cf_section_name2(gext->server_cs));
error:
*p_result = RLM_MODULE_FAIL;
}
if (call_env_single(env->rule->flags) && (fr_value_box_list_num_elements(tmpl_expanded) > 1)) {
- RPEDEBUG("%d values found for %s. Only one is allowed",
+ RPEDEBUG("%u values found for %s. Only one is allowed",
fr_value_box_list_num_elements(tmpl_expanded), env->rule->name);
return CALL_ENV_INVALID;
}
if (!op->thread_inst_size) return c;
if (!fr_rb_insert(unlang_instruction_tree, c)) {
- cf_log_err(ci, "Instruction \"%s\" number %i has conflict with previous one.",
+ cf_log_err(ci, "Instruction \"%s\" number %u has conflict with previous one.",
c->debug_name, c->number);
talloc_free(c);
return NULL;
t = &unlang_thread_array[instruction->number];
- fr_log(log, L_DBG, file, line, "count=%" PRIu64 " cpu_time=%" PRIu64 " yielded_time=%" PRIu64 ,
+ fr_log(log, L_DBG, file, line, "count=%" PRIu64 " cpu_time=%" PRId64 " yielded_time=%" PRId64 ,
t->use_count, fr_time_delta_unwrap(t->tracking.running_total), fr_time_delta_unwrap(t->tracking.waiting_total));
if (g->children) {
if (retry->count >= instruction->actions.retry.mrc) {
retry->state = FR_RETRY_MRC;
- REDEBUG("Retries hit max_rtx_count (%d) - returning 'fail'", instruction->actions.retry.mrc);
+ REDEBUG("Retries hit max_rtx_count (%u) - returning 'fail'", instruction->actions.retry.mrc);
fail:
*result = RLM_MODULE_FAIL;
RINDENT();
if (instruction->actions.retry.mrc) {
- RDEBUG("... retrying (%d/%d)", retry->count, instruction->actions.retry.mrc);
+ RDEBUG("... retrying (%u/%u)", retry->count, instruction->actions.retry.mrc);
} else {
RDEBUG("... retrying");
}
break;
}
- DEBUG4("%u event(s) pending%s",
+ DEBUG4("%d event(s) pending%s",
num_events == -1 ? 0 : num_events, num_events == -1 ? " - event loop exiting" : "");
/*
*/
sub_request = fr_heap_pop(&intps->runnable);
if (!sub_request) {
- DEBUG4("No pending requests (%u yielded)", intps->yielded);
+ DEBUG4("No pending requests (%d yielded)", intps->yielded);
continue;
}
*/
if (sub_request == request) rcode = sub_rcode;
- DEBUG3("%u runnable, %u yielded", fr_heap_num_elements(intps->runnable), intps->yielded);
+ DEBUG3("%u runnable, %d yielded", fr_heap_num_elements(intps->runnable), intps->yielded);
}
talloc_free(intps);
state->free_child = free_child;
if (!fr_cond_assert_msg(stack_depth_current(child) == 0,
- "Child stack depth must be 0 (not %u), when subrequest_child_push is called",
+ "Child stack depth must be 0 (not %d), when subrequest_child_push is called",
stack_depth_current(child))) return -1;
/*
}
RIDEBUG3("attr : %u", vp->da->attr);
vendor = fr_dict_vendor_by_da(vp->da);
- if (vendor) RIDEBUG2("vendor : %i (%s)", vendor->pen, vendor->name);
+ if (vendor) RIDEBUG2("vendor : %u (%s)", vendor->pen, vendor->name);
RIDEBUG3("type : %s", fr_type_to_str(vp->vp_type));
switch (vp->vp_type) {
fr_assert(!fr_comparison_op[op]);
if (fr_value_box_list_num_elements(&a->vb_group) > 1) {
- REDEBUG("Expected one value as the first argument, got %d",
+ REDEBUG("Expected one value as the first argument, got %u",
fr_value_box_list_num_elements(&a->vb_group));
return XLAT_ACTION_FAIL;
}
a = fr_value_box_list_head(&a->vb_group);
if (fr_value_box_list_num_elements(&b->vb_group) > 1) {
- REDEBUG("Expected one value as the second argument, got %d",
+ REDEBUG("Expected one value as the second argument, got %u",
fr_value_box_list_num_elements(&b->vb_group));
return XLAT_ACTION_FAIL;
}
(void) fr_sbuff_out(&err, &num, in);
if (err != FR_SBUFF_PARSE_OK) {
invalid_ref:
- fr_strerror_printf("Invalid regex reference. Must be in range 0-%u", REQUEST_MAX_REGEX);
+ fr_strerror_printf("Invalid regex reference. Must be in range 0-%d", REQUEST_MAX_REGEX);
fr_sbuff_marker_release(&m_s);
return -1;
}
*/
list = tmpl_request(node->vpt);
while ((rr = tmpl_request_list_next(list, rr))) {
- INFO_INDENT("ref %d", rr->request);
+ INFO_INDENT("ref %u", rr->request);
}
INFO_INDENT("list %s", tmpl_list_name(tmpl_list(node->vpt), "<INVALID>"));
if (tmpl_attr_tail_num(node->vpt) != NUM_UNSPEC) {
if (!arg->variadic) {
arg++;
if (arg->type == FR_TYPE_NULL) {
- fr_strerror_printf("Too many arguments, expected %zu, got %u", arg - arg_start, argc - 1);
+ fr_strerror_printf("Too many arguments, expected %zu, got %d",
+ (size_t) (arg - arg_start), argc - 1);
goto error;
}
}
do { \
size_t _our_got = (_got); \
TEST_CHECK_(_exp == _our_got, "%s", #_got); \
- TEST_MSG("Expected length : %zu", (size_t)_exp); \
- TEST_MSG("Got length : %zu", (size_t)_our_got); \
+ TEST_MSG("Expected length : %zu", (size_t) (_exp)); \
+ TEST_MSG("Got length : %zu", (size_t) (_our_got)); \
} while(0)
#define TEST_CHECK_SLEN(_got, _exp) \
do { \
ssize_t _our_got = (_got); \
TEST_CHECK_(_exp == _our_got, "%s", #_got); \
- TEST_MSG("Expected length : %zd", (ssize_t)_exp); \
- TEST_MSG("Got length : %zd", (ssize_t)_our_got); \
+ TEST_MSG("Expected length : %zd", (ssize_t) (_exp)); \
+ TEST_MSG("Got length : %zd", (ssize_t) (_our_got)); \
} while(0)
#define TEST_CHECK_SLEN_RETURN(_got, _exp) \
do { \
ssize_t _our_got = (_got); \
TEST_CHECK_(_exp == _our_got, "%s", #_got); \
- TEST_MSG("Expected length : %zd", (ssize_t)_exp); \
- TEST_MSG("Got length : %zd", (ssize_t)_our_got); \
+ TEST_MSG("Expected length : %zd", (ssize_t) (_exp)); \
+ TEST_MSG("Got length : %zd", (ssize_t) (_our_got)); \
if (_exp != _our_got) return; \
} while(0)
do { \
int _our_got = (_got); \
TEST_CHECK_(_exp == _our_got, "%s", #_got); \
- TEST_MSG("Expected ret : %"PRId64, (int64_t)_exp); \
- TEST_MSG("Got ret : %"PRId64, (int64_t)_our_got); \
+ TEST_MSG("Expected ret : %"PRId64, (int64_t) (_exp)); \
+ TEST_MSG("Got ret : %"PRId64, (int64_t) (_our_got)); \
} while(0)
#define TEST_CHECK_STRCMP(_got, _exp) \
*/
static int _atexit_entry_free(fr_atexit_entry_t *e)
{
- ATEXIT_DEBUG("%s - Thread %u freeing %p/%p func=%p, uctx=%p (alloced %s:%u)",
+ ATEXIT_DEBUG("%s - Thread %u freeing %p/%p func=%p, uctx=%p (alloced %s:%d)",
__FUNCTION__, (unsigned int)pthread_self(),
e->list, e, e->func, e->uctx, e->file, e->line);
e->file = file;
e->line = line;
- ATEXIT_DEBUG("%s - Thread %u arming %p/%p func=%p, uctx=%p (alloced %s:%u)",
+ ATEXIT_DEBUG("%s - Thread %u arming %p/%p func=%p, uctx=%p (alloced %s:%d)",
__FUNCTION__, (unsigned int)pthread_self(),
list, e, e->func, e->uctx, e->file, e->line);
if ((e->func != func) || ((e->uctx != uctx) && uctx_scope)) continue;
- ATEXIT_DEBUG("%s - Disarming %p/%p func=%p, uctx=%p (alloced %s:%u)",
+ ATEXIT_DEBUG("%s - Disarming %p/%p func=%p, uctx=%p (alloced %s:%d)",
__FUNCTION__,
fr_atexit_global, e, e->func, e->uctx, e->file, e->line);
if (!fr_atexit_global) return;
while ((e = fr_dlist_pop_head(&fr_atexit_global->head))) {
- ATEXIT_DEBUG("%s - Disarming %p/%p func=%p, uctx=%p (alloced %s:%u)",
+ ATEXIT_DEBUG("%s - Disarming %p/%p func=%p, uctx=%p (alloced %s:%d)",
__FUNCTION__,
fr_atexit_global, e, e->func, e->uctx, e->file, e->line);
* destructors.
*/
while ((e = fr_dlist_next(&fr_atexit_global->head, e))) {
- ATEXIT_DEBUG("%s - Triggering %p/%p func=%p, uctx=%p (alloced %s:%u)",
+ ATEXIT_DEBUG("%s - Triggering %p/%p func=%p, uctx=%p (alloced %s:%d)",
__FUNCTION__,
fr_atexit_global, e, e->func, e->uctx, e->file, e->line);
e = fr_dlist_remove(&fr_atexit_global->head, e);
if (talloc_free(to_free) < 0) {
fr_strerror_printf_push("atexit handler failed %p/%p func=%p, uctx=%p"
- " (alloced %s:%u)",
+ " (alloced %s:%d)",
fr_atexit_global, to_free,
to_free->func, to_free->uctx,
to_free->file, to_free->line);
while ((e = fr_dlist_next(&fr_atexit_global->head, e))) {
if ((e->func != func) || ((e->uctx != uctx) && uctx_scope)) continue;
- ATEXIT_DEBUG("%s - Triggering %p/%p func=%p, uctx=%p (alloced %s:%u)",
+ ATEXIT_DEBUG("%s - Triggering %p/%p func=%p, uctx=%p (alloced %s:%d)",
__FUNCTION__,
fr_atexit_global, e, e->func, e->uctx, e->file, e->line);
e = fr_dlist_remove(&fr_atexit_global->head, e);
if (talloc_free(to_free) < 0) {
fr_strerror_printf_push("atexit handler failed %p/%p func=%p, uctx=%p"
- " (alloced %s:%u)",
+ " (alloced %s:%d)",
fr_atexit_global, to_free,
to_free->func, to_free->uctx,
to_free->file, to_free->line);
while ((ee = fr_dlist_next(&list->head, ee))) {
if ((ee->func != func) || ((ee->uctx != uctx) && uctx_scope)) continue;
- ATEXIT_DEBUG("%s - Thread %u triggering %p/%p func=%p, uctx=%p (alloced %s:%u)",
+ ATEXIT_DEBUG("%s - Thread %u triggering %p/%p func=%p, uctx=%p (alloced %s:%d)",
__FUNCTION__,
(unsigned int)pthread_self(),
list, ee, ee->func, ee->uctx, ee->file, ee->line);
ee = fr_dlist_remove(&list->head, ee);
if (talloc_free(to_free) < 0) {
fr_strerror_printf_push("atexit handler failed %p/%p func=%p, uctx=%p"
- " (alloced %s:%u)",
+ " (alloced %s:%d)",
list, to_free,
to_free->func, to_free->uctx,
to_free->file, to_free->line);
if ((e->func != func) || ((e->uctx != uctx) && uctx_scope)) continue;
- ATEXIT_DEBUG("%s - Thread %u disarming %p/%p func=%p, uctx=%p (alloced %s:%u)",
+ ATEXIT_DEBUG("%s - Thread %u disarming %p/%p func=%p, uctx=%p (alloced %s:%d)",
__FUNCTION__,
(unsigned int)pthread_self(),
fr_atexit_thread_local, e, e->func, e->uctx, e->file, e->line);
if (!fr_atexit_thread_local) return;
while ((e = fr_dlist_pop_head(&fr_atexit_thread_local->head))) {
- ATEXIT_DEBUG("%s - Thread %u disarming %p/%p func=%p, uctx=%p (alloced %s:%u)",
+ ATEXIT_DEBUG("%s - Thread %u disarming %p/%p func=%p, uctx=%p (alloced %s:%d)",
__FUNCTION__,
(unsigned int)pthread_self(),
fr_atexit_thread_local, e, e->func, e->uctx, e->file, e->line);
list = talloc_get_type_abort(e->uctx, fr_atexit_list_t);
ee = NULL;
while ((ee = fr_dlist_next(&list->head, ee))) {
- ATEXIT_DEBUG("%s - Thread %u triggering %p/%p func=%p, uctx=%p (alloced %s:%u)",
+ ATEXIT_DEBUG("%s - Thread %u triggering %p/%p func=%p, uctx=%p (alloced %s:%d)",
__FUNCTION__,
(unsigned int)pthread_self(),
list, ee, ee->func, ee->uctx, ee->file, ee->line);
ee = fr_dlist_remove(&list->head, ee);
if (talloc_free(to_free) < 0) {
fr_strerror_printf_push("atexit handler failed %p/%p func=%p, uctx=%p"
- " (alloced %s:%u)",
+ " (alloced %s:%d)",
list, to_free,
to_free->func, to_free->uctx,
to_free->file, to_free->line
for (p = buffer, j = 0; j < len; j++, p += 3) snprintf(p, end - p, "%02x ", data[i + j]);
- dprintf(fr_fault_log_fd, "%04x: %s\n", (int)i, buffer);
+ dprintf(fr_fault_log_fd, "%04x: %s\n", (unsigned int) i, buffer);
}
}
va_end(ap);
#ifndef NDEBUG
- FR_FAULT_LOG("ASSERT FAILED %s[%u]: %s: %s", file, line, expr, str);
+ FR_FAULT_LOG("ASSERT FAILED %s[%d]: %s: %s", file, line, expr, str);
fr_fault(SIGABRT);
#else
- FR_FAULT_LOG("ASSERT WOULD FAIL %s[%u]: %s: %s", file, line, expr, str);
+ FR_FAULT_LOG("ASSERT WOULD FAIL %s[%d]: %s: %s", file, line, expr, str);
return false;
#endif
}
#ifndef NDEBUG
- FR_FAULT_LOG("ASSERT FAILED %s[%u]: %s", file, line, expr);
+ FR_FAULT_LOG("ASSERT FAILED %s[%d]: %s", file, line, expr);
fr_fault(SIGABRT);
#else
- FR_FAULT_LOG("ASSERT WOULD FAIL %s[%u]: %s", file, line, expr);
+ FR_FAULT_LOG("ASSERT WOULD FAIL %s[%d]: %s", file, line, expr);
return false;
#endif
}
(void)vsnprintf(str, sizeof(str), msg, ap);
va_end(ap);
- FR_FAULT_LOG("FATAL ASSERT %s[%u]: %s: %s", file, line, expr, str);
+ FR_FAULT_LOG("FATAL ASSERT %s[%d]: %s: %s", file, line, expr, str);
} else {
- FR_FAULT_LOG("FATAL ASSERT %s[%u]: %s", file, line, expr);
+ FR_FAULT_LOG("FATAL ASSERT %s[%d]: %s", file, line, expr);
}
#ifdef NDEBUG
char const *error = fr_strerror();
if (error && *error && (status != 0)) {
- FR_FAULT_LOG("%sEXIT(%i) CALLED %s[%u]. Last error was: %s", now ? "_" : "",
+ FR_FAULT_LOG("%sEXIT(%i) CALLED %s[%d]. Last error was: %s", now ? "_" : "",
status, file, line, error);
} else {
- FR_FAULT_LOG("%sEXIT(%i) CALLED %s[%u]", now ? "_" : "", status, file, line);
+ FR_FAULT_LOG("%sEXIT(%i) CALLED %s[%d]", now ? "_" : "", status, file, line);
}
fr_debug_break(false); /* If running under GDB we'll break here */
da = dict_protocol_reference(fixup->da->parent, fixup->ref, true);
if (!da) {
- fr_strerror_printf_push("Failed resolving reference for attribute at %s[%u]",
+ fr_strerror_printf_push("Failed resolving reference for attribute at %s[%d]",
fr_cwd_strip(fixup->da->filename), fixup->da->line);
return -1;
}
fr_dict_attr_t *cloned;
if (src->dict->proto != dst->dict->proto) {
- fr_strerror_printf("Incompatible protocols. Referenced '%s', referencing '%s'. Defined at %s[%u]",
+ fr_strerror_printf("Incompatible protocols. Referenced '%s', referencing '%s'. Defined at %s[%d]",
src->dict->proto->name, dst->dict->proto->name, dst->filename, dst->line);
return -1;
}
src = dict_protocol_reference(fixup->da->parent, fixup->ref, true);
if (!src) {
- fr_strerror_printf_push("Failed resolving reference for attribute at %s[%u]",
+ fr_strerror_printf_push("Failed resolving reference for attribute at %s[%d]",
fr_cwd_strip(fixup->da->filename), fixup->da->line);
return -1;
}
src = dict_protocol_reference(fixup->da->parent, fixup->ref, true);
if (!src) {
- fr_strerror_printf_push("Failed resolving reference for attribute at %s[%u]",
+ fr_strerror_printf_push("Failed resolving reference for attribute at %s[%d]",
fr_cwd_strip(fixup->da->filename), fixup->da->line);
return -1;
}
if (src->dict->proto != fixup->da->dict->proto) {
- fr_strerror_printf("Incompatible protocols. Referenced '%s', referencing '%s'. Defined at %s[%u]",
+ fr_strerror_printf("Incompatible protocols. Referenced '%s', referencing '%s'. Defined at %s[%d]",
src->dict->proto->name, fixup->da->dict->proto->name, fixup->da->filename, fixup->da->line);
return -1;
}
*/
da = fr_dict_attr_by_oid(NULL, fixup->ref_parent, fixup->ref);
if (!da) {
- fr_strerror_printf("Attribute '%s' aliased by '%s' doesn't exist in namespace '%s', at %s[%u]",
+ fr_strerror_printf("Attribute '%s' aliased by '%s' doesn't exist in namespace '%s', at %s[%d]",
fixup->ref, fixup->alias, fixup->ref_parent->name, fixup->filename, fixup->line);
return -1;
}
our_uctx->dict, da->type, &da->flags);
snprintf(our_uctx->prefix, sizeof(our_uctx->prefix),
- "[%02i] 0x%016" PRIxPTR "%*s",
+ "[%02u] 0x%016" PRIxPTR "%*s",
da->depth,
(unsigned long)da,
(da->depth - our_uctx->start_depth) * 4, "");
} dict_nest_t;
DIAG_ON(attributes)
-fr_table_num_sorted_t const dict_nest_table[] = {
+static fr_table_num_sorted_t const dict_nest_table[] = {
{ L("ATTRIBUTE"), NEST_ATTRIBUTE },
{ L("NONE"), NEST_NONE },
{ L("PROTOCOL"), NEST_PROTOCOL },
{ L("ROOT"), NEST_ROOT },
{ L("VENDOR"), NEST_VENDOR }
};
-size_t const dict_nest_table_len = NUM_ELEMENTS(dict_nest_table);
+static size_t const dict_nest_table_len = NUM_ELEMENTS(dict_nest_table);
/** Parser context for dict_from_file
*
int i;
for (i = 0; i <= dctx->stack_depth; i++) {
- FR_FAULT_LOG("[%d]: %s %s (%s): %s[%u]",
+ FR_FAULT_LOG("[%d]: %s %s (%s): %s[%d]",
i,
fr_table_str_by_value(dict_nest_table, dctx->stack[i].nest, "<INVALID>"),
dctx->stack[i].da->name,
}
if (dup_name) {
- fr_strerror_printf("Duplicate attribute name '%s' in namespace '%s'. Originally defined %s[%u]",
+ fr_strerror_printf("Duplicate attribute name '%s' in namespace '%s'. Originally defined %s[%d]",
da->name, da->parent->name, dup_name->filename, dup_name->line);
return 0;
}
- fr_strerror_printf("Duplicate attribute number %u in parent '%s'. Originally defined %s[%u]",
+ fr_strerror_printf("Duplicate attribute number %u in parent '%s'. Originally defined %s[%d]",
da->attr, da->parent->name, dup_num->filename, dup_num->line);
return 0;
}
frame = dict_dctx_find_frame(dctx, NEST_ROOT | NEST_PROTOCOL | NEST_ATTRIBUTE);
if (!fr_cond_assert_msg(frame, "Context stack doesn't have an attribute or dictionary "
- "root to begin searching from %s[%u]", CURRENT_FILENAME(dctx), CURRENT_LINE(dctx)) ||
- !fr_cond_assert_msg(fr_type_is_structural(frame->da->type), "Context attribute is not structural %s[%u]",
+ "root to begin searching from %s[%d]", CURRENT_FILENAME(dctx), CURRENT_LINE(dctx)) ||
+ !fr_cond_assert_msg(fr_type_is_structural(frame->da->type), "Context attribute is not structural %s[%d]",
CURRENT_FILENAME(dctx), CURRENT_LINE(dctx))) {
return -1;
}
*/
if (dict) {
if (type_size && (dict->root->flags.type_size != type_size)) {
- fr_strerror_printf("Conflicting flags for PROTOCOL \"%s\" (current %d versus new %d)",
+ fr_strerror_printf("Conflicting flags for PROTOCOL \"%s\" (current %d versus new %u)",
dict->root->name, dict->root->flags.type_size, type_size);
return -1;
}
dict->in_protocol_by_name = true;
if (!fr_hash_table_insert(dict_gctx->protocol_by_num, dict)) {
- fr_strerror_printf("%s: Duplicate protocol number %i", __FUNCTION__, dict->root->attr);
+ fr_strerror_printf("%s: Duplicate protocol number %u", __FUNCTION__, dict->root->attr);
return -1;
}
dict->in_protocol_by_num = true;
if (a && (strcasecmp(a->name, da->name) == 0)) {
if ((a->attr != da->attr) || (a->type != da->type) || (a->parent != da->parent)) {
fr_strerror_printf("Duplicate attribute name '%s' in namespace '%s'. "
- "Originally defined %s[%u]",
+ "Originally defined %s[%d]",
da->name, parent->name,
a->filename, a->line);
goto error;
exists = fr_dict_attr_by_name(NULL, da->parent, da->name);
if (exists) {
fr_strerror_printf("Duplicate attribute name '%s' in namespace '%s'. "
- "Originally defined %s[%u]", da->name, da->parent->name,
+ "Originally defined %s[%d]", da->name, da->parent->name,
exists->filename, exists->line);
return -1;
}
exists = fr_dict_attr_child_by_num(da->parent, da->attr);
if (exists) {
fr_strerror_printf("Duplicate attribute number %u. "
- "Originally defined by '%s' at %s[%u]",
+ "Originally defined by '%s' at %s[%d]",
da->attr, exists->name, exists->filename, exists->line);
return -1;
}
default:
if (dict_attr_can_have_children(*parent)) break;
- fr_strerror_printf("Attribute %s (%i) is not a TLV, so cannot contain a child attribute. "
+ fr_strerror_printf("Attribute %s (%u) is not a TLV, so cannot contain a child attribute. "
"Error at sub OID \"%s\"", (*parent)->name, (*parent)->attr, oid);
return 0; /* We parsed nothing */
}
child = dict_attr_child_by_num(*parent, num);
if (!child) {
- fr_strerror_printf("Unknown attribute '%i' in OID string \"%s\" for parent %s",
+ fr_strerror_printf("Unknown attribute '%u' in OID string \"%s\" for parent %s",
num, oid, (*parent)->name);
return 0; /* We parsed nothing */
}
vendor = dict_attr_child_by_num(vendor_root, vendor_pen);
if (!vendor) {
- fr_strerror_printf("Vendor %i not defined", vendor_pen);
+ fr_strerror_printf("Vendor %u not defined", vendor_pen);
return NULL;
}
for (dep = fr_rb_iter_init_inorder(&iter, dict->dependents);
dep;
dep = fr_rb_iter_next_inorder(&iter)) {
- fprintf(stderr, "\t<- %s (%u)\n", dep->dependent, dep->count);
+ fprintf(stderr, "\t<- %s (%d)\n", dep->dependent, dep->count);
}
}
#endif
for (dep = fr_rb_iter_init_inorder(&iter, dict->dependents);
dep;
dep = fr_rb_iter_next_inorder(&iter)) {
- fr_strerror_printf_push("%s (%u)", dep->dependent, dep->count);
+ fr_strerror_printf_push("%s (%d)", dep->dependent, dep->count);
}
return -1;
for (dep = fr_rb_iter_init_inorder(&dep_iter, dict->dependents);
dep;
dep = fr_rb_iter_next_inorder(&dep_iter)) {
- FR_FAULT_LOG("\t%s is referenced from %s count (%u)", dict->root->name, dep->dependent, dep->count);
+ FR_FAULT_LOG("\t%s is referenced from %s count (%d)", dict->root->name, dep->dependent, dep->count);
}
}
for (dep = fr_rb_iter_init_inorder(&dep_iter, gctx->internal->dependents);
dep;
dep = fr_rb_iter_next_inorder(&dep_iter)) {
- FR_FAULT_LOG("\t%s is referenced from %s count (%u)", gctx->internal->root->name, dep->dependent, dep->count);
+ FR_FAULT_LOG("\t%s is referenced from %s count (%d)", gctx->internal->root->name, dep->dependent, dep->count);
}
}
}
int i;
fr_dict_attr_t const *da_p;
- if (!da) fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_dict_attr_t pointer was NULL", file, line);
+ if (!da) fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_dict_attr_t pointer was NULL", file, line);
(void) talloc_get_type_abort_const(da, fr_dict_attr_t);
if ((!da->flags.is_root) && (da->depth == 0)) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_dict_attr_t %s vendor: %i, attr %i: "
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_dict_attr_t %s vendor: %u, attr %u: "
"Is not root, but depth is 0",
file, line, da->name, fr_dict_vendor_num_by_da(da), da->attr);
}
if (da->depth > FR_DICT_MAX_TLV_STACK) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_dict_attr_t %s vendor: %i, attr %i: "
- "Indicated depth (%u) greater than TLV stack depth (%u)",
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_dict_attr_t %s vendor: %u, attr %u: "
+ "Indicated depth (%u) greater than TLV stack depth (%d)",
file, line, da->name, fr_dict_vendor_num_by_da(da), da->attr,
da->depth, FR_DICT_MAX_TLV_STACK);
}
for (i = da->depth, da_p = da; (i >= 0) && da; i--, da_p = da_p->parent) {
if (!da_p) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_dict_attr_t %s vendor: %i, attr %i: "
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_dict_attr_t %s vendor: %u, attr %u: "
"Depth indicated there should be a parent, but parent is NULL",
file, line, da->name, fr_dict_vendor_num_by_da(da), da->attr);
}
if (i != (int)da_p->depth) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_dict_attr_t %s vendor: %i, attr %i: "
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_dict_attr_t %s vendor: %u, attr %u: "
"Depth out of sequence, expected %i, got %u",
file, line, da->name, fr_dict_vendor_num_by_da(da), da->attr, i, da_p->depth);
}
}
if ((i + 1) < 0) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_dict_attr_t top of hierarchy was not at depth 0",
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_dict_attr_t top of hierarchy was not at depth 0",
file, line);
}
if (da->parent && (da->parent->type == FR_TYPE_VENDOR) && !fr_dict_attr_has_ext(da, FR_DICT_ATTR_EXT_VENDOR)) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: VSA missing 'vendor' extension", file, line);
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: VSA missing 'vendor' extension", file, line);
}
switch (da->type) {
if (da->type == FR_TYPE_GROUP) break;
fr_assert_msg(fr_dict_attr_has_ext(da, FR_DICT_ATTR_EXT_CHILDREN),
- "CONSISTENCY CHECK FAILED %s[%u]: %s missing 'children' extension",
+ "CONSISTENCY CHECK FAILED %s[%d]: %s missing 'children' extension",
file, line,
fr_type_to_str(da->type));
fr_assert_msg(fr_dict_attr_has_ext(da, FR_DICT_ATTR_EXT_NAMESPACE),
- "CONSISTENCY CHECK FAILED %s[%u]: %s missing 'namespace' extension",
+ "CONSISTENCY CHECK FAILED %s[%d]: %s missing 'namespace' extension",
file, line,
fr_type_to_str(da->type));
#define FORBID_OTHER_FLAGS(_flag, _allowed) \
do { \
if (all_flags & ~shift_ ## _flag & ~(_allowed)) { \
- fr_strerror_printf("The '" STRINGIFY(_flag) "' flag cannot be used with any other flag (%u) %s[%u]", all_flags, da->filename, da->line); \
+ fr_strerror_printf("The '" STRINGIFY(_flag) "' flag cannot be used with any other flag (%u) %s[%d]", all_flags, da->filename, da->line); \
return false; \
} \
} while (0)
} else if (buf != where) {
if (dns_label_compress(buf, buf, where, NULL, where, &data)) {
FR_PROTO_TRACE("Compressed single label %s to %zu bytes",
- value->vb_strvalue, data - where);
+ value->vb_strvalue, (size_t) (data - where));
} else {
FR_PROTO_TRACE("Did not compress single label");
}
*/
if (offset >= (p - packet)) {
fr_strerror_printf("Pointer %04x at offset %04x is an invalid forward reference",
- offset, (int) (p - packet));
+ offset, (unsigned int) (p - packet));
return -(p - packet);
}
*/
if (q >= current) {
fr_strerror_printf("Pointer %04x at offset %04x creates a loop within a label",
- offset, (int) (p - packet));
+ offset, (unsigned int) (p - packet));
return -(p - packet);
}
*/
if (!dns_pointer_valid(lb, offset)) {
fr_strerror_printf("Pointer %04x at offset %04x does not point to a DNS label",
- offset, (int) (p - packet));
+ offset, (unsigned int) (p - packet));
return -(p - packet);
}
*/
if (*q > 63) {
fr_strerror_printf("Pointer %04x at offset %04x does not point to the start of a label",
- offset, (int) (p - packet));
+ offset, (unsigned int) (p - packet));
return -(p - packet);
}
*/
if (!*q) {
fr_strerror_printf("Pointer %04x at offset %04x refers to an invalid field", offset,
- (int) (p - packet));
+ (unsigned int) (p - packet));
return -(p - packet);
}
switch (map->idx_type) {
default:
- fr_assert_fail("Invalid index type %i", map->idx_type);
+ fr_assert_fail("Invalid index type %u", map->idx_type);
return NULL;
case FR_EVENT_FUNC_IDX_FILTER:
*/
if ((filter > (NUM_ELEMENTS(filter_maps) - 1))) {
not_supported:
- fr_strerror_printf("Filter %i not supported", filter);
+ fr_strerror_printf("Filter %u not supported", filter);
goto free;
}
ef->map = &filter_maps[filter];
ef = fr_rb_find(el->fds, &(fr_event_fd_t){ .fd = fd, .filter = filter });
if (unlikely(!ef)) {
- fr_strerror_printf("No events are registered for fd %i, filter %d", fd, filter);
+ fr_strerror_printf("No events are registered for fd %d, filter %u", fd, filter);
return -1;
}
* Events MUST be in the lst (or the insertion list).
*/
if (!fr_cond_assert_msg(ret == 0,
- "Event %p, lst_id %i, allocd %s[%u], was not found in the event lst or "
+ "Event %p, lst_id %u, allocd %s[%d], was not found in the event lst or "
"insertion list when freed: %s", ev, ev->lst_id, err_file, err_line,
fr_strerror())) return -1;
}
* Events MUST be in the lst (or the insertion list).
*/
if (!fr_cond_assert_msg(ret == 0,
- "Event %p, lst_id %i, allocd %s[%u], was not found in the event "
+ "Event %p, lst_id %u, allocd %s[%d], was not found in the event "
"lst or insertion list when freed: %s", ev, ev->lst_id,
err_file, err_line, fr_strerror())) return -1;
}
case CLD_EXITED:
case CLD_KILLED:
case CLD_DUMPED:
- EVENT_DEBUG("%p - PID %ld early exit - code %s (%i), status %i",
+ EVENT_DEBUG("%p - PID %ld early exit - code %s (%d), status %d",
el, (long)pid, fr_table_str_by_value(si_codes, info.si_code, "<UNKOWN>"),
info.si_code, info.si_status);
break;
default:
- fr_strerror_printf("Unexpected code %s (%u) whilst waiting on PID %ld",
+ fr_strerror_printf("Unexpected code %s (%d) whilst waiting on PID %ld",
fr_table_str_by_value(si_codes, info.si_code, "<UNKOWN>"),
info.si_code, (long) pid);
node = fr_rb_iter_next_inorder(&event_iter)) {
fr_event_counter_t *counter = talloc_get_type_abort(node, fr_event_counter_t);
- EVENT_DEBUG(" : %u allocd at %s[%u]",
+ EVENT_DEBUG(" : %u allocd at %s[%d]",
counter->count, counter->file, counter->line);
}
}
ev;
ev = fr_lst_iter_next(el->times, &iter)) {
(void)talloc_get_type_abort(ev, fr_event_timer_t);
- EVENT_DEBUG("%s[%u]: %p time=%" PRId64 " (%c), callback=%p",
+ EVENT_DEBUG("%s[%d]: %p time=%" PRId64 " (%c), callback=%p",
ev->file, ev->line, ev, fr_time_unwrap(ev->when),
fr_time_gt(now, ev->when) ? '<' : '>', ev->callback);
}
* Out of bounds.
*/
if (unlikely((parent == 0) || (parent > h->num_elements))) {
- fr_strerror_printf("Heap parent (%i) out of bounds (0-%i)", parent, h->num_elements);
+ fr_strerror_printf("Heap parent (%u) out of bounds (0-%u)", parent, h->num_elements);
return -1;
}
if (unlikely(data != h->p[parent])) {
- fr_strerror_printf("Invalid heap index. Expected data %p at offset %i, got %p", data,
+ fr_strerror_printf("Invalid heap index. Expected data %p at offset %u, got %p", data,
parent, h->p[parent]);
return -1;
}
TEST_CASE("deletions");
{
- unsigned int entry;
+ int entry;
for (i = 0; i < HEAP_TEST_SIZE / skip; i++) {
entry = i * skip;
/*
* No idea what it is...
*/
- fr_strerror_printf("Invalid address family %i", af);
+ fr_strerror_printf("Invalid address family %d", af);
return -1;
}
#endif
default:
- fr_strerror_printf("Invalid address family %u", a->af);
+ fr_strerror_printf("Invalid address family %d", a->af);
return -2;
}
}
if (line_prefix_fmt) {
fr_log(log, type, file, line, "%s%04x: %s",
- line_prefix, (int)i, buffer);
+ line_prefix, (unsigned int) i, buffer);
} else {
- fr_log(log, type, file, line, "%04x: %s", (int)i, buffer);
+ fr_log(log, type, file, line, "%04x: %s", (unsigned int) i, buffer);
}
}
if (line_prefix_fmt) {
fr_log(log, type, file, line, "%s%04x: %s",
- line_prefix, (int)i, buffer);
+ line_prefix, (unsigned int) i, buffer);
} else {
- fr_log(log, type, file, line, "%04x: %s", (int)i, buffer);
+ fr_log(log, type, file, line, "%04x: %s", (unsigned int) i, buffer);
}
/*
break;
}
- fr_strerror_printf("Failed closing invalid log dst %i", log->dst);
+ fr_strerror_printf("Failed closing invalid log dst %u", log->dst);
return -1;
}
static void lst_test(int skip)
{
fr_lst_t *lst;
- unsigned int i;
+ int i;
lst_thing *values;
- unsigned int left;
+ int left;
int ret;
lst = fr_lst_alloc(NULL, lst_cmp, lst_thing, idx, 0);
/* Add the first INITIAL_CAPACITY values to lst and to hp */
TEST_CASE("partial fill");
- for (unsigned int i = 0; i < INITIAL_CAPACITY; i++) {
+ for (int i = 0; i < INITIAL_CAPACITY; i++) {
TEST_CHECK((ret = fr_lst_insert(lst, &lst_array[i])) >= 0);
TEST_MSG("lst insert failed, iteration %d; returned %i - %s", i, ret, fr_strerror());
TEST_CHECK((ret = fr_heap_insert(&hp, &hp_array[i])) >= 0);
end_pop = fr_time();
TEST_MSG_ALWAYS("\nlst size: %u\n", count);
- TEST_MSG_ALWAYS("alloc: %"PRIu64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_alloc, start_alloc)) / 1000);
- TEST_MSG_ALWAYS("insert: %"PRIu64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_insert, start_insert)) / 1000);
- TEST_MSG_ALWAYS("pop-first: %"PRIu64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_pop_first, start_pop)) / 1000);
- TEST_MSG_ALWAYS("pop: %"PRIu64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_pop, start_pop)) / 1000);
+ TEST_MSG_ALWAYS("alloc: %"PRId64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_alloc, start_alloc)) / 1000);
+ TEST_MSG_ALWAYS("insert: %"PRId64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_insert, start_insert)) / 1000);
+ TEST_MSG_ALWAYS("pop-first: %"PRId64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_pop_first, start_pop)) / 1000);
+ TEST_MSG_ALWAYS("pop: %"PRId64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_pop, start_pop)) / 1000);
talloc_free(lst);
}
end_pop = fr_time();
TEST_MSG_ALWAYS("\nheap size: %u\n", count);
- TEST_MSG_ALWAYS("alloc: %"PRIu64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_alloc, start_alloc)) / 1000);
- TEST_MSG_ALWAYS("insert: %"PRIu64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_insert, start_insert)) / 1000);
- TEST_MSG_ALWAYS("pop-first: %"PRIu64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_pop_first, start_pop)) / 1000);
- TEST_MSG_ALWAYS("pop: %"PRIu64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_pop, start_pop)) / 1000);
+ TEST_MSG_ALWAYS("alloc: %"PRId64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_alloc, start_alloc)) / 1000);
+ TEST_MSG_ALWAYS("insert: %"PRId64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_insert, start_insert)) / 1000);
+ TEST_MSG_ALWAYS("pop-first: %"PRId64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_pop_first, start_pop)) / 1000);
+ TEST_MSG_ALWAYS("pop: %"PRId64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_pop, start_pop)) / 1000);
talloc_free(hp);
}
end_pop = fr_time();
TEST_MSG_ALWAYS("\narray size: %u\n", count);
- TEST_MSG_ALWAYS("alloc: %"PRIu64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_alloc, start_alloc)) / 1000);
- TEST_MSG_ALWAYS("insert: %"PRIu64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_insert, start_insert)) / 1000);
- TEST_MSG_ALWAYS("pop-first: %"PRIu64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_pop_first, start_pop)) / 1000);
- TEST_MSG_ALWAYS("pop: %"PRIu64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_pop, start_pop)) / 1000);
+ TEST_MSG_ALWAYS("alloc: %"PRId64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_alloc, start_alloc)) / 1000);
+ TEST_MSG_ALWAYS("insert: %"PRId64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_insert, start_insert)) / 1000);
+ TEST_MSG_ALWAYS("pop-first: %"PRId64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_pop_first, start_pop)) / 1000);
+ TEST_MSG_ALWAYS("pop: %"PRId64" μs\n", fr_time_delta_unwrap(fr_time_sub(end_pop, start_pop)) / 1000);
talloc_free(array);
}
TEST_CASE("deletions");
{
- unsigned int entry;
+ int entry;
for (i = 0; i < MINMAX_HEAP_TEST_SIZE / skip; i++) {
entry = i * skip;
prev = NULL;
while ((thing = fr_minmax_heap_min_pop(hp))) {
TEST_CHECK(thing->data >= data);
- TEST_MSG("Expected data >= %i, got %i", data, thing->data);
+ TEST_MSG("Expected data >= %u, got %u", data, thing->data);
if (thing->data >= data) data = thing->data;
TEST_CHECK(thing != prev);
prev = thing;
prev = NULL;
while ((thing = fr_minmax_heap_max_pop(hp))) {
TEST_CHECK(thing->data <= data);
- TEST_MSG("Expected data >= %i, got %i", data, thing->data);
+ TEST_MSG("Expected data >= %u, got %u", data, thing->data);
if (thing->data <= data) data = thing->data;
TEST_CHECK(thing != prev);
prev = thing;
end_pop = fr_time();
TEST_MSG_ALWAYS("\nminmax heap size: %u\n", count);
- TEST_MSG_ALWAYS("alloc: %"PRIu64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_alloc, start_alloc)));
- TEST_MSG_ALWAYS("insert: %"PRIu64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_insert, start_insert)));
- TEST_MSG_ALWAYS("pop-first: %"PRIu64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_pop_first, start_pop)));
- TEST_MSG_ALWAYS("pop: %"PRIu64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_pop, start_pop)));
+ TEST_MSG_ALWAYS("alloc: %"PRId64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_alloc, start_alloc)));
+ TEST_MSG_ALWAYS("insert: %"PRId64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_insert, start_insert)));
+ TEST_MSG_ALWAYS("pop-first: %"PRId64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_pop_first, start_pop)));
+ TEST_MSG_ALWAYS("pop: %"PRId64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_pop, start_pop)));
talloc_free(minmax);
}
end_pop = fr_time();
TEST_MSG_ALWAYS("\nheap size: %u\n", count);
- TEST_MSG_ALWAYS("alloc: %"PRIu64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_alloc, start_alloc)));
- TEST_MSG_ALWAYS("insert: %"PRIu64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_insert, start_insert)));
- TEST_MSG_ALWAYS("pop-first: %"PRIu64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_pop_first, start_pop)));
- TEST_MSG_ALWAYS("pop: %"PRIu64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_pop, start_pop)));
+ TEST_MSG_ALWAYS("alloc: %"PRId64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_alloc, start_alloc)));
+ TEST_MSG_ALWAYS("insert: %"PRId64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_insert, start_insert)));
+ TEST_MSG_ALWAYS("pop-first: %"PRId64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_pop_first, start_pop)));
+ TEST_MSG_ALWAYS("pop: %"PRId64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_pop, start_pop)));
talloc_free(hp);
}
end_pop = fr_time();
TEST_MSG_ALWAYS("\narray size: %u\n", count);
- TEST_MSG_ALWAYS("alloc: %"PRIu64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_alloc, start_alloc)));
- TEST_MSG_ALWAYS("insert: %"PRIu64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_insert, start_insert)));
- TEST_MSG_ALWAYS("pop-first: %"PRIu64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_pop_first, start_pop)));
- TEST_MSG_ALWAYS("pop: %"PRIu64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_pop, start_pop)));
+ TEST_MSG_ALWAYS("alloc: %"PRId64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_alloc, start_alloc)));
+ TEST_MSG_ALWAYS("insert: %"PRId64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_insert, start_insert)));
+ TEST_MSG_ALWAYS("pop-first: %"PRId64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_pop_first, start_pop)));
+ TEST_MSG_ALWAYS("pop: %"PRId64" μs\n", fr_time_delta_to_usec(fr_time_sub(end_pop, start_pop)));
talloc_free(array);
}
end = fr_time();
TEST_MSG_ALWAYS("\ncycle size: %d\n", MINMAX_HEAP_CYCLE_SIZE);
- TEST_MSG_ALWAYS("insert: %"PRIu64" μs\n", fr_time_delta_to_usec(fr_time_sub(start_remove, start_insert)));
- TEST_MSG_ALWAYS("extract: %"PRIu64" μs\n", fr_time_delta_to_usec(fr_time_sub(start_swap, start_remove)));
- TEST_MSG_ALWAYS("swap: %"PRIu64" μs\n", fr_time_delta_to_usec(fr_time_sub(end, start_swap)));
+ TEST_MSG_ALWAYS("insert: %"PRId64" μs\n", fr_time_delta_to_usec(fr_time_sub(start_remove, start_insert)));
+ TEST_MSG_ALWAYS("extract: %"PRId64" μs\n", fr_time_delta_to_usec(fr_time_sub(start_swap, start_remove)));
+ TEST_MSG_ALWAYS("swap: %"PRId64" μs\n", fr_time_delta_to_usec(fr_time_sub(end, start_swap)));
talloc_free(hp);
free(array);
slen = regex_compile(NULL, &preg, a->vp_strvalue, talloc_array_length(a->vp_strvalue) - 1,
NULL, false, true);
if (slen <= 0) {
- fr_strerror_printf_push("Error at offset %zu compiling regex for %s", -slen,
+ fr_strerror_printf_push("Error at offset %zd compiling regex for %s", -slen,
a->da->name);
return -1;
}
(void) talloc_get_type_abort_const(vp, fr_pair_t);
if (!vp->da) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_pair_t da pointer was NULL", file, line);
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_pair_t da pointer was NULL", file, line);
}
fr_dict_attr_verify(file, line, vp->da);
if (list) {
fr_fatal_assert_msg(fr_pair_order_list_parent(vp) == &list->order,
- "CONSISTENCY CHECK FAILED %s[%u]: pair does not have the correct parentage "
+ "CONSISTENCY CHECK FAILED %s[%d]: pair does not have the correct parentage "
"at \"%s\"",
file, line, vp->da->name);
}
if (vp->data.enumv) fr_dict_attr_verify(file, line, vp->data.enumv);
if (parent && !fr_dict_attr_can_contain(parent->da, vp->da)) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_pair_t \"%s\" should be parented by %s, but is parented by %s",
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_pair_t \"%s\" should be parented by %s, but is parented by %s",
file, line, vp->da->name, vp->da->parent->name, parent->da->name);
}
fr_pair_t *parent = fr_pair_parent(vp);
if (parent && (parent->vp_type != FR_TYPE_GROUP) && (parent->da == vp->da)) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_pair_t \"%s\" structural (non-group) type contains itself",
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_pair_t \"%s\" structural (non-group) type contains itself",
file, line, vp->da->name);
}
if (!vp->vp_octets) break; /* We might be in the middle of initialisation */
if (!talloc_get_type(vp->vp_ptr, uint8_t)) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_pair_t \"%s\" data buffer type should be "
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_pair_t \"%s\" data buffer type should be "
"uint8_t but is %s", file, line, vp->da->name, talloc_get_name(vp->vp_ptr));
}
len = talloc_array_length(vp->vp_octets);
if (vp->vp_length > len) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_pair_t \"%s\" length %zu is greater than "
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_pair_t \"%s\" length %zu is greater than "
"uint8_t data buffer length %zu", file, line, vp->da->name, vp->vp_length, len);
}
parent = talloc_parent(vp->vp_ptr);
if (parent != vp) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_pair_t \"%s\" char buffer is not "
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_pair_t \"%s\" char buffer is not "
"parented by fr_pair_t %p, instead parented by %p (%s)",
file, line, vp->da->name,
vp, parent, parent ? talloc_get_name(parent) : "NULL");
if (!vp->vp_octets) break; /* We might be in the middle of initialisation */
if (!talloc_get_type(vp->vp_ptr, char)) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_pair_t \"%s\" data buffer type should be "
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_pair_t \"%s\" data buffer type should be "
"char but is %s", file, line, vp->da->name, talloc_get_name(vp->vp_ptr));
}
len = (talloc_array_length(vp->vp_strvalue) - 1);
if (vp->vp_length > len) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_pair_t \"%s\" length %zu is greater than "
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_pair_t \"%s\" length %zu is greater than "
"char buffer length %zu", file, line, vp->da->name, vp->vp_length, len);
}
if (vp->vp_strvalue[vp->vp_length] != '\0') {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_pair_t \"%s\" char buffer not \\0 "
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_pair_t \"%s\" char buffer not \\0 "
"terminated", file, line, vp->da->name);
}
parent = talloc_parent(vp->vp_ptr);
if (parent != vp) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_pair_t \"%s\" char buffer is not "
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_pair_t \"%s\" char buffer is not "
"parented by fr_pair_t %p, instead parented by %p (%s)",
file, line, vp->da->name,
vp, parent, parent ? talloc_get_name(parent) : "NULL");
case FR_TYPE_IPV4_ADDR:
if (vp->vp_ip.af != AF_INET) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_pair_t \"%s\" address family is not "
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_pair_t \"%s\" address family is not "
"set correctly for IPv4 address. Expected %i got %i",
file, line, vp->da->name,
AF_INET, vp->vp_ip.af);
}
if (vp->vp_ip.prefix != 32) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_pair_t \"%s\" address prefix "
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_pair_t \"%s\" address prefix "
"set correctly for IPv4 address. Expected %i got %i",
file, line, vp->da->name,
32, vp->vp_ip.prefix);
case FR_TYPE_IPV6_ADDR:
if (vp->vp_ip.af != AF_INET6) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_pair_t \"%s\" address family is not "
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_pair_t \"%s\" address family is not "
"set correctly for IPv6 address. Expected %i got %i",
file, line, vp->da->name,
AF_INET6, vp->vp_ip.af);
}
if (vp->vp_ip.prefix != 128) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_pair_t \"%s\" address prefix "
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_pair_t \"%s\" address prefix "
"set correctly for IPv6 address. Expected %i got %i",
file, line, vp->da->name,
128, vp->vp_ip.prefix);
TALLOC_CTX *parent = talloc_parent(child);
fr_fatal_assert_msg(parent == vp,
- "CONSISTENCY CHECK FAILED %s[%u]: fr_pair_t \"%s\" should be parented "
+ "CONSISTENCY CHECK FAILED %s[%d]: fr_pair_t \"%s\" should be parented "
"by fr_pair_t \"%s\". Expected talloc parent %p (%s) got %p (%s)",
file, line,
child->da->name, vp->da->name,
* Check if the child can be in the parent.
*/
fr_fatal_assert_msg(fr_dict_attr_can_contain(vp->da, child->da),
- "CONSISTENCY CHECK FAILED %s[%u]: fr_pair_t \"%s\" should be parented "
+ "CONSISTENCY CHECK FAILED %s[%d]: fr_pair_t \"%s\" should be parented "
"by fr_pair_t \"%s\", but it is instead parented by \"%s\"",
file, line,
child->da->name, child->da->parent->name, vp->da->name);
da = vp->da;
if (da != vp->da) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_pair_t "
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_pair_t "
"dictionary pointer %p \"%s\" (%s) "
"and global dictionary pointer %p \"%s\" (%s) differ",
file, line, vp->da, vp->da->name,
!((vp->da->type == FR_TYPE_COMBO_IP_PREFIX) && ((vp->vp_type == FR_TYPE_IPV4_PREFIX) || (vp->vp_type == FR_TYPE_IPV6_PREFIX)))) {
char data_type_int[10], da_type_int[10];
- snprintf(data_type_int, sizeof(data_type_int), "%i", vp->vp_type);
- snprintf(da_type_int, sizeof(da_type_int), "%i", vp->vp_type);
+ snprintf(data_type_int, sizeof(data_type_int), "%u", vp->vp_type);
+ snprintf(da_type_int, sizeof(da_type_int), "%u", vp->vp_type);
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: fr_pair_t attribute %p \"%s\" "
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: fr_pair_t attribute %p \"%s\" "
"data type (%s) does not match da type (%s)",
file, line, vp->da, vp->da->name,
fr_table_str_by_value(fr_type_table, vp->vp_type, data_type_int),
*/
fast = fr_pair_list_next(list, fast);
fr_fatal_assert_msg(fast != slow,
- "CONSISTENCY CHECK FAILED %s[%u]: Looping list found. Fast pointer hit "
+ "CONSISTENCY CHECK FAILED %s[%d]: Looping list found. Fast pointer hit "
"slow pointer at \"%s\"",
file, line, slow->da->name);
fr_log_talloc_report(expected);
if (parent) fr_log_talloc_report(parent);
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: Expected fr_pair_t \"%s\" to be parented "
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: Expected fr_pair_t \"%s\" to be parented "
"by %p (%s), instead parented by %p (%s)\n",
file, line, slow->da->name,
expected, talloc_get_name(expected),
TEST_CHECK(fr_pair_list_num_elements(&test_vps) == len);
fr_pair_list_free(&test_vps);
}
- TEST_MSG_ALWAYS("repetitions=%d", reps);
- TEST_MSG_ALWAYS("perc_rep=%d", perc);
- TEST_MSG_ALWAYS("list_length=%d", len);
+ TEST_MSG_ALWAYS("repetitions=%u", reps);
+ TEST_MSG_ALWAYS("perc_rep=%u", perc);
+ TEST_MSG_ALWAYS("list_length=%u", len);
TEST_MSG_ALWAYS("used=%"PRId64, fr_time_delta_unwrap(used));
TEST_MSG_ALWAYS("per_sec=%0.0lf", (reps * len)/(fr_time_delta_unwrap(used) / (double)NSEC));
}
}
}
fr_pair_list_free(&test_vps);
- TEST_MSG_ALWAYS("repetitions=%d", reps);
- TEST_MSG_ALWAYS("perc_rep=%d", perc);
- TEST_MSG_ALWAYS("list_length=%d", len);
+ TEST_MSG_ALWAYS("repetitions=%u", reps);
+ TEST_MSG_ALWAYS("perc_rep=%u", perc);
+ TEST_MSG_ALWAYS("list_length=%u", len);
TEST_MSG_ALWAYS("used=%"PRId64, fr_time_delta_unwrap(used));
TEST_MSG_ALWAYS("per_sec=%0.0lf", (reps * len)/(fr_time_delta_unwrap(used) / (double)NSEC));
}
}
}
fr_pair_list_free(&test_vps);
- TEST_MSG_ALWAYS("repetitions=%d", reps);
- TEST_MSG_ALWAYS("perc_rep=%d", perc);
- TEST_MSG_ALWAYS("list_length=%d", len);
+ TEST_MSG_ALWAYS("repetitions=%u", reps);
+ TEST_MSG_ALWAYS("perc_rep=%u", perc);
+ TEST_MSG_ALWAYS("list_length=%u", len);
TEST_MSG_ALWAYS("used=%"PRId64, fr_time_delta_unwrap(used));
TEST_MSG_ALWAYS("per_sec=%0.0lf", (reps * len)/(fr_time_delta_unwrap(used) / (double)NSEC));
}
used = fr_time_delta_add(used, fr_time_sub(end, start));
}
fr_pair_list_free(&test_vps);
- TEST_MSG_ALWAYS("repetitions=%d", reps);
- TEST_MSG_ALWAYS("perc_rep=%d", perc);
- TEST_MSG_ALWAYS("list_length=%d", len);
+ TEST_MSG_ALWAYS("repetitions=%u", reps);
+ TEST_MSG_ALWAYS("perc_rep=%u", perc);
+ TEST_MSG_ALWAYS("list_length=%u", len);
TEST_MSG_ALWAYS("used=%"PRId64, fr_time_delta_unwrap(used));
TEST_MSG_ALWAYS("per_sec=%0.0lf", (reps * len)/(fr_time_delta_unwrap(used) / (double)NSEC));
}
PAIR_VERIFY(vp);
TEST_CHECK(vp && vp->da->attr == FR_TEST_ATTR_STRING);
- TEST_MSG("Expected attr(%d) == vp->da->attr(%d)", attr, vp->da->attr);
+ TEST_MSG("Expected attr(%u) == vp->da->attr(%u)", attr, vp->da->attr);
talloc_free(vp);
}
fr_pcap_t *this;
if (!fr_cond_assert(type >= PCAP_INTERFACE_IN && type <= PCAP_INTERFACE_IN_OUT)) {
- fr_strerror_printf("Invalid PCAP type: %d", type);
+ fr_strerror_printf("Invalid PCAP type: %u", type);
return NULL;
}
case PCAP_INVALID:
default:
(void)fr_cond_assert(0);
- fr_strerror_printf("Bad handle type (%i)", pcap->type);
+ fr_strerror_printf("Bad handle type (%u)", pcap->type);
return -1;
}
if (unlikely(offset >= UINT16_MAX)) {
fr_strerror_printf("Inline fr_rb_node_t offset too large. "
- "Expected <= %u, got %zd", UINT16_MAX, offset);
+ "Expected <= %zu, got %zd", (size_t) UINT16_MAX, offset);
return -1;
}
fr_strerror_printf("Failed waiting on semaphore bound to \"%s\" - %s. Semaphore "
"owned by %s:%s PID %u%s", file, fr_syserror(semop_err),
- uid_str, gid_str, sem_pid, dead ? " (dead)" : "");
+ uid_str, gid_str, (unsigned int) sem_pid, dead ? " (dead)" : "");
talloc_free(uid_str);
talloc_free(gid_str);
if (unlikely(!expected_str)) {
simple_error:
fr_strerror_printf("Semaphore on \"%s\" ID 0x%x - %s is incorrect",
- file, proj_id, thing);
+ file, (unsigned int) proj_id, thing);
return false;
}
goto simple_error;
}
fr_strerror_printf("Semaphore on \"%s\" ID 0x%x - %s is incorrect. Expected \"%s\", got \"%s\"",
- file, proj_id, thing, expected_str, got_str);
+ file, (unsigned int) proj_id, thing, expected_str, got_str);
talloc_free(expected_str);
talloc_free(got_str);
if (unlikely(!expected_str)) {
simple_error:
fr_strerror_printf("Semaphore on \"%s\" ID 0x%x - %s is incorrect",
- file, proj_id, thing);
+ file, (unsigned int) proj_id, thing);
return false;
}
goto simple_error;
}
fr_strerror_printf("Semaphore on \"%s\" ID 0x%x - %s is incorrect. Expected \"%s\", got \"%s\"",
- file, proj_id, thing, expected_str, got_str);
+ file, (unsigned int) proj_id, thing, expected_str, got_str);
talloc_free(expected_str);
talloc_free(got_str);
sem_key = ftok(file, proj_id);
if (sem_key < 0) {
fr_strerror_printf("Failed associating semaphore with \"%s\" ID 0x%x: %s",
- file, proj_id, fr_syserror(errno));
+ file, (unsigned int) proj_id, fr_syserror(errno));
return -1;
}
if (errno != ENOENT) { /* Semaphore existed but we ran into an error */
fr_strerror_printf("Failed getting semaphore on \"%s\" ID 0x%x: %s",
- file, proj_id, fr_syserror(errno));
+ file, (unsigned int) proj_id, fr_syserror(errno));
return -2;
}
}
fr_strerror_printf("Failed creating semaphore on \"%s\" ID 0x%x: %s",
- file, proj_id, fr_syserror(errno));
+ file, (unsigned int) proj_id, fr_syserror(errno));
return -3;
}
if (semctl(sem_id, 0, IPC_SET, &info) < 0) {
fr_strerror_printf("Failed setting permissions for semaphore on \"%s\" ID 0x%x: %s",
- file, proj_id, fr_syserror(errno));
+ file, (unsigned int) proj_id, fr_syserror(errno));
fr_sem_close(sem_id, file);
return -3;
}
ret = semctl(sem_id, 0, IPC_STAT, &info);
if (ret < 0) {
fr_strerror_printf("Failed getting semaphore permissions on \"%s\" ID 0x%x: %s",
- file, proj_id, fr_syserror(errno));
+ file, (unsigned int) proj_id, fr_syserror(errno));
return -2;
}
if (info.sem_perm.mode & S_IWOTH) {
fr_strerror_printf("Semaphore on \"%s\" ID 0x%x is world writable (insecure)",
- file, proj_id);
+ file, (unsigned int) proj_id);
return -2;
}
start = fr_time();
for (i = 0; i < 100000; i++) {
- fr_strerror_printf("I am a test %u string %u %s", i, i, "benchmark");
+ fr_strerror_printf("I am a test %d string %d %s", i, i, "benchmark");
fr_strerror_clear(); /* Clear */
}
stop = fr_time();
if (calc_len > (size_t) (end - p)) {
FR_PROTO_TRACE("Length header (%zu) is larger than remaining data (%zu)",
- claimed_len + field_len, (end - p));
+ claimed_len + field_len, (size_t) (end - p));
goto unknown;
}
* of the input is suspect.
*/
if (child_length > (size_t) (end - p)) {
- FR_PROTO_TRACE("fr_struct_from_network - child length %zd overflows buffer", child_length);
+ FR_PROTO_TRACE("fr_struct_from_network - child length %zu overflows buffer", child_length);
goto unknown;
}
child_length = end - p;
} else if ((size_t) (end - p) < child_length) {
- FR_PROTO_TRACE("fr_struct_from_network - child length %zd underflows buffer", child_length);
+ FR_PROTO_TRACE("fr_struct_from_network - child length %zu underflows buffer", child_length);
goto unknown;
}
fr_assert(struct_vp != NULL);
fr_pair_append(out, struct_vp);
- FR_PROTO_TRACE("used %zd bytes", data_len);
+ FR_PROTO_TRACE("used %zu bytes", data_len);
return p - data;
}
if (!fr_type_is_fixed_size(dst_type)) if (!fr_cond_assert(false)) return -1;
if (src->vb_length > network_max_size(dst_type)) {
- fr_strerror_printf("Invalid cast from %s to %s. Source length %zd is greater than "
- "destination type size %zd",
+ fr_strerror_printf("Invalid cast from %s to %s. Source length %zu is greater than "
+ "destination type size %zu",
fr_type_to_str(src->type),
fr_type_to_str(dst_type),
src->vb_length,
fr_value_box_t tmp;
if (src->vb_length < network_min_size(dst_type)) {
- fr_strerror_printf("Invalid cast from %s to %s. Source is length %zd is smaller than "
- "destination type size %zd",
+ fr_strerror_printf("Invalid cast from %s to %s. Source is length %zu is smaller than "
+ "destination type size %zu",
fr_type_to_str(src->type),
fr_type_to_str(dst_type),
src->vb_length,
}
if (src->vb_length > network_max_size(dst_type)) {
- fr_strerror_printf("Invalid cast from %s to %s. Source length %zd is greater than "
- "destination type size %zd",
+ fr_strerror_printf("Invalid cast from %s to %s. Source length %zu is greater than "
+ "destination type size %zu",
fr_type_to_str(src->type),
fr_type_to_str(dst_type),
src->vb_length,
#endif
switch (vb->type) {
case FR_TYPE_STRING:
- fr_fatal_assert_msg(vb->vb_strvalue, "CONSISTENCY CHECK FAILED %s[%i]: fr_value_box_t strvalue field "
+ fr_fatal_assert_msg(vb->vb_strvalue, "CONSISTENCY CHECK FAILED %s[%d]: fr_value_box_t strvalue field "
"was NULL", file, line);
fr_fatal_assert_msg(vb->vb_strvalue[vb->vb_length] == '\0',
"CONSISTENCY CHECK FAILED %s[%i]: fr_value_box_t strvalue field "
/* We always \0 terminate to be safe, even though most things should use the len field */
if (len <= vb->vb_length) {
- fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: Expected fr_value_box_t->vb_strvalue talloc buffer "
+ fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%d]: Expected fr_value_box_t->vb_strvalue talloc buffer "
"len >= %zu, got %zu",
file, line, vb->vb_length + 1, len);
}
break;
case FR_TYPE_OCTETS:
- fr_fatal_assert_msg(vb->vb_octets, "CONSISTENCY CHECK FAILED %s[%i]: fr_value_box_t octets field "
+ fr_fatal_assert_msg(vb->vb_octets, "CONSISTENCY CHECK FAILED %s[%d]: fr_value_box_t octets field "
"was NULL", file, line);
break;
case FR_TYPE_VOID:
- fr_fatal_assert_msg(vb->vb_void, "CONSISTENCY CHECK FAILED %s[%i]: fr_value_box_t ptr field "
+ fr_fatal_assert_msg(vb->vb_void, "CONSISTENCY CHECK FAILED %s[%d]: fr_value_box_t ptr field "
"was NULL", file, line);
break;
}
finish:
- FR_PROTO_TRACE("decoding value complete, adding new pair and returning %zu byte(s)", p - data);
+ FR_PROTO_TRACE("decoding value complete, adding new pair and returning %zu byte(s)", (size_t) (p - data));
fr_pair_append(out, vp);
return p - data;
/*
* The actual amount of data we decoded, including the various headers.
*/
- FR_PROTO_TRACE("decoding option complete, %zu decoded, returning %zu byte(s)", slen, (size_t) (next - data));
+ FR_PROTO_TRACE("decoding option complete, %zd decoded, returning %zu byte(s)", slen, (size_t) (next - data));
return next - data;
}
slen = decode_option(ctx, out, fr_dict_root(dict_dhcpv4), data, data[1] + 2, decode_ctx);
if (slen < 0) return slen;
- FR_PROTO_TRACE("decoding option complete, %zu decoded, returning %u byte(s)", slen, data[1] + 2);
+ FR_PROTO_TRACE("decoding option complete, %zd decoded, returning %u byte(s)", slen, (unsigned int) data[1] + 2);
return data[1] + 2;
}
*/
len = (p - data) + UDP_HDR_SIZE; /* length value */
if ((size_t) len > header->caplen) {
- fr_strerror_printf("Payload (%zu) smaller than required for layers 2+3+4", len);
+ fr_strerror_printf("Payload (%zd) smaller than required for layers 2+3+4", len);
return NULL;
}
uint8_t const *rr, uint8_t const *end,
fr_dns_ctx_t *packet_ctx, uint8_t const *counter)
{
- int i, count;
+ unsigned int i, count;
uint8_t const *p = rr;
/*
for (i = 0; (i < count) && (p < end); i++) {
ssize_t slen;
- FR_PROTO_HEX_DUMP(p, end - p, "fr_dns_decode - %s %d/%d", attr->name, i, count);
+ FR_PROTO_HEX_DUMP(p, end - p, "fr_dns_decode - %s %u/%u", attr->name, i, count);
slen = fr_struct_from_network(ctx, out, attr, p, end - p,
packet_ctx, decode_value_trampoline, decode_tlv_trampoline);
if (data_len < 4) {
char buffer[INET6_ADDRSTRLEN];
- FR_DEBUG_STRERROR_PRINTF("Expected at least 4 bytes of header data, got %zu bytes", data_len);
+ 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)));
*/
if (packet_len < RADIUS_HEADER_LENGTH) {
FR_DEBUG_STRERROR_PRINTF("Expected at least " STRINGIFY(RADIUS_HEADER_LENGTH) " bytes of packet "
- "data, got %zu bytes", packet_len);
+ "data, got %zd bytes", packet_len);
goto invalid;
}
*/
if (packet_len > MAX_PACKET_LEN) {
FR_DEBUG_STRERROR_PRINTF("Length field value too large, expected maximum of "
- STRINGIFY(MAX_PACKET_LEN) " bytes, got %zu bytes", packet_len);
+ STRINGIFY(MAX_PACKET_LEN) " bytes, got %zd bytes", packet_len);
goto invalid;
}
* to catch uninitialised fields.
*/
if (!fr_cond_assert(secret_len <= UINT16_MAX)) {
- fr_strerror_printf("Secret is too long. Expected <= %u, got %zu", UINT16_MAX, secret_len);
+ fr_strerror_printf("Secret is too long. Expected <= %u, got %zu",
+ (unsigned int) UINT16_MAX, secret_len);
return -1;
}
*/
if ((max_attributes > 0) &&
(num_attributes > max_attributes)) {
- FR_DEBUG_STRERROR_PRINTF("Possible DoS attack - too many attributes in request (received %d, max %d are allowed).",
+ FR_DEBUG_STRERROR_PRINTF("Possible DoS attack - too many attributes in request (received %u, max %u are allowed).",
num_attributes, max_attributes);
failure = DECODE_FAIL_TOO_MANY_ATTRIBUTES;
goto finish;
uint8_t message_authenticator[RADIUS_AUTH_VECTOR_LENGTH];
if (packet_len < RADIUS_HEADER_LENGTH) {
- fr_strerror_printf("invalid packet length %zd", packet_len);
+ fr_strerror_printf("invalid packet length %zu", packet_len);
return -1;
}
FR_PROTO_HEX_DUMP(data, attr_len, "%s", __FUNCTION__ );
- FR_PROTO_TRACE("Parent %s len %zu ... %zu", parent->name, attr_len, packet_ctx->end - data);
+ FR_PROTO_TRACE("Parent %s len %zu ... %zu", parent->name, attr_len, (size_t) (packet_ctx->end - data));
data_len = attr_len;
* Decrypt the attribute.
*/
if (encrypt) {
- FR_PROTO_TRACE("Decrypting type %u", encrypt);
+ FR_PROTO_TRACE("Decrypting type %d", encrypt);
/*
* Encrypted attributes can only exist for the
* old-style format. Extended attributes CANNOT
PAIR_VERIFY(vp);
if (vp->da->depth > FR_DICT_MAX_TLV_STACK) {
- fr_strerror_printf("%s: Attribute depth %i exceeds maximum nesting depth %i",
+ fr_strerror_printf("%s: Attribute depth %u exceeds maximum nesting depth %i",
__FUNCTION__, vp->da->depth, FR_DICT_MAX_TLV_STACK);
return PAIR_ENCODE_FATAL_ERROR;
}
if (!((pkt->hdr.type == FR_TAC_PLUS_AUTHEN) ||
(pkt->hdr.type == FR_TAC_PLUS_AUTHOR) ||
(pkt->hdr.type == FR_TAC_PLUS_ACCT))) {
- fr_strerror_printf("Unknown packet type %u", pkt->hdr.type);
+ fr_strerror_printf("Unknown packet type %d", pkt->hdr.type);
return -1;
}
/*
* It has to be at least 12 bytes long.
*/
- PRINT(" major %u", (p[0] & 0xf0) >> 4);
- PRINT(" minor %u", (p[0] & 0x0f));
+ PRINT(" major %d", (p[0] & 0xf0) >> 4);
+ PRINT(" minor %d", (p[0] & 0x0f));
PRINT(" type %02x", p[1]);
PRINT(" seq_no %02x", p[2]);
if (pkt->authen_cont.flags == FR_TAC_PLUS_CONTINUE_FLAG_ABORT) return FR_PACKET_TYPE_VALUE_AUTHENTICATION_CONTINUE_ABORT;
- fr_strerror_printf("Invalid value %u for authentication continue flag", pkt->authen_cont.flags);
+ fr_strerror_printf("Invalid value %d for authentication continue flag", pkt->authen_cont.flags);
return -1;
}
break;
}
- fr_strerror_printf("Invalid value %u for authentication reply status", pkt->authen_reply.status);
+ fr_strerror_printf("Invalid value %d for authentication reply status", pkt->authen_reply.status);
return -1;
case FR_TAC_PLUS_AUTHOR:
break;
}
- fr_strerror_printf("Invalid value %u for authorization reply status", pkt->author_reply.status);
+ fr_strerror_printf("Invalid value %d for authorization reply status", pkt->author_reply.status);
return -1;
case FR_TAC_PLUS_ACCT:
break;
}
- fr_strerror_printf("Invalid value %u for accounting reply status", pkt->acct_reply.status);
+ fr_strerror_printf("Invalid value %d for accounting reply status", pkt->acct_reply.status);
return -1;
default:
#define PACKET_HEADER_CHECK(_msg, _hdr) do { \
p = buffer + FR_HEADER_LENGTH; \
if (sizeof(_hdr) > (size_t) (end - p)) { \
- fr_strerror_printf("Header for %s is too small (%zu < %zu)", _msg, end - (uint8_t const *) pkt, p - (uint8_t const *) pkt); \
+ fr_strerror_printf("Header for %s is too small (%zu < %zu)", _msg, (size_t) (end - (uint8_t const *) pkt), (size_t) (p - (uint8_t const *) pkt)); \
goto fail; \
} \
body = p + sizeof(_hdr); \
#define ARG_COUNT_CHECK(_msg, _hdr) do { \
fr_assert(p == (uint8_t const *) &(_hdr)); \
if (data_len > (size_t) (end - p)) { \
- fr_strerror_printf("Argument count %u overflows the remaining data (%zu) in the %s packet", _hdr.arg_cnt, end - p, _msg); \
+ fr_strerror_printf("Argument count %u overflows the remaining data (%zu) in the %s packet", _hdr.arg_cnt, (size_t) (end - p), _msg); \
goto fail; \
} \
argv = body; \
attrs = buffer + FR_HEADER_LENGTH + data_len; \
body += _hdr.arg_cnt; \
p = attrs; \
- for (int i = 0; i < _hdr.arg_cnt; i++) { \
+ for (unsigned int i = 0; i < _hdr.arg_cnt; i++) { \
if (_hdr.arg_len[i] > (size_t) (end - p)) { \
fr_strerror_printf("Argument %u length %u overflows packet", i, _hdr.arg_len[i]); \
goto fail; \
if (field_len > (end - p)) {
fr_strerror_printf("'%s' length %u overflows the remaining data (%zu) in the packet",
- da->name, field_len, end - p);
+ da->name, field_len, (size_t) (end - p));
return -1;
}
if (!((pkt->hdr.type == FR_TAC_PLUS_AUTHEN) ||
(pkt->hdr.type == FR_TAC_PLUS_AUTHOR) ||
(pkt->hdr.type == FR_TAC_PLUS_ACCT))) {
- fr_strerror_printf("Unknown packet type %u", pkt->hdr.type);
+ fr_strerror_printf("Unknown packet type %d", pkt->hdr.type);
return -1;
}
}
break;
default:
- fr_strerror_printf("decode: Unsupported packet type %u", pkt->hdr.type);
+ fr_strerror_printf("decode: Unsupported packet type %d", pkt->hdr.type);
goto fail;
}
return -1;
default:
- fr_strerror_printf("encode: unknown packet type %u", packet->hdr.type);
+ fr_strerror_printf("encode: unknown packet type %d", packet->hdr.type);
return -1;
}
*/
void fr_vmps_print_hex(FILE *fp, uint8_t const *packet, size_t packet_len)
{
- int length;
+ uint32_t length;
uint8_t const *attr, *end;
uint32_t id;