From 0ec535fbe62f67d428909c4537bba8ba44d44d38 Mon Sep 17 00:00:00 2001 From: pyr <> Date: Thu, 4 Jun 2009 18:06:35 +0000 Subject: [PATCH] Add a resolv.conf option to specify the order in which getaddrinfo PF_UNSPEC queries are made. While there change the default from inet6 first then inet4 to inet4 first then inet6, this prevents the many people with IPv4 only connectivity from constantly trying to contact IPv6 addresses, and also unbreaks many ports who don't use getaddrinfo right. ok deraadt@, plenty of cheering in the room wrt the idea, not loud enough complaining from the v6 crowd. --- src/include/resolv.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/include/resolv.h b/src/include/resolv.h index 8102f795..41878119 100644 --- a/src/include/resolv.h +++ b/src/include/resolv.h @@ -1,4 +1,4 @@ -/* $OpenBSD: resolv.h,v 1.16 2005/03/30 02:58:28 tedu Exp $ */ +/* $OpenBSD: resolv.h,v 1.17 2009/06/04 18:06:35 pyr Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -136,6 +136,9 @@ struct __res_state { int retry; /* number of times to retransmit */ unsigned int options; /* option flags - see below. */ int nscount; /* number of name servers */ + int family[2]; /* specifies which address + * families will be queried and + * in which order */ struct sockaddr_in nsaddr_list[MAXNS]; /* address of name server */ #define nsaddr nsaddr_list[0] /* for backward compatibility */