version 1.17, 2003/09/04 09:17:08 |
version 1.18, 2003/12/10 11:46:33 |
Line 169 in6_selectsrc(dstsock, opts, mopts, ro, |
|
Line 169 in6_selectsrc(dstsock, opts, mopts, ro, |
|
* somewhere... |
* somewhere... |
*/ |
*/ |
if (dstsock->sin6_scope_id < 0 || |
if (dstsock->sin6_scope_id < 0 || |
if_index < dstsock->sin6_scope_id) { |
if_indexlim <= dstsock->sin6_scope_id || |
|
!ifindex2ifnet[dstsock->sin6_scope_id]) { |
*errorp = ENXIO; /* XXX: better error? */ |
*errorp = ENXIO; /* XXX: better error? */ |
return (0); |
return (0); |
} |
} |
Line 464 in6_embedscope(in6, sin6, in6p, ifpp) |
|
Line 465 in6_embedscope(in6, sin6, in6p, ifpp) |
|
in6->s6_addr16[1] = htons(ifp->if_index); |
in6->s6_addr16[1] = htons(ifp->if_index); |
} else if (scopeid) { |
} else if (scopeid) { |
/* boundary check */ |
/* boundary check */ |
if (scopeid < 0 || if_index < scopeid) |
if (scopeid < 0 || if_indexlim <= scopeid || |
|
!ifindex2ifnet[scopeid]) |
return ENXIO; /* XXX EINVAL? */ |
return ENXIO; /* XXX EINVAL? */ |
ifp = ifindex2ifnet[scopeid]; |
ifp = ifindex2ifnet[scopeid]; |
/* XXX assignment to 16bit from 32bit variable */ |
/* XXX assignment to 16bit from 32bit variable */ |
Line 508 in6_recoverscope(sin6, in6, ifp) |
|
Line 510 in6_recoverscope(sin6, in6, ifp) |
|
scopeid = ntohs(sin6->sin6_addr.s6_addr16[1]); |
scopeid = ntohs(sin6->sin6_addr.s6_addr16[1]); |
if (scopeid) { |
if (scopeid) { |
/* sanity check */ |
/* sanity check */ |
if (scopeid < 0 || if_index < scopeid) |
if (scopeid < 0 || if_indexlim <= scopeid || |
|
!ifindex2ifnet[scopeid]) |
return ENXIO; |
return ENXIO; |
if (ifp && ifp->if_index != scopeid) |
if (ifp && ifp->if_index != scopeid) |
return ENXIO; |
return ENXIO; |