diff --git a/include/haproxy/proxy-t.h b/include/haproxy/proxy-t.h index 3da19da69..88a07afbb 100644 --- a/include/haproxy/proxy-t.h +++ b/include/haproxy/proxy-t.h @@ -156,11 +156,7 @@ enum PR_SRV_STATE_FILE { #define PR_O2_RSTRICT_REQ_HDR_NAMES_NOOP 0x01000000 /* preserve request header names containing chars outside of [0-9a-zA-Z-] charset */ #define PR_O2_RSTRICT_REQ_HDR_NAMES_MASK 0x01c00000 /* mask for restrict-http-header-names option */ -/* bits for log-forward proxies */ -#define PR_O2_DONTPARSELOG 0x02000000 /* don't parse log messages */ -#define PR_O2_ASSUME_RFC6587_NTF 0x04000000 /* assume that we are going to receive just non-transparent framing messages */ - -/* unused : 0x08000000 */ +/* unused : 0x02000000 ... 0x08000000 */ /* server health checks */ #define PR_O2_CHK_NONE 0x00000000 /* no L7 health checks configured (TCP by default) */ @@ -171,7 +167,12 @@ enum PR_SRV_STATE_FILE { /* end of proxy->options2 */ /* bits for proxy->options3 */ -/* unused: 0x00000000 to 0x80000000 */ + +/* bits for log-forward proxies */ +#define PR_O3_DONTPARSELOG 0x00000001 /* don't parse log messages */ +#define PR_O3_ASSUME_RFC6587_NTF 0x00000002 /* assume that we are going to receive just non-transparent framing messages */ + +/* unused: 0x00000004 to 0x80000000 */ /* end of proxy->options3 */ /* Cookie settings for pr->ck_opts */ diff --git a/src/log.c b/src/log.c index 9b1fe4ba1..ba8d61d2e 100644 --- a/src/log.c +++ b/src/log.c @@ -5729,7 +5729,7 @@ static void syslog_process_message(struct proxy *frontend, struct listener *l, prepare_log_message(buf->area, buf->data, &level, &facility, metadata, &message, &size); - if (!(frontend->options2 & PR_O2_DONTPARSELOG)) + if (!(frontend->options3 & PR_O3_DONTPARSELOG)) parse_log_message(buf->area, buf->data, &level, &facility, metadata, &message, &size); process_send_log(NULL, &frontend->loggers, level, facility, metadata, message, size); @@ -5813,7 +5813,7 @@ static void syslog_io_handler(struct appctx *appctx) else if (to_skip < 0) goto cli_abort; - if (c == '<' || (frontend->options2 & PR_O2_ASSUME_RFC6587_NTF)) { + if (c == '<' || (frontend->options3 & PR_O3_ASSUME_RFC6587_NTF)) { /* rfc-6587, Non-Transparent-Framing: messages separated by * a trailing LF or CR LF */ @@ -6211,9 +6211,9 @@ int cfg_parse_log_forward(const char *file, int linenum, char **args, int kwm) /* only consider options that are frontend oriented and log oriented, such options may be set * in px->options2 because px->options is already full of tcp/http oriented options */ - if (cfg_parse_listen_match_option(file, linenum, kwm, cfg_opts2, &err_code, args, + if (cfg_parse_listen_match_option(file, linenum, kwm, cfg_opts3, &err_code, args, PR_MODE_SYSLOG, PR_CAP_FE, - &cfg_log_forward->options2, &cfg_log_forward->no_options2)) + &cfg_log_forward->options3, &cfg_log_forward->no_options3)) goto out; if (err_code & ERR_CODE) diff --git a/src/proxy.c b/src/proxy.c index fa270ab9d..3725d364a 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -131,14 +131,14 @@ const struct cfg_opt cfg_opts2[] = {"h1-case-adjust-bogus-client", PR_O2_H1_ADJ_BUGCLI, PR_CAP_FE, 0, 0 }, {"h1-case-adjust-bogus-server", PR_O2_H1_ADJ_BUGSRV, PR_CAP_BE, 0, 0 }, {"disable-h2-upgrade", PR_O2_NO_H2_UPGRADE, PR_CAP_FE, 0, PR_MODE_HTTP }, - {"assume-rfc6587-ntf", PR_O2_ASSUME_RFC6587_NTF, PR_CAP_FE, 0, PR_MODE_SYSLOG }, - {"dont-parse-log", PR_O2_DONTPARSELOG, PR_CAP_FE, 0, PR_MODE_SYSLOG }, { NULL, 0, 0, 0 } }; /* proxy->options3 */ const struct cfg_opt cfg_opts3[] = { + {"assume-rfc6587-ntf", PR_O3_ASSUME_RFC6587_NTF, PR_CAP_FE, 0, PR_MODE_SYSLOG }, + {"dont-parse-log", PR_O3_DONTPARSELOG, PR_CAP_FE, 0, PR_MODE_SYSLOG }, { NULL, 0, 0, 0 } };