$NetBSD: patch-as,v 1.1 2014/06/15 20:48:50 jnemeth Exp $

--- sendmail/deliver.c.orig	2017-02-17 03:44:29.000000000 +0900
+++ sendmail/deliver.c	2018-04-01 06:46:32.962098677 +0900
@@ -29,6 +29,10 @@ SM_RCSID("@(#)$Id: deliver.c,v 8.1030 20
 # include "tls.h"
 #endif /* STARTTLS || SASL */
 
+#if NAMED_BIND
+extern struct __res_state sm_res;
+#endif
+
 static int	deliver __P((ENVELOPE *, ADDRESS *));
 static void	dup_queue_file __P((ENVELOPE *, ENVELOPE *, int));
 static void	mailfiletimeout __P((int));
@@ -1875,7 +1879,7 @@ deliver(e, firstto)
 
 #if NAMED_BIND
 	if (ConfigLevel < 2)
-		_res.options &= ~(RES_DEFNAMES | RES_DNSRCH);	/* XXX */
+		sm_res.options &= ~(RES_DEFNAMES | RES_DNSRCH);	/* XXX */
 #endif /* NAMED_BIND */
 
 	if (tTd(11, 1))
@@ -3536,7 +3540,7 @@ do_transfer:
 	}
 #if NAMED_BIND
 	if (ConfigLevel < 2)
-		_res.options |= RES_DEFNAMES | RES_DNSRCH;	/* XXX */
+		sm_res.options |= RES_DEFNAMES | RES_DNSRCH;	/* XXX */
 #endif /* NAMED_BIND */
 
 	if (tTd(62, 1))
@@ -5875,7 +5879,7 @@ hostsignature(m, host, ad)
 	int hl;
 	char *hp;
 	char *endp;
-	int oldoptions = _res.options;
+	int oldoptions = sm_res.options;
 	char *mxhosts[MAXMXHOSTS + 1];
 	unsigned short mxprefs[MAXMXHOSTS + 1];
 #endif /* NAMED_BIND */
@@ -5945,7 +5949,7 @@ hostsignature(m, host, ad)
 
 #if NAMED_BIND
 	if (ConfigLevel < 2)
-		_res.options &= ~(RES_DEFNAMES | RES_DNSRCH);	/* XXX */
+		sm_res.options &= ~(RES_DEFNAMES | RES_DNSRCH);	/* XXX */
 
 	for (hp = host; hp != NULL; hp = endp)
 	{
@@ -6074,7 +6078,7 @@ hostsignature(m, host, ad)
 	}
 	makelower(s->s_hostsig.hs_sig);
 	if (ConfigLevel < 2)
-		_res.options = oldoptions;
+		sm_res.options = oldoptions;
 #else /* NAMED_BIND */
 	/* not using BIND -- the signature is just the host name */
 	/*
