From cfe1ab3c7d73d9eb65a0fd943f267b84d4018717 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Tue, 19 Nov 2024 13:29:46 +0100 Subject: [PATCH] [socket] compilation fixes --- src/network/socket.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/network/socket.c b/src/network/socket.c index 9907b824f..0bdd692a9 100644 --- a/src/network/socket.c +++ b/src/network/socket.c @@ -534,6 +534,7 @@ connected(struct socket *socket) complete_connect_socket(socket, NULL, NULL); } +#ifdef HAVE_INET_PTON static int to_bind; static struct sockaddr_in sa_bind; @@ -541,16 +542,13 @@ static struct sockaddr_in sa_bind; static int to_bind_ipv6; static struct sockaddr_in6 sa6_bind; #endif +#endif static void init_bind_address(void) { - char *bind_address = get_cmd_opt_str("bind-address"); -#ifdef CONFIG_IPV6 - char *bind_address_ipv6 = get_cmd_opt_str("bind-address-ipv6"); -#endif - #ifdef HAVE_INET_PTON + char *bind_address = get_cmd_opt_str("bind-address"); to_bind = (bind_address && *bind_address); if (to_bind) { @@ -561,6 +559,7 @@ init_bind_address(void) } #ifdef CONFIG_IPV6 + char *bind_address_ipv6 = get_cmd_opt_str("bind-address-ipv6"); to_bind_ipv6 = (bind_address_ipv6 && *bind_address_ipv6); if (to_bind_ipv6) {