From: Vladimír Čunát Date: Wed, 24 Aug 2022 08:58:26 +0000 (+0200) Subject: daemon/io: log another message if `freebind` isn't supported X-Git-Tag: v5.5.3~3^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07bfefe40b8b0c9d72576b075bb01aac6c84c5ee;p=thirdparty%2Fknot-resolver.git daemon/io: log another message if `freebind` isn't supported So far the message wasn't pointing to freebind at all: [net ] bind to '::1@53' (UDP): Operation not supported I used preprocessor to avoid duplication and unused warnings. Another way would be to ignore the freebind option if not supported, but I think it's better to convince users not to specify it. --- diff --git a/daemon/io.c b/daemon/io.c index 824a4b9f5..4d8579241 100644 --- a/daemon/io.c +++ b/daemon/io.c @@ -148,6 +148,8 @@ void udp_recv(uv_udp_t *handle, ssize_t nread, const uv_buf_t *buf, static int family_to_freebind_option(sa_family_t sa_family, int *level, int *name) { +#define LOG_NO_FB kr_log_error(NETWORK, "your system does not support 'freebind', " \ + "please remove it from your configuration\n") switch (sa_family) { case AF_INET: *level = IPPROTO_IP; @@ -156,6 +158,7 @@ static int family_to_freebind_option(sa_family_t sa_family, int *level, int *nam #elif defined(IP_BINDANY) *name = IP_BINDANY; #else + LOG_NO_FB; return kr_error(ENOTSUP); #endif break; @@ -167,6 +170,7 @@ static int family_to_freebind_option(sa_family_t sa_family, int *level, int *nam *level = IPPROTO_IPV6; *name = IPV6_BINDANY; #else + LOG_NO_FB; return kr_error(ENOTSUP); #endif break;