Date: Sun, 9 Nov 2014 22:54:41 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274334 - head/sys/netinet6 Message-ID: <201411092254.sA9MsfKM059580@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ae Date: Sun Nov 9 22:54:40 2014 New Revision: 274334 URL: https://svnweb.freebsd.org/changeset/base/274334 Log: Use embedded scope zone id to determine outgoing interface for link-local and node-local addresses. Modified: head/sys/netinet6/in6_src.c Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Sun Nov 9 22:43:29 2014 (r274333) +++ head/sys/netinet6/in6_src.c Sun Nov 9 22:54:40 2014 (r274334) @@ -555,6 +555,7 @@ selectroute(struct sockaddr_in6 *dstsock struct sockaddr_in6 *sin6_next; struct in6_pktinfo *pi = NULL; struct in6_addr *dst = &dstsock->sin6_addr; + uint32_t zoneid; #if 0 char ip6buf[INET6_ADDRSTRLEN]; @@ -585,7 +586,18 @@ selectroute(struct sockaddr_in6 *dstsock } else goto getroute; } - + /* + * If destination address is LLA or link- or node-local multicast, + * use it's embedded scope zone id to determine outgoing interface. + */ + if (IN6_IS_SCOPE_LINKLOCAL(dst) || + IN6_IS_ADDR_MC_NODELOCAL(dst)) { + zoneid = ntohs(in6_getscope(dst)); + if (zoneid > 0) { + ifp = in6_getlinkifnet(zoneid); + goto done; + } + } /* * If the destination address is a multicast address and the outgoing * interface for the address is specified by the caller, use it.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411092254.sA9MsfKM059580>