proxyprotocol on client-side can be removed on server side, and its info is then logged

This commit is contained in:
Yves Rutschle committed 2025-09-10 12:14:41 +02:00
1 parent eea50a97fc
commit 6905498d60
8 files changed
+62 -10

No files matched your search

+19
View File
@@ -133,6 +133,25 @@ int pp_write_header(int pp_version, struct connection* cnx)
return 0;
}
/* Logs the connection data in the pp header and return header length */
int pp_log_connection(char* buffer, ssize_t buffer_len)
{
pp_info_t pp_info;
int header_len = pp_parse_hdr((uint8_t*)buffer, buffer_len, &pp_info);
if (header_len > 0) {
print_message(msg_connections, "client had proxyprotocol info: %s:%d to %s:%d not forwarded to server\n",
pp_info.src_addr, pp_info.src_port,
pp_info.dst_addr, pp_info.dst_port);
} else {
print_message(msg_connections, "no proxyprotocol data found on client side, forwarding as is\n");
header_len = 0;
}
return header_len;
}
int pp_header_len(char* buffer, int buffer_len)
{
pp_info_t pp_info;