]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: log: migrate log-forward options from proxy->options2 to options3
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 7 Mar 2025 10:00:59 +0000 (11:00 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Wed, 12 Mar 2025 09:50:03 +0000 (10:50 +0100)
Migrate recently added log-forward section options, currently stored under
proxy->options2 to proxy->options3 since proxy->options2 is running out of
space and we plan on adding more log-forward options.

include/haproxy/proxy-t.h
src/log.c
src/proxy.c

index 3da19da69a3509b9e5cd73603bc90c88b581d625..88a07afbbda1a3cfb9e599196864ca5d5734d32c 100644 (file)
@@ -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 */
index 9b1fe4ba1c0cbb598f8df795d10ee3aafc1010ba..ba8d61d2ecc38e6bdfa919cced3f0c863dba9527 100644 (file)
--- 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)
index fa270ab9d8d47a7937154e8c88c3f5321c982421..3725d364a0359b4a1e4896e824877effc503b351 100644 (file)
@@ -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 }
 };