if.c (193983) | if.c (194251) |
---|---|
1/*- 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)if.c 8.5 (Berkeley) 1/9/95 | 1/*- 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)if.c 8.5 (Berkeley) 1/9/95 |
30 * $FreeBSD: head/sys/net/if.c 193983 2009-06-11 10:26:38Z bz $ | 30 * $FreeBSD: head/sys/net/if.c 194251 2009-06-15 18:59:29Z jamie $ |
31 */ 32 33#include "opt_compat.h" 34#include "opt_inet6.h" 35#include "opt_inet.h" 36#include "opt_carp.h" 37 38#include <sys/param.h> --- 2083 unchanged lines hidden (view full) --- 2122 sdl->sdl_data[--namelen] = 0xff; 2123 IFA_UNLOCK(ifa); 2124 2125 EVENTHANDLER_INVOKE(ifnet_arrival_event, ifp); 2126 /* Announce the return of the interface. */ 2127 rt_ifannouncemsg(ifp, IFAN_ARRIVAL); 2128 break; 2129 | 31 */ 32 33#include "opt_compat.h" 34#include "opt_inet6.h" 35#include "opt_inet.h" 36#include "opt_carp.h" 37 38#include <sys/param.h> --- 2083 unchanged lines hidden (view full) --- 2122 sdl->sdl_data[--namelen] = 0xff; 2123 IFA_UNLOCK(ifa); 2124 2125 EVENTHANDLER_INVOKE(ifnet_arrival_event, ifp); 2126 /* Announce the return of the interface. */ 2127 rt_ifannouncemsg(ifp, IFAN_ARRIVAL); 2128 break; 2129 |
2130#ifdef VIMAGE 2131 case SIOCSIFVNET: 2132 error = priv_check(td, PRIV_NET_SETIFVNET); 2133 if (error) 2134 return (error); 2135 error = vi_if_move(td, ifp, ifr->ifr_name, ifr->ifr_jid, NULL); 2136 break; 2137#endif 2138 |
|
2130 case SIOCSIFMETRIC: 2131 error = priv_check(td, PRIV_NET_SETIFMETRIC); 2132 if (error) 2133 return (error); 2134 ifp->if_metric = ifr->ifr_metric; 2135 getmicrotime(&ifp->if_lastchange); 2136 break; 2137 --- 170 unchanged lines hidden (view full) --- 2308 case SIOCGIFCONF32: 2309#endif 2310 return (ifconf(cmd, data)); 2311 } 2312 ifr = (struct ifreq *)data; 2313 2314 switch (cmd) { 2315#ifdef VIMAGE | 2139 case SIOCSIFMETRIC: 2140 error = priv_check(td, PRIV_NET_SETIFMETRIC); 2141 if (error) 2142 return (error); 2143 ifp->if_metric = ifr->ifr_metric; 2144 getmicrotime(&ifp->if_lastchange); 2145 break; 2146 --- 170 unchanged lines hidden (view full) --- 2317 case SIOCGIFCONF32: 2318#endif 2319 return (ifconf(cmd, data)); 2320 } 2321 ifr = (struct ifreq *)data; 2322 2323 switch (cmd) { 2324#ifdef VIMAGE |
2325 case SIOCSIFRVNET: 2326 error = priv_check(td, PRIV_NET_SETIFVNET); 2327 if (error) 2328 return (error); 2329 return (vi_if_move(td, NULL, ifr->ifr_name, ifr->ifr_jid, 2330 NULL)); |
|
2316 /* 2317 * XXX vnet creation will be implemented through the new jail 2318 * framework - this is just a temporary hack for testing the 2319 * vnet create / destroy mechanisms. 2320 */ 2321 case SIOCSIFVIMAGE: | 2331 /* 2332 * XXX vnet creation will be implemented through the new jail 2333 * framework - this is just a temporary hack for testing the 2334 * vnet create / destroy mechanisms. 2335 */ 2336 case SIOCSIFVIMAGE: |
2322 error = vi_if_move((struct vi_req *) data, NULL, 2323 TD_TO_VIMAGE(td)); | 2337 error = vi_if_move(td, NULL, NULL, 0, (struct vi_req *) data); |
2324 return (error); 2325 case SIOCSPVIMAGE: 2326 case SIOCGPVIMAGE: 2327 error = vi_td_ioctl(cmd, (struct vi_req *) data, td); 2328 return (error); 2329#endif 2330 case SIOCIFCREATE: 2331 case SIOCIFCREATE2: --- 899 unchanged lines hidden --- | 2338 return (error); 2339 case SIOCSPVIMAGE: 2340 case SIOCGPVIMAGE: 2341 error = vi_td_ioctl(cmd, (struct vi_req *) data, td); 2342 return (error); 2343#endif 2344 case SIOCIFCREATE: 2345 case SIOCIFCREATE2: --- 899 unchanged lines hidden --- |