From: Rafael Sadowski Subject: Re: relayd: set User-Agent for HTTP healthchecks To: Lloyd Cc: tech@openbsd.org, Joel Carnat , Kirill Bychkov Date: Fri, 27 Feb 2026 20:34:29 +0100 On Fri Feb 27, 2026 at 06:44:20PM +0000, Lloyd wrote: > I checked and indeed RELAYD_SERVERNAME is defined in relayd.h. > I like the idea with RELAYD_SERVERNAME. diff --git a/usr.sbin/relayd/parse.y b/usr.sbin/relayd/parse.y index fcdfb8e92e3..2a9bf181b11 100644 --- a/usr.sbin/relayd/parse.y +++ b/usr.sbin/relayd/parse.y @@ -921,8 +921,8 @@ tablecheck : ICMP { table->conf.check = CHECK_ICMP; } YYERROR; } if (asprintf(&table->sendbuf, - "HEAD %s HTTP/1.%c\r\n%s\r\n", - $2, strlen($3) ? '1' : '0', $3) == -1) + "HEAD %s HTTP/1.%c\r\nUser-Agent: %s\r\n%s\r\n", + $2, strlen($3) ? '1' : '0', RELAYD_SERVERNAME, $3) == -1) fatal("asprintf"); free($2); free($3); @@ -936,8 +936,8 @@ tablecheck : ICMP { table->conf.check = CHECK_ICMP; } } table->conf.check = CHECK_HTTP_DIGEST; if (asprintf(&table->sendbuf, - "GET %s HTTP/1.%c\r\n%s\r\n", - $2, strlen($3) ? '1' : '0', $3) == -1) + "GET %s HTTP/1.%c\r\nUser-Agent: %s\r\n%s\r\n", + $2, strlen($3) ? '1' : '0', RELAYD_SERVERNAME, $3) == -1) fatal("asprintf"); free($2); free($3);