Skip to content

Commit

Permalink
Use AI_ADDRCONFIG more selectively.
Browse files Browse the repository at this point in the history
This makes running on Linux when disconnected possible.

Tests still fail when using the -l option to specify a binding address
while offline.  This is probably quite unlikely if it weren't for the
first test.
  • Loading branch information
eklitzke authored and dustin committed Mar 2, 2009
1 parent a34f78e commit d2b97e6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion memcached.c
Original file line number Diff line number Diff line change
Expand Up @@ -3536,7 +3536,13 @@ static int server_socket(const int port, enum protocol prot) {
* that otherwise mess things up.
*/
memset(&hints, 0, sizeof (hints));
hints.ai_flags = AI_PASSIVE|AI_ADDRCONFIG;
hints.ai_flags = AI_PASSIVE;

/* Only use AI_ADDRCONFIG if a hostname is specified, otherwise we might
* not get results for INADDR_ANY. */
if (settings.inter)
hints.ai_flags |= AI_ADDRCONFIG;

if (IS_UDP(prot))
{
hints.ai_socktype = SOCK_DGRAM;
Expand Down

0 comments on commit d2b97e6

Please sign in to comment.