Skip to content

Commit 259e783

Browse files
authored
Merge pull request #51 from CESNET/unirec_trap_invalid_params
Unirec output: fixed unknown parameter error on startup
2 parents e5cfcdf + f552aa7 commit 259e783

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

extra_plugins/output/unirec/src/configuration.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,9 +480,10 @@ cfg_parse_tcp(ipx_ctx_t *ctx, fds_xml_ctx_t *root, struct conf_params *cfg, enum
480480
// Prepare the TRAP interface specification
481481
char *res = NULL;
482482
const char *trap_ifc = (type == SPEC_TCP) ? "t" : "T";
483-
if (cfg_str_append(&res, "%s:%" PRIu16 ":%" PRIu64, trap_ifc, port, max_conn) != IPX_OK
483+
if (cfg_str_append(&res, "%s:%" PRIu16, trap_ifc, port) != IPX_OK
484484
|| (type == SPEC_TCP_TLS
485-
&& cfg_str_append(&res, ":%s:%s:%s", file_key, file_cert, file_ca) != IPX_OK)) {
485+
&& cfg_str_append(&res, ":%s:%s:%s", file_key, file_cert, file_ca) != IPX_OK)
486+
|| (cfg_str_append(&res, ":max_clients=%" PRIu64, max_conn) != IPX_OK)) {
486487
IPX_CTX_ERROR(ctx, "Unable to allocate memory (%s:%d)", __FILE__, __LINE__);
487488
free(file_ca); free(file_cert); free(file_key);
488489
free(res);
@@ -544,7 +545,7 @@ cfg_parse_unix(ipx_ctx_t *ctx, fds_xml_ctx_t *root, struct conf_params *cfg)
544545

545546
// Prepare the TRAP interface specification
546547
char *res = NULL;
547-
if (cfg_str_append(&res, "u:%s:%" PRIu64, name, max_conn) != IPX_OK) {
548+
if (cfg_str_append(&res, "u:%s:max_clients=%" PRIu64, name, max_conn) != IPX_OK) {
548549
IPX_CTX_ERROR(ctx, "Unable to allocate memory (%s:%d)", __FILE__, __LINE__);
549550
free(name);
550551
return IPX_ERR_NOMEM;

0 commit comments

Comments
 (0)