summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorzec <zec@FreeBSD.org>2009-05-31 12:10:04 +0000
committerzec <zec@FreeBSD.org>2009-05-31 12:10:04 +0000
commit861b77b0175f90ae49506e05c337ab56500751eb (patch)
tree6885e54172e0694f4186029864fdc53c37aa9631 /sys/net/if.c
parentab797d42e47bd545852aab8db4db5d162e9a0e38 (diff)
downloadFreeBSD-src-861b77b0175f90ae49506e05c337ab56500751eb.zip
FreeBSD-src-861b77b0175f90ae49506e05c337ab56500751eb.tar.gz
Introduce an interm userland-kernel API for creating vnets and
assigning ifnets from one vnet to another. Deletion of vnets is not yet supported. The interface is implemented as an ioctl extension so that no syscalls had to be introduced. This should be acceptable given that the new interface will be used for a short / interim period only, until the new jail management framwork gains the capability of managing vnets. This method for managing vimages / vnets has been in use for the past 7 years without any observable issues. The userland tool to be used in conjunction with the interim API can be found in p4: //depot/projects/vimage-commit2/src/usr.sbin/vimage/... and will most probably never get commited to svn. While here, bump copyright notices in kern_vimage.c and vimage.h to cover work done in year 2009. Approved by: julian (mentor) Discussed with: bz, rwatson
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 7248768..4d4befc 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -2283,6 +2283,21 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td)
ifr = (struct ifreq *)data;
switch (cmd) {
+#ifdef VIMAGE
+ /*
+ * XXX vnet creation will be implemented through the new jail
+ * framework - this is just a temporary hack for testing the
+ * vnet create / destroy mechanisms.
+ */
+ case SIOCSIFVIMAGE:
+ error = vi_if_move((struct vi_req *) data, NULL,
+ TD_TO_VIMAGE(td));
+ return (error);
+ case SIOCSPVIMAGE:
+ case SIOCGPVIMAGE:
+ error = vi_td_ioctl(cmd, (struct vi_req *) data, td);
+ return (error);
+#endif
case SIOCIFCREATE:
case SIOCIFCREATE2:
error = priv_check(td, PRIV_NET_IFCREATE);
OpenPOWER on IntegriCloud