]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: config: warn when a server with no specific port uses rdp-cookie
authorWilly Tarreau <w@1wt.eu>
Tue, 13 Aug 2013 15:19:08 +0000 (17:19 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 13 Aug 2013 15:19:08 +0000 (17:19 +0200)
Mathew Levett reported an issue which is a bit nasty and hard to track
down. RDP cookies contain both the IP and the port, and haproxy matches
them exactly. So if a server has no port specified (or a remapped port),
it will never match a port specified in a cookie. Better warn the user
when this is detected.

src/cfgparse.c

index d51e1b6da66684a66e85279b744857cb51853b26..41c1949209e173ab9f2d872f3fc393aabcd4e07f 100644 (file)
@@ -6885,6 +6885,12 @@ out_uri_auth_compat:
                                err_code |= ERR_WARN;
                        }
 
+                       if ((newsrv->state & SRV_MAPPORTS) && (curproxy->options2 & PR_O2_RDPC_PRST)) {
+                               Warning("config : %s '%s' : RDP cookie persistence will not work for server '%s' because it lacks an explicit port number.\n",
+                                       proxy_type_str(curproxy), curproxy->id, newsrv->id);
+                               err_code |= ERR_WARN;
+                       }
+
 #if defined(CONFIG_HAP_CTTPROXY) || defined(CONFIG_HAP_TRANSPARENT)
                        if (curproxy->mode != PR_MODE_HTTP && newsrv->conn_src.bind_hdr_occ) {
                                newsrv->conn_src.bind_hdr_occ = 0;