Browse Source

[core] check if EAI_ADDRFAMILY is defined

(EAI_ADDRFAMILY is not available on FreeBSD)
personal/stbuehler/mod-csrf-old
Glenn Strauss 5 years ago
parent
commit
ad6d41896e
  1. 6
      src/network.c

6
src/network.c

@ -282,7 +282,11 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
if (0 != (r = getaddrinfo(host, NULL, &hints, &res))) {
hints.ai_family = AF_INET;
if (EAI_ADDRFAMILY == r && 0 == getaddrinfo(host, NULL, &hints, &res)) {
if (
#ifdef EAI_ADDRFAMILY
EAI_ADDRFAMILY == r &&
#endif
0 == getaddrinfo(host, NULL, &hints, &res)) {
memcpy(&srv_socket->addr.ipv4, res->ai_addr, res->ai_addrlen);
srv_socket->addr.ipv4.sin_family = AF_INET;
srv_socket->addr.ipv4.sin_port = htons(port);

Loading…
Cancel
Save