From 01376c3135c63448bb47d4c00e81fccebbb3c679 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Tue, 14 Apr 2026 19:54:24 +0900 Subject: [PATCH 1/2] out_syslog: Address not supported combination of proto and TLS Signed-off-by: Hiroshi Hatake --- plugins/out_syslog/syslog.c | 3 ++- plugins/out_syslog/syslog_conf.c | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/out_syslog/syslog.c b/plugins/out_syslog/syslog.c index 0b7c56a4e08..b191fe778b9 100644 --- a/plugins/out_syslog/syslog.c +++ b/plugins/out_syslog/syslog.c @@ -1047,7 +1047,8 @@ static struct flb_config_map config_map[] = { FLB_CONFIG_MAP_STR, "mode", "udp", 0, FLB_TRUE, offsetof(struct flb_syslog, mode), "Set the desired transport type, the available options are tcp and udp. If you need to " - "use a TLS secure channel, choose 'tcp' mode here and enable the 'tls' option separately." + "use a TLS secure channel, choose 'tcp' mode here and enable the 'tls' option separately. " + "DTLS over udp is not supported by this plugin." }, { diff --git a/plugins/out_syslog/syslog_conf.c b/plugins/out_syslog/syslog_conf.c index 266e4636ce4..5523c1f0dca 100644 --- a/plugins/out_syslog/syslog_conf.c +++ b/plugins/out_syslog/syslog_conf.c @@ -109,6 +109,14 @@ struct flb_syslog *flb_syslog_config_create(struct flb_output_instance *ins, } } + if (ctx->parsed_mode == FLB_SYSLOG_UDP && ins->use_tls == FLB_TRUE) { + flb_plg_error(ctx->ins, + "invalid configuration: mode=udp with tls=on is unsupported " + "(DTLS is not implemented)"); + flb_syslog_config_destroy(ctx); + return NULL; + } + /* syslog_format */ tmp = flb_output_get_property("syslog_format", ins); if (tmp) { From 31df2fea6a71d199e588c5312ebdb424ec842b3a Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Tue, 14 Apr 2026 19:55:00 +0900 Subject: [PATCH 2/2] tests: out_syslog: Add a test case of not supported combination Signed-off-by: Hiroshi Hatake --- tests/runtime/out_syslog.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/tests/runtime/out_syslog.c b/tests/runtime/out_syslog.c index aa9edab33c7..6bea4ec7b62 100644 --- a/tests/runtime/out_syslog.c +++ b/tests/runtime/out_syslog.c @@ -1608,6 +1608,32 @@ void flb_test_malformed_longer_sd_id_rfc5424() test_ctx_destroy(ctx); } +void flb_test_udp_mode_rejects_tls() +{ + struct test_ctx *ctx; + int ret; + + ctx = test_ctx_create(); + if (!TEST_CHECK(ctx != NULL)) { + TEST_MSG("test_ctx_create failed"); + exit(EXIT_FAILURE); + } + + ret = flb_output_set(ctx->flb, ctx->o_ffd, + "match", "*", + "mode", "udp", + "tls", "on", + NULL); + TEST_CHECK(ret == 0); + + ret = flb_start(ctx->flb); + if (!TEST_CHECK(ret != 0)) { + TEST_MSG("expected startup failure for mode=udp with tls=on"); + } + + test_ctx_destroy(ctx); +} + TEST_LIST = { /* rfc3164 */ /* procid_key, msgid_key, sd_key are not supported */ @@ -1639,6 +1665,6 @@ TEST_LIST = { {"format_msgid_preset_rfc5424", flb_test_msgid_preset_rfc5424}, {"allow_longer_sd_id_rfc5424", flb_test_allow_longer_sd_id_rfc5424}, {"malformed_longer_sd_id_rfc5424", flb_test_malformed_longer_sd_id_rfc5424}, + {"udp_mode_rejects_tls", flb_test_udp_mode_rejects_tls}, {NULL, NULL} }; -