diff options
Diffstat (limited to 'contrib/sendmail/src/domain.c')
-rw-r--r-- | contrib/sendmail/src/domain.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/contrib/sendmail/src/domain.c b/contrib/sendmail/src/domain.c index 05199077c7fa..f4a8810a27cc 100644 --- a/contrib/sendmail/src/domain.c +++ b/contrib/sendmail/src/domain.c @@ -14,9 +14,9 @@ #include <sendmail.h> #if NAMED_BIND -SM_RCSID("@(#)$Id: domain.c,v 8.181.2.6 2003/01/15 19:17:15 ca Exp $ (with name server)") +SM_RCSID("@(#)$Id: domain.c,v 8.181.2.9 2003/08/11 23:23:40 gshapiro Exp $ (with name server)") #else /* NAMED_BIND */ -SM_RCSID("@(#)$Id: domain.c,v 8.181.2.6 2003/01/15 19:17:15 ca Exp $ (without name server)") +SM_RCSID("@(#)$Id: domain.c,v 8.181.2.9 2003/08/11 23:23:40 gshapiro Exp $ (without name server)") #endif /* NAMED_BIND */ #if NAMED_BIND @@ -233,6 +233,8 @@ getmxrr(host, mxhosts, mxprefs, droplocalhost, rcode, tryfallback, pttl) if (tTd(8, 2)) sm_dprintf("getmxrr(%s, droplocalhost=%d)\n", host, droplocalhost); + if (*host == '\0') + return 0; if ((fallbackMX != NULL && droplocalhost && wordinclass(fallbackMX, 'w')) || !tryfallback) @@ -778,12 +780,6 @@ bestmx_map_lookup(map, name, av, statp) ** 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; @@ -807,6 +803,7 @@ dns_getcanonname(host, hbsize, trymx, statp, pttl) bool amatch; bool gotmx = false; int qtype; + int initial; int loopcnt; char *xp; char nbuf[SM_MAX(MAXPACKET, MAXDNAME*2+2)]; @@ -898,11 +895,16 @@ cnameloop: */ 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", @@ -984,7 +986,7 @@ nexttype: /* definite no -- try the next domain */ dp++; - qtype = SM_T_INITIAL; + qtype = initial; continue; } else if (tTd(8, 7)) @@ -1069,13 +1071,7 @@ nexttype: # if NETINET6 case T_AAAA: - /* Flag that a good match was found */ - amatch = true; - - /* continue in case a CNAME also exists */ - continue; # endif /* NETINET6 */ - case T_A: /* Flag that a good match was found */ amatch = true; @@ -1161,7 +1157,7 @@ nexttype: qtype = T_MX; else { - qtype = SM_T_INITIAL; + qtype = initial; dp++; } } |