Subject: Re: sendmail: strange IPv6 reverse lookup (1-5-RELEASE)
To: Ingolf Steinbach <ingolf@jellonet.de>
From: Jun-ichiro itojun Hagino <itojun@iijlab.net>
List: current-users
Date: 12/08/2000 06:36:04
>> 	it was sendmail 8.11.1 issue.  i've put a couple of workarounds
>> 	into netbsd-current tree.
>Could you please provide patches against netbsd-1-5-RELEASE?

	not sure if it applies cleanly (1.5 ships with sendmail 8.11.0 I
	believe, while current uses 8.11.1), but anyway, here are the changes.

itojun


Index: sendmail/conf.c
===================================================================
RCS file: /cvsroot/gnusrc/gnu/dist/sendmail/sendmail/conf.c,v
retrieving revision 1.6
retrieving revision 1.8
diff -u -r1.6 -r1.8
--- sendmail/conf.c	2000/10/10 11:17:45	1.6
+++ sendmail/conf.c	2000/12/07 06:31:51	1.8
@@ -4909,7 +4909,7 @@
 		{
 		  case AF_INET6:
 			ia6 = sa->sin6.sin6_addr;
-			if (ia6.s6_addr == in6addr_any.s6_addr)
+			if (IN6_IS_ADDR_UNSPECIFIED(&ia6))
 			{
 				addr = anynet_ntop(&ia6, buf6, sizeof buf6);
 				message("WARNING: interface %s is UP with %s address",
@@ -5092,7 +5092,17 @@
 #   if NETINET6
 		  case AF_INET6:
 			ia6 = sa->sin6.sin6_addr;
-			if (ia6.s6_addr == in6addr_any.s6_addr)
+#    ifdef __KAME__
+			/* convert into proper scoped address - */
+			if ((IN6_IS_ADDR_LINKLOCAL(&ia6) ||
+			     IN6_IS_ADDR_SITELOCAL(&ia6)) &&
+			    sa->sin6.sin6_scope_id == 0) {
+				sa->sin6.sin6_scope_id = ntohs(ia6.s6_addr[3] |
+				     ((unsigned int)ia6.s6_addr[2] << 8));
+				ia6.s6_addr[2] = ia6.s6_addr[3] = 0;
+			}
+#    endif
+			if (IN6_IS_ADDR_UNSPECIFIED(&ia6))
 			{
 				addr = anynet_ntop(&ia6, buf6, sizeof buf6);
 				message("WARNING: interface %s is UP with %s address",