[core] fill in un.sun_path after accept() (fixes #3147)

(thx fstelzer)

x-ref:
  "mod_proxy breaks X-Forwarded-For on requests via unix sockets"
  https://redmine.lighttpd.net/issues/3147
master
Glenn Strauss 7 months ago
parent 1b56d7cf5b
commit 0e404df2fb
  1. 2
      src/network.c

@ -74,6 +74,8 @@ static handler_t network_server_handle_fdevent(void *context, int revents) {
if (nagle_disable)
network_accept_tcp_nagle_disable(fd);
else if (addrlen <= 2) /*(AF_UNIX if !nagle_disable)*/
memcpy(addr.un.sun_path, BUF_PTR_LEN(srv_socket->srv_token)+1);
connection *con = connection_accepted(srv, srv_socket, &addr, fd);
if (__builtin_expect( (!con), 0)) return HANDLER_GO_ON;

Loading…
Cancel
Save