Skip to content
Snippets Groups Projects
Verified Commit 07bfefe4 authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

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.
parent 8b6e838e
Branches
Tags
1 merge request!1338macOS nits
Pipeline #103502 failed with stages
in 36 minutes and 23 seconds
......@@ -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;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment