Browse code

Freshclam patch to resolve IPv4, IPv6 addresses only if a global address is configured, so as not to attempt IPv6 connections from machines where IPv6 isn't available. Patch courtesy of Guilherme Benkenstein.

Micah Snyder (micasnyd) authored on 2018/05/29 00:43:57
Showing 1 changed files
... ...
@@ -231,6 +231,7 @@ wwwconnect (const char *server, const char *proxy, int pport, char *ip,
231 231
     hints.ai_family = AF_INET;
232 232
 #endif
233 233
     hints.ai_socktype = SOCK_STREAM;
234
+    hints.ai_flags    = AI_ADDRCONFIG;
234 235
     snprintf (port_s, sizeof (port_s), "%d", port);
235 236
     port_s[sizeof (port_s) - 1] = 0;
236 237
     ret = getaddrinfo (hostpt, port_s, &hints, &res);