}
httpd->server_fd = netutils_init_socket(port, 1, 0);
+ if (httpd->server_fd == -1) {
+ logger_log(httpd->logger, LOGGER_INFO, "Error initialising IPv6 socket %d", SOCKET_GET_ERROR());
+ logger_log(httpd->logger, LOGGER_INFO, "Attempting to fall back to IPv4");
+ httpd->server_fd = netutils_init_socket(port, 0, 0);
+ }
if (httpd->server_fd == -1) {
logger_log(httpd->logger, LOGGER_INFO, "Error initialising socket %d", SOCKET_GET_ERROR());
MUTEX_UNLOCK(httpd->run_mutex);