Skip to content

Commit

Permalink
Merge pull request #51 from CESNET/unirec_trap_invalid_params
Browse files Browse the repository at this point in the history
Unirec output: fixed unknown parameter error on startup
  • Loading branch information
Lukas955 authored Oct 18, 2021
2 parents e5cfcdf + f552aa7 commit 259e783
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions extra_plugins/output/unirec/src/configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,10 @@ cfg_parse_tcp(ipx_ctx_t *ctx, fds_xml_ctx_t *root, struct conf_params *cfg, enum
// Prepare the TRAP interface specification
char *res = NULL;
const char *trap_ifc = (type == SPEC_TCP) ? "t" : "T";
if (cfg_str_append(&res, "%s:%" PRIu16 ":%" PRIu64, trap_ifc, port, max_conn) != IPX_OK
if (cfg_str_append(&res, "%s:%" PRIu16, trap_ifc, port) != IPX_OK
|| (type == SPEC_TCP_TLS
&& cfg_str_append(&res, ":%s:%s:%s", file_key, file_cert, file_ca) != IPX_OK)) {
&& cfg_str_append(&res, ":%s:%s:%s", file_key, file_cert, file_ca) != IPX_OK)
|| (cfg_str_append(&res, ":max_clients=%" PRIu64, max_conn) != IPX_OK)) {
IPX_CTX_ERROR(ctx, "Unable to allocate memory (%s:%d)", __FILE__, __LINE__);
free(file_ca); free(file_cert); free(file_key);
free(res);
Expand Down Expand Up @@ -544,7 +545,7 @@ cfg_parse_unix(ipx_ctx_t *ctx, fds_xml_ctx_t *root, struct conf_params *cfg)

// Prepare the TRAP interface specification
char *res = NULL;
if (cfg_str_append(&res, "u:%s:%" PRIu64, name, max_conn) != IPX_OK) {
if (cfg_str_append(&res, "u:%s:max_clients=%" PRIu64, name, max_conn) != IPX_OK) {
IPX_CTX_ERROR(ctx, "Unable to allocate memory (%s:%d)", __FILE__, __LINE__);
free(name);
return IPX_ERR_NOMEM;
Expand Down

0 comments on commit 259e783

Please sign in to comment.