From: Willy Tarreau Date: Tue, 15 Sep 2020 12:03:26 +0000 (+0200) Subject: MINOR: log: detect LOG_TARGET_FD from the fd and not from the syntax X-Git-Tag: v2.3-dev5~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=895992619d521e987d25644ad859adef7e8d646b;p=thirdparty%2Fhaproxy.git MINOR: log: detect LOG_TARGET_FD from the fd and not from the syntax Now that we have the FD value reported we don't need to cheat and detect "fd@" in the address, we can safely rely on the FD value. --- diff --git a/src/log.c b/src/log.c index fcb16f6be2..a0898aadce 100644 --- a/src/log.c +++ b/src/log.c @@ -803,6 +803,7 @@ int parse_logsrv(char **args, struct list *logsrvs, int do_del, char **err) struct logsrv *logsrv = NULL; int port1, port2; int cur_arg; + int fd; /* * "no log": delete previous herited or defined syslog @@ -1018,13 +1019,13 @@ int parse_logsrv(char **args, struct list *logsrvs, int do_del, char **err) goto done; } - if (strncmp(args[1], "fd@", 3) == 0) - logsrv->type = LOG_TARGET_FD; - - sk = str2sa_range(args[1], NULL, &port1, &port2, NULL, + sk = str2sa_range(args[1], NULL, &port1, &port2, &fd, err, NULL, NULL, PA_O_RESOLVE | PA_O_PORT_OK | PA_O_RAW_FD | PA_O_DGRAM); if (!sk) goto error; + + if (fd != -1) + logsrv->type = LOG_TARGET_FD; logsrv->addr = *sk; /* handle nicely the case where "udp@" is forced */