Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Aug 2003 09:31:29 -0700
From:      Gregory Neil Shapiro <gshapiro@freebsd.org>
To:        Luigi Rizzo <rizzo@icir.org>
Cc:        ume@freebsd.org
Subject:   Re: can we disable AAAA queries in the resolver ?
Message-ID:  <20030802163128.GX81388@horsey.gshapiro.net>
In-Reply-To: <20030802030852.A9531@xorpc.icir.org>
References:  <20030801235200.A53695@xorpc.icir.org> <20030802085918.GA14729@walton.maths.tcd.ie> <20030802030852.A9531@xorpc.icir.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> i know, but what is happening is that all these applications
> (including sendmail and our ssh, for what matters)
> are broken in that they look for an AAAA record just for making
> a connection.

Can you try this patch for sendmail?

--- domain.c.orig	Sat Aug  2 09:27:09 2003
+++ domain.c	Sat Aug  2 09:29:47 2003
@@ -851,12 +851,6 @@
 **		false -- otherwise.
 */
 
-# if NETINET6
-#  define SM_T_INITIAL	T_AAAA
-# else /* NETINET6 */
-#  define SM_T_INITIAL	T_A
-# endif /* NETINET6 */
-
 bool
 dns_getcanonname(host, hbsize, trymx, statp, pttl)
 	char *host;
@@ -880,6 +874,7 @@
 	bool amatch;
 	bool gotmx = false;
 	int qtype;
+	int initial;
 	int loopcnt;
 	char *xp;
 	char nbuf[SM_MAX(MAXPACKET, MAXDNAME*2+2)];
@@ -971,11 +966,16 @@
 	*/
 
 	mxmatch = NULL;
-	qtype = SM_T_INITIAL;
+	initial = T_A;
+# if NETINET6
+	if (InetMode == AF_INET6)
+		initial = T_AAAA;
+# endif /* NETINET6 */
+	qtype = initial;
 
 	for (dp = searchlist; *dp != NULL; )
 	{
-		if (qtype == SM_T_INITIAL)
+		if (qtype == initial)
 			gotmx = false;
 		if (tTd(8, 5))
 			sm_dprintf("dns_getcanonname: trying %s.%s (%s)\n",
@@ -1057,7 +1057,7 @@
 
 			/* definite no -- try the next domain */
 			dp++;
-			qtype = SM_T_INITIAL;
+			qtype = initial;
 			continue;
 		}
 		else if (tTd(8, 7))
@@ -1234,7 +1234,7 @@
 			qtype = T_MX;
 		else
 		{
-			qtype = SM_T_INITIAL;
+			qtype = initial;
 			dp++;
 		}
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030802163128.GX81388>