summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/in6_src.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2003-10-21 20:05:32 +0000
committerume <ume@FreeBSD.org>2003-10-21 20:05:32 +0000
commit5199c863f8f9e7f134710595dee582ad037bffb6 (patch)
tree56bbb38b63af457fee9d7a7dcb4dabbee7fdf438 /sys/netinet6/in6_src.c
parentcf8253f2389748ecf024ef70a17807c7d6d733ee (diff)
downloadFreeBSD-src-5199c863f8f9e7f134710595dee582ad037bffb6.zip
FreeBSD-src-5199c863f8f9e7f134710595dee582ad037bffb6.tar.gz
- change scope to zone.
- change node-local to interface-local. - better error handling of address-to-scope mapping. - use in6_clearscope(). Obtained from: KAME
Diffstat (limited to 'sys/netinet6/in6_src.c')
-rw-r--r--sys/netinet6/in6_src.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c
index 6f81fe7..aa520b6 100644
--- a/sys/netinet6/in6_src.c
+++ b/sys/netinet6/in6_src.c
@@ -190,7 +190,7 @@ in6_selectsrc(dstsock, opts, mopts, ro, laddr, errorp)
if (IN6_IS_ADDR_MULTICAST(dst)) {
struct ifnet *ifp = mopts ? mopts->im6o_multicast_ifp : NULL;
- if (ifp == NULL && IN6_IS_ADDR_MC_NODELOCAL(dst)) {
+ if (ifp == NULL && IN6_IS_ADDR_MC_INTFACELOCAL(dst)) {
ifp = &loif[0];
}
@@ -498,7 +498,7 @@ in6_recoverscope(sin6, in6, ifp)
const struct in6_addr *in6;
struct ifnet *ifp;
{
- u_int32_t scopeid;
+ u_int32_t zoneid;
sin6->sin6_addr = *in6;
@@ -508,19 +508,19 @@ in6_recoverscope(sin6, in6, ifp)
*/
sin6->sin6_scope_id = 0;
- if (IN6_IS_SCOPE_LINKLOCAL(in6)) {
+ if (IN6_IS_SCOPE_LINKLOCAL(in6) || IN6_IS_ADDR_MC_INTFACELOCAL(in6)) {
/*
* KAME assumption: link id == interface id
*/
- scopeid = ntohs(sin6->sin6_addr.s6_addr16[1]);
- if (scopeid) {
+ zoneid = ntohs(sin6->sin6_addr.s6_addr16[1]);
+ if (zoneid) {
/* sanity check */
- if (scopeid < 0 || if_index < scopeid)
+ if (zoneid < 0 || if_index < zoneid)
return ENXIO;
- if (ifp && ifp->if_index != scopeid)
+ if (ifp && ifp->if_index != zoneid)
return ENXIO;
sin6->sin6_addr.s6_addr16[1] = 0;
- sin6->sin6_scope_id = scopeid;
+ sin6->sin6_scope_id = zoneid;
}
}
@@ -529,12 +529,11 @@ in6_recoverscope(sin6, in6, ifp)
/*
* just clear the embedded scope identifier.
- * XXX: currently used for bsdi4 only as a supplement function.
*/
void
in6_clearscope(addr)
struct in6_addr *addr;
{
- if (IN6_IS_SCOPE_LINKLOCAL(addr))
+ if (IN6_IS_SCOPE_LINKLOCAL(addr) || IN6_IS_ADDR_MC_INTFACELOCAL(addr))
addr->s6_addr16[1] = 0;
}
OpenPOWER on IntegriCloud