From cd557745442f6b82a28cc4bff89ac25b70afba4c Mon Sep 17 00:00:00 2001 From: Leonardo Alminana Date: Wed, 13 Mar 2024 08:13:31 +0100 Subject: [PATCH] network: added preprocessor guard around the port sharing feature Signed-off-by: Leonardo Alminana --- src/flb_network.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/flb_network.c b/src/flb_network.c index 7d12bc23823..13c8ecb27e8 100644 --- a/src/flb_network.c +++ b/src/flb_network.c @@ -189,7 +189,12 @@ int flb_net_socket_share_port(flb_sockfd_t fd) int on = 1; int ret; +#ifdef SO_REUSEPORT ret = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &on, sizeof(on)); +#else + ret = -1; +#endif + if (ret == -1) { flb_errno(); return -1;