]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: proto_ux: report correct error when bind_listener fails
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 6 Feb 2023 17:50:51 +0000 (18:50 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 23 Feb 2023 14:05:05 +0000 (15:05 +0100)
In uxst_bind_listener() and uxdg_bind_listener(), when the function
fails because the listener is not bound, both function are setting
the error message but don't set the err status before returning.

Because of this, such error is not properly handled by the upper functions.

Making sure this error is properly catched by returning a composition of
ERR_FATAL and ERR_ALERT.

This could be backported up to 2.4.

src/proto_uxdg.c
src/proto_uxst.c

index 41e01004fa36bf52f46da73f15c4334546c7a998..68fe207de060a8db54133f381bbc4afa0b77b0e2 100644 (file)
@@ -95,6 +95,7 @@ int uxdg_bind_listener(struct listener *listener, char *errmsg, int errlen)
 
        if (!(listener->rx.flags & RX_F_BOUND)) {
                msg = "receiving socket not bound";
+               err |= ERR_FATAL | ERR_ALERT;
                goto uxdg_return;
        }
 
index c9639e76ee22b43228293639dde8e958b6964996..fd22e95bb213057460ba465e7d417ab4e099d89a 100644 (file)
@@ -119,6 +119,7 @@ static int uxst_bind_listener(struct listener *listener, char *errmsg, int errle
 
        if (!(listener->rx.flags & RX_F_BOUND)) {
                msg = "receiving socket not bound";
+               err |= ERR_FATAL | ERR_ALERT;
                goto uxst_return;
        }