#endif
#include "misc.h"
+/* Portability cruft, should become unnecessary eventually */
+#ifndef AI_ADDRCONFIG
+#define AI_ADDRCONFIG 0
+#endif
+
#ifdef HAVE_GETADDRINFO
/*
* Inspired by example code from W. Richard Stevens: UNIX Network
struct addrinfo hints, *res, *ressave;
memset(&hints, 0, sizeof(struct addrinfo));
+ hints.ai_flags = AI_ADDRCONFIG;
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
#include <unistd.h>
#include "prototypes.h"
+/* Portability cruft, should become unnecessary eventually */
+#ifndef AI_ADDRCONFIG
+#define AI_ADDRCONFIG 0
+#endif
+
static void cant_listen(char *, char *, const char *);
int
struct addrinfo hints, *res, *ressave;
memset(&hints, 0, sizeof(struct addrinfo));
- hints.ai_flags = AI_PASSIVE;
+ hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;