Index | Thread | Search

From:
"Omar Polo" <op@omarpolo.com>
Subject:
Re: relayd: remove duplicate check on config_setrelay()
To:
Marc Jorge <openbsd@cypher-fox.com>
Cc:
tech@openbsd.org
Date:
Fri, 03 Apr 2026 11:37:35 +0200

Download raw body.

Thread
hello,

Marc Jorge <openbsd@cypher-fox.com> wrote:
> Hello,
> 
> rlay->rl_tls_client_ca_fd is checked and closed twice in config_setrelay().

cannot really be closed twice because we set rlay->rl_tls_client_ca_fd
to -1 after close(), so the second time we skip the if body.

in any case, it makes sense.  committed, thanks!

> Marc
> 
> 
> diff -u -p -u -r1.48 config.c
> --- usr.sbin/relayd/config.c	2 Mar 2026 19:28:01 -0000	1.48
> +++ usr.sbin/relayd/config.c	2 Apr 2026 16:11:46 -0000
> @@ -1025,10 +1025,6 @@ config_setrelay(struct relayd *env, stru
>   			cert->cert_ocsp_fd = -1;
>   		}
>   	}
> -	if (rlay->rl_tls_client_ca_fd != -1) {
> -		close(rlay->rl_tls_client_ca_fd);
> -		rlay->rl_tls_client_ca_fd = -1;
> -	}
> 
>   	return (0);
>   }