From d861dc9b48789f9c6c7f092d1a3114695cfbbe0d Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Mon, 6 Feb 2023 18:50:51 +0100 Subject: [PATCH] BUG/MINOR: proto_ux: report correct error when bind_listener fails 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 | 1 + src/proto_uxst.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/proto_uxdg.c b/src/proto_uxdg.c index 41e01004f..68fe207de 100644 --- a/src/proto_uxdg.c +++ b/src/proto_uxdg.c @@ -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; } diff --git a/src/proto_uxst.c b/src/proto_uxst.c index c9639e76e..fd22e95bb 100644 --- a/src/proto_uxst.c +++ b/src/proto_uxst.c @@ -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; }