Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Jan 2012 09:01:19 +0000 (UTC)
From:      Hajimu UMEMOTO <ume@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r229766 - in head: lib/libc/net sbin/route
Message-ID:  <201201070901.q0791JRm032864@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ume
Date: Sat Jan  7 09:01:19 2012
New Revision: 229766
URL: http://svn.freebsd.org/changeset/base/229766

Log:
  Handle the internal scope address representation of the KAME IPv6
  stack for the node-local multicast address.
  
  Spotted by:	Rainer Bredehorn <Bredehorn__at__gmx.de>
  MFC after:	1 week

Modified:
  head/lib/libc/net/getaddrinfo.c
  head/sbin/route/route.c

Modified: head/lib/libc/net/getaddrinfo.c
==============================================================================
--- head/lib/libc/net/getaddrinfo.c	Sat Jan  7 04:13:25 2012	(r229765)
+++ head/lib/libc/net/getaddrinfo.c	Sat Jan  7 09:01:19 2012	(r229766)
@@ -1576,7 +1576,8 @@ ip6_str2scopeid(char *scope, struct sock
 	if (*scope == '\0')
 		return -1;
 
-	if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6)) {
+	if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6) ||
+	    IN6_IS_ADDR_MC_NODELOCAL(a6)) {
 		/*
 		 * We currently assume a one-to-one mapping between links
 		 * and interfaces, so we simply use interface indices for

Modified: head/sbin/route/route.c
==============================================================================
--- head/sbin/route/route.c	Sat Jan  7 04:13:25 2012	(r229765)
+++ head/sbin/route/route.c	Sat Jan  7 09:01:19 2012	(r229766)
@@ -375,7 +375,8 @@ routename(struct sockaddr *sa)
 #ifdef __KAME__
 		if (sa->sa_len == sizeof(struct sockaddr_in6) &&
 		    (IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr) ||
-		     IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr)) &&
+		     IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr) ||
+		     IN6_IS_ADDR_MC_NODELOCAL(&sin6.sin6_addr)) &&
 		    sin6.sin6_scope_id == 0) {
 			sin6.sin6_scope_id =
 			    ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]);
@@ -500,7 +501,8 @@ netname(struct sockaddr *sa)
 #ifdef __KAME__
 		if (sa->sa_len == sizeof(struct sockaddr_in6) &&
 		    (IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr) ||
-		     IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr)) &&
+		     IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr) ||
+		     IN6_IS_ADDR_MC_NODELOCAL(&sin6.sin6_addr)) &&
 		    sin6.sin6_scope_id == 0) {
 			sin6.sin6_scope_id =
 			    ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]);
@@ -1002,7 +1004,8 @@ getaddr(int which, char *str, struct hos
 		memcpy(&su->sin6, res->ai_addr, sizeof(su->sin6));
 #ifdef __KAME__
 		if ((IN6_IS_ADDR_LINKLOCAL(&su->sin6.sin6_addr) ||
-		     IN6_IS_ADDR_MC_LINKLOCAL(&su->sin6.sin6_addr)) &&
+		     IN6_IS_ADDR_MC_LINKLOCAL(&su->sin6.sin6_addr) ||
+		     IN6_IS_ADDR_MC_NODELOCAL(&su->sin6.sin6_addr)) &&
 		    su->sin6.sin6_scope_id) {
 			*(u_int16_t *)&su->sin6.sin6_addr.s6_addr[2] =
 				htons(su->sin6.sin6_scope_id);



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