BUG/MEDIUM: log: fix config parse error logging on stdout/stderr or any raw fd
The regression was introduced by commit previous commit 94aab06:
MEDIUM: log: support tcp or stream addresses on log lines.
This previous patch tries to retrieve the used protocol parsing
the address using the str2sa_range function but forgets that
the raw file descriptor adresses don't specify a protocol
and str2sa_range probes an error.
This patch re-work the str2sa_range function to stop
probing error if an authorized RAW_FD address is parsed
whereas the caller request also a protocol.
It also modify the code of parse_logsrv to switch on stream
logservers only if a protocol was detected.
diff --git a/src/log.c b/src/log.c
index e202462..2b4b838 100644
--- a/src/log.c
+++ b/src/log.c
@@ -1051,7 +1051,7 @@
set_host_port(&logsrv->addr, SYSLOG_PORT);
}
- if (proto->ctrl_type == SOCK_STREAM) {
+ if (proto && proto->ctrl_type == SOCK_STREAM) {
static unsigned long ring_ids;
/* Implicit sink buffer will be