[misc] Fix forgotten return in net_evhttp_bind()

Makes it impossible to use the bind_address config setting properly
This commit is contained in:
ejurgensen 2021-08-30 23:46:36 +02:00
parent e1375f6ad6
commit 7584e6377f

View File

@ -350,8 +350,11 @@ net_evhttp_bind(struct evhttp *evhttp, short unsigned port, const char *log_serv
int ret;
bind_address = cfg_getstr(cfg_getsec(cfg, "general"), "bind_address");
if (bind_address)
evhttp_bind_socket(evhttp, bind_address, port);
// Normally comply with config, except for "::" where we want to listen on
// both ipv4 and ipv6 (as the comment in the config file says)
if (bind_address && strcmp(bind_address, "::") != 0)
return evhttp_bind_socket(evhttp, bind_address, port);
// For Linux, we could just do evhttp_bind_socket() for "::", and both the
// ipv4 and v6 port would be bound. However, for bsd it seems it is necessary