summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/in6.c
diff options
context:
space:
mode:
authorjamie <jamie@FreeBSD.org>2009-05-27 14:11:23 +0000
committerjamie <jamie@FreeBSD.org>2009-05-27 14:11:23 +0000
commita013e0afcbb44052a86a7977277d669d8883b7e7 (patch)
treeb7f782d79e61a1bd80655a068684cb0fd9f39922 /sys/netinet6/in6.c
parent6e53147404a7f4fb4173694bc812d9d23efd9fef (diff)
downloadFreeBSD-src-a013e0afcbb44052a86a7977277d669d8883b7e7.zip
FreeBSD-src-a013e0afcbb44052a86a7977277d669d8883b7e7.tar.gz
Add hierarchical jails. A jail may further virtualize its environment
by creating a child jail, which is visible to that jail and to any parent jails. Child jails may be restricted more than their parents, but never less. Jail names reflect this hierarchy, being MIB-style dot-separated strings. Every thread now points to a jail, the default being prison0, which contains information about the physical system. Prison0's root directory is the same as rootvnode; its hostname is the same as the global hostname, and its securelevel replaces the global securelevel. Note that the variable "securelevel" has actually gone away, which should not cause any problems for code that properly uses securelevel_gt() and securelevel_ge(). Some jail-related permissions that were kept in global variables and set via sysctls are now per-jail settings. The sysctls still exist for backward compatibility, used only by the now-deprecated jail(2) system call. Approved by: bz (mentor)
Diffstat (limited to 'sys/netinet6/in6.c')
-rw-r--r--sys/netinet6/in6.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 60d56a8..921618e 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -660,7 +660,6 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
struct in6_ifaddr *ia, int flags)
{
INIT_VNET_INET6(ifp->if_vnet);
- INIT_VPROCG(TD_TO_VPROCG(curthread)); /* XXX V_hostname needs this */
int error = 0, hostIsNew = 0, plen = -1;
struct in6_ifaddr *oia;
struct sockaddr_in6 dst6;
@@ -1017,7 +1016,6 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
/*
* join node information group address
*/
-#define hostnamelen strlen(V_hostname)
delay = 0;
if ((flags & IN6_IFAUPDATE_DADDELAY)) {
/*
@@ -1027,10 +1025,7 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
delay = arc4random() %
(MAX_RTR_SOLICITATION_DELAY * hz);
}
- mtx_lock(&hostname_mtx);
- if (in6_nigroup(ifp, V_hostname, hostnamelen,
- &mltaddr.sin6_addr) == 0) {
- mtx_unlock(&hostname_mtx);
+ if (in6_nigroup(ifp, NULL, -1, &mltaddr.sin6_addr) == 0) {
imm = in6_joingroup(ifp, &mltaddr.sin6_addr, &error,
delay); /* XXX jinmei */
if (!imm) {
@@ -1044,9 +1039,7 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
LIST_INSERT_HEAD(&ia->ia6_memberships,
imm, i6mm_chain);
}
- } else
- mtx_unlock(&hostname_mtx);
-#undef hostnamelen
+ }
/*
* join interface-local all-nodes address.
OpenPOWER on IntegriCloud