Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Aug 2000 07:05:17 +0900 (JST)
From:      Hajimu UMEMOTO <ume@mahoroba.org>
To:        jhay@icomtek.co.za
Cc:        gshapiro@gshapiro.net, gshapiro@FreeBSD.ORG, freebsd-current@FreeBSD.ORG
Subject:   Re: sendmail updated from 8.9.3 to 8.11.0 in -current
Message-ID:  <20000814.070517.08313193.ume@mahoroba.org>
In-Reply-To: <20000814.054434.115900410.ume@mahoroba.org>
References:  <14742.61852.184466.543141@horsey.gshapiro.net> <200008131928.e7DJSKg20282@zibbi.mikom.csir.co.za> <20000814.054434.115900410.ume@mahoroba.org>

next in thread | previous in thread | raw e-mail | index | archive | help
ume> Please try this patch.

ume> Index: sendmail-8.11.0/sendmail/conf.c
ume> diff -u sendmail-8.11.0/sendmail/conf.c.orig sendmail-8.11.0/sendmail/conf.c

Oops, previous patch is insufficient.  I forgot to open INET6 socket.

Index: sendmail-8.11.0/sendmail/conf.c
diff -u sendmail-8.11.0/sendmail/conf.c.orig sendmail-8.11.0/sendmail/conf.c
--- sendmail-8.11.0/sendmail/conf.c.orig	Sun Jul 16 02:35:18 2000
+++ sendmail-8.11.0/sendmail/conf.c	Mon Aug 14 06:52:16 2000
@@ -4771,6 +4771,11 @@
 #  undef __P
 # endif /* (_AIX4 >= 40300) && !defined(_NET_IF_H) */
 # include <net/if.h>
+#if NETINET6 && !defined(SIOCGLIFCONF)
+# include <net/if.h>
+# include <net/if_var.h>
+# include <netinet/in_var.h>
+#endif /* NETINET6 && !SIOCGLIFCONF */
 #endif /* defined(SIOCGIFCONF) && !SIOCGIFCONF_IS_BROKEN */
 
 void
@@ -4958,6 +4963,9 @@
 #else /* NETINET6 && defined(SIOCGLIFCONF) */
 # if defined(SIOCGIFCONF) && !SIOCGIFCONF_IS_BROKEN
 	int s;
+#if NETINET6 && defined(SIOCGIFAFLAG_IN6)
+	int s6;
+#endif /* NETINET6 && SIOCGIFAFLAG_IN6 */
 	int i;
 	struct ifconf ifc;
 	int numifs;
@@ -4996,6 +5004,10 @@
 		return;
 	}
 
+#if NETINET6 && defined(SIOCGIFAFLAG_IN6)
+	s6 = socket(AF_INET6, SOCK_DGRAM, 0);
+#endif /* NETINET6 && SIOCGIFAFLAG_IN6 */
+
 	/* scan the list of IP address */
 	if (tTd(0, 40))
 		dprintf("scanning for interface specific names, ifc_len=%d\n",
@@ -5009,6 +5021,9 @@
 #   if NETINET6
 		char *addr;
 		struct in6_addr ia6;
+#    ifdef SIOCGIFAFLAG_IN6
+		struct in6_ifreq ifr6;
+#    endif /* SIOCGIFAFLAG_IN6 */
 #   endif /* NETINET6 */
 		struct in_addr ia;
 #   ifdef SIOCGIFFLAGS
@@ -5094,6 +5109,22 @@
 				continue;
 			}
 
+#   ifdef SIOCGIFAFLAG_IN6
+			memset(&ifr6, '\0', sizeof(struct in6_ifreq));
+			strncpy(ifr6.ifr_name, ifr->ifr_name,
+				sizeof(ifr->ifr_name));
+			ifr6.ifr_addr = sa->sin6;
+			if (s6 < 0 || ioctl(s6, SIOCGIFAFLAG_IN6, &ifr6) < 0)
+			{
+				if (tTd(0, 4))
+					dprintf("SIOCGIFAFLAG_IN6 failed: %s\n",
+						errstring(errno));
+				continue;
+			}
+			if (ifr6.ifr_ifru.ifru_flags6 & IN6_IFF_ANYCAST)
+				continue;
+#   endif /* SIOCGIFAFLAG_IN6 */
+
 			/* save IP address in text from */
 			addr = anynet_ntop(&ia6, buf6, sizeof buf6);
 			if (addr != NULL)
@@ -5123,6 +5154,10 @@
 	}
 	free(ifc.ifc_buf);
 	(void) close(s);
+#  if NETINET6 && defined(SIOCGIFAFLAG_IN6)
+	if (s6 >= 0)
+		(void) close(s6);
+#  endif /* NETINET6 && SIOCGIFAFLAG_IN6 */
 #  undef IFRFREF
 # endif /* defined(SIOCGIFCONF) && !SIOCGIFCONF_IS_BROKEN */
 #endif /* NETINET6 && defined(SIOCGLIFCONF) */

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume@mahoroba.org  ume@bisd.hitachi.co.jp  ume@FreeBSD.org
http://www.imasy.org/~ume/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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