Hi,
Here is a patch to change the SPOP version. It follows the commit
c4dcaff3 ("BUG/MEDIUM: spoe: Flags are not encoded in network order") in
order to make sure no incompatible agent will be used with HAProxy. To
do so, the SPOP 1.0 is no more supported.
Thanks,
--
Christopher Faulet
>From 0c68fe1a07f81d5c0c69c959cdceb447369620e7 Mon Sep 17 00:00:00 2001
From: Christopher Faulet <[email protected]>
Date: Thu, 31 May 2018 14:56:42 +0200
Subject: [PATCH] MAJOR: spoe: upgrade the SPOP version to 2.0 and remove the
support for 1.0
The commit c4dcaff3 ("BUG/MEDIUM: spoe: Flags are not encoded in network order")
introduced an incompatibility with older agents. So the major version of the
SPOP is increased to make the situation unambiguous. And because before the fix,
the protocol is buggy, the support of the version 1.0 is removed to be sure to
not continue to support buggy agents.
the agents in the contrib folder (spoa_example, modsecurity and mod_defender)
are also updated to announce the SPOP version 2.0.
So, to be clear, from the patch, connections to agents announcing the SPOP
version 1.0 will be rejected.
This patch must be backported in 1.8.
---
contrib/mod_defender/spoa.c | 2 +-
contrib/modsecurity/spoa.c | 2 +-
contrib/spoa_example/spoa.c | 2 +-
src/flt_spoe.c | 5 +++--
4 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/contrib/mod_defender/spoa.c b/contrib/mod_defender/spoa.c
index 1191260a..34b24f49 100644
--- a/contrib/mod_defender/spoa.c
+++ b/contrib/mod_defender/spoa.c
@@ -43,7 +43,7 @@
#define CONNECTION_BACKLOG 10
#define NUM_WORKERS 10
#define MAX_FRAME_SIZE 16384
-#define SPOP_VERSION "1.0"
+#define SPOP_VERSION "2.0"
#define SLEN(str) (sizeof(str)-1)
diff --git a/contrib/modsecurity/spoa.c b/contrib/modsecurity/spoa.c
index cbabcb29..18ef1d24 100644
--- a/contrib/modsecurity/spoa.c
+++ b/contrib/modsecurity/spoa.c
@@ -48,7 +48,7 @@
#define CONNECTION_BACKLOG 10
#define NUM_WORKERS 10
#define MAX_FRAME_SIZE 16384
-#define SPOP_VERSION "1.0"
+#define SPOP_VERSION "2.0"
#define SLEN(str) (sizeof(str)-1)
diff --git a/contrib/spoa_example/spoa.c b/contrib/spoa_example/spoa.c
index 71a36f07..d7486a41 100644
--- a/contrib/spoa_example/spoa.c
+++ b/contrib/spoa_example/spoa.c
@@ -43,7 +43,7 @@
#define CONNECTION_BACKLOG 10
#define NUM_WORKERS 10
#define MAX_FRAME_SIZE 16384
-#define SPOP_VERSION "1.0"
+#define SPOP_VERSION "2.0"
#define SLEN(str) (sizeof(str)-1)
diff --git a/src/flt_spoe.c b/src/flt_spoe.c
index a16932bf..ae751ce2 100644
--- a/src/flt_spoe.c
+++ b/src/flt_spoe.c
@@ -314,12 +314,13 @@ struct spoe_version {
/* All supported versions */
static struct spoe_version supported_versions[] = {
- {"1.0", 1000, 1000},
+ /* 1.0 is now unsupported because of a bug about frame's flags*/
+ {"2.0", 2000, 2000},
{NULL, 0, 0}
};
/* Comma-separated list of supported versions */
-#define SUPPORTED_VERSIONS_VAL "1.0"
+#define SUPPORTED_VERSIONS_VAL "2.0"
/* Convert a string to a SPOE version value. The string must follow the format
* "MAJOR.MINOR". It will be concerted into the integer (1000 * MAJOR + MINOR).
--
2.17.0