aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linux/linux_ioctl.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r358838:Hans Petter Selasky2020-03-131-0/+3
| | | | | | | | | | Add support for the device statistics IOCTL, needed by the coming linux_libusb upgrade. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=358941
* MFC r332042: Fix kernel memory disclosure in linux_ioctl_socketEd Maste2018-04-051-0/+1
| | | | | | | | | | | | | | strlcpy is used to copy a string into a buffer to be copied to userland, previously leaving uninitialized data after the terminating NUL. Zero the buffer first to avoid a kernel memory disclosure. admbugs: 765, 811 Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> Reported by: Vlad Tsyrklevich Sponsored by: The FreeBSD Foundation Notes: svn path=/stable/10/; revision=332064
* MFC r332034: linux_ioctl_hdio: fix kernel memory disclosureEd Maste2018-04-051-0/+1
| | | | | | | | | | | | | Stack-allocated struct linux_hd_big_geometry has undeclared padding copied to userland. admbugs: 765 Reported by: Vlad Tsyrklevich Security: Kernel memory disclosure Sponsored by: The FreeBSD Foundation Notes: svn path=/stable/10/; revision=332063
* MFC r298071 (by pfg@):Dmitry Chagin2017-07-151-1/+1
| | | | | | | | | | | compat/linux: for pointers replace 0 with NULL. plvc is a pointer, no functional change. Found with devel/coccinelle. Notes: svn path=/stable/10/; revision=321025
* MFC r305896:Dmitry Chagin2016-09-241-0/+9
| | | | | | | | | Implement BLKSSZGET ioctl for the Linuxulator. PR: 212700 Notes: svn path=/stable/10/; revision=306294
* MFC r300569:Dmitry Chagin2016-06-051-1/+1
| | | | | | | | | Don't leak fp in case where fo_ioctl() returns an error. Reported by: C Turt <ecturt@gmail.com> Notes: svn path=/stable/10/; revision=301430
* Merge r301053:Gleb Smirnoff2016-05-311-0/+2
| | | | | | | | | | Fix kernel stack disclosures in the Linux and 4.3BSD compat layers. Security: SA-16:20 Security: SA-16:21 Notes: svn path=/stable/10/; revision=301054
* MFC r283496:Dmitry Chagin2016-01-091-3/+10
| | | | | | | | | | The latest cp tool is trying to use the btrfs clone operation that is implemented via ioctl interface. First of all return ENOTSUP for this operation as a cp fallback to usual method in that case. Secondly, do not print out the message about unimplemented operation. Notes: svn path=/stable/10/; revision=293596
* MFC r283483:Dmitry Chagin2016-01-091-4/+10
| | | | | | | | | Convert signal number to native for VT_SETMODE ioctl and remove strange and invalid ISSIGVALID macro. The code has not been tested right way but it was originally broken. Notes: svn path=/stable/10/; revision=293584
* MFC r283423:Dmitry Chagin2016-01-091-3/+0
| | | | | | | Move FEATURE macros for v4l and v4l2 to the common module. Notes: svn path=/stable/10/; revision=293529
* MFC r283421:Dmitry Chagin2016-01-091-29/+0
| | | | | | | | | | | | | | | | | | | | | | Introduce a new module linux_common.ko which is intended for the following primary purposes: 1. Remove the dependency of linsysfs and linprocfs modules from linux.ko, which will be architecture specific on amd64. 2. Incorporate into linux_common.ko general code for platforms on which we'll support two Linuxulator modules (for both instruction set - 32 & 64 bit). 3. Move malloc(9) declaration to linux_common.ko, to enable getting memory usage statistics properly. Currently linux_common.ko incorporates a code from linux_mib.c and linux_util.c and linprocfs, linsysfs and linux kernel modules depend on linux_common.ko. Temporarily remove dtrace garbage from linux_mib.c and linux_util.c Notes: svn path=/stable/10/; revision=293527
* Merge r263233 from HEAD to stable/10:Robert Watson2015-03-191-1/+1
| | | | | | | | | | | | Update kernel inclusions of capability.h to use capsicum.h instead; some further refinement is required as some device drivers intended to be portable over FreeBSD versions rely on __FreeBSD_version to decide whether to include capability.h. Sponsored by: Google, Inc. Notes: svn path=/stable/10/; revision=280258
* MFC r272059:Alexander Motin2014-09-271-13/+2
| | | | | | | | | | | Remake Linux' SOUND_MIXER_INFO IOCTL as a wrapper around new FreeBSD's one. Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> Approved by: re (kib) Notes: svn path=/stable/10/; revision=272204
* MFC r267051:Alexander Motin2014-07-041-0/+3
| | | | | | | | | - Add support for SG_GET_SG_TABLESIZE IOCTL to report that we don't support scatter/gather lists. - Return error for still unsupported SG 3.x API read/write calls. Notes: svn path=/stable/10/; revision=268255
* MFC r266981:Alexander Motin2014-07-021-5/+124
| | | | | | | | | | | | | | | | | | | Overhaul CAM SG driver IOCTL interfaces. Make it really work for native FreeBSD programs. Before this it was broken for years due to different number of pointer dereferences in Linux and FreeBSD IOCTL paths, permanently returning errors to FreeBSD programs. This change breaks the driver FreeBSD IOCTL ABI, making it more strict, but since it was not working any way -- who bother. Add shims for 32-bit programs on 64-bit host, translating the argument of the SG_IO IOCTL for both FreeBSD and Linux ABIs. With this change I was able to run 32-bit Linux sg3_utils tools and simple 32 and 64-bit FreeBSD test tools on both 32 and 64-bit FreeBSD systems. Notes: svn path=/stable/10/; revision=268139
* Change the cap_rights_t type from uint64_t to a structure that we can extendPawel Jakub Dawidek2013-09-051-20/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in the future in a backward compatible (API and ABI) way. The cap_rights_t represents capability rights. We used to use one bit to represent one right, but we are running out of spare bits. Currently the new structure provides place for 114 rights (so 50 more than the previous cap_rights_t), but it is possible to grow the structure to hold at least 285 rights, although we can make it even larger if 285 rights won't be enough. The structure definition looks like this: struct cap_rights { uint64_t cr_rights[CAP_RIGHTS_VERSION + 2]; }; The initial CAP_RIGHTS_VERSION is 0. The top two bits in the first element of the cr_rights[] array contain total number of elements in the array - 2. This means if those two bits are equal to 0, we have 2 array elements. The top two bits in all remaining array elements should be 0. The next five bits in all array elements contain array index. Only one bit is used and bit position in this five-bits range defines array index. This means there can be at most five array elements in the future. To define new right the CAPRIGHT() macro must be used. The macro takes two arguments - an array index and a bit to set, eg. #define CAP_PDKILL CAPRIGHT(1, 0x0000000000000800ULL) We still support aliases that combine few rights, but the rights have to belong to the same array element, eg: #define CAP_LOOKUP CAPRIGHT(0, 0x0000000000000400ULL) #define CAP_FCHMOD CAPRIGHT(0, 0x0000000000002000ULL) #define CAP_FCHMODAT (CAP_FCHMOD | CAP_LOOKUP) There is new API to manage the new cap_rights_t structure: cap_rights_t *cap_rights_init(cap_rights_t *rights, ...); void cap_rights_set(cap_rights_t *rights, ...); void cap_rights_clear(cap_rights_t *rights, ...); bool cap_rights_is_set(const cap_rights_t *rights, ...); bool cap_rights_is_valid(const cap_rights_t *rights); void cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src); void cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src); bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little); Capability rights to the cap_rights_init(), cap_rights_set(), cap_rights_clear() and cap_rights_is_set() functions are provided by separating them with commas, eg: cap_rights_t rights; cap_rights_init(&rights, CAP_READ, CAP_WRITE, CAP_FSTAT); There is no need to terminate the list of rights, as those functions are actually macros that take care of the termination, eg: #define cap_rights_set(rights, ...) \ __cap_rights_set((rights), __VA_ARGS__, 0ULL) void __cap_rights_set(cap_rights_t *rights, ...); Thanks to using one bit as an array index we can assert in those functions that there are no two rights belonging to different array elements provided together. For example this is illegal and will be detected, because CAP_LOOKUP belongs to element 0 and CAP_PDKILL to element 1: cap_rights_init(&rights, CAP_LOOKUP | CAP_PDKILL); Providing several rights that belongs to the same array's element this way is correct, but is not advised. It should only be used for aliases definition. This commit also breaks compatibility with some existing Capsicum system calls, but I see no other way to do that. This should be fine as Capsicum is still experimental and this change is not going to 9.x. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=255219
* Add some missing LIBUSB IOCTL conversion codes.Hans Petter Selasky2013-07-141-0/+9
| | | | Notes: svn path=/head/; revision=253338
* - Move videodev headers from compat/linux to contrib/v4l (cp from vendor andAlexander Leidinger2013-07-061-2/+2
| | | | | | | | | | | | | apply diff to compat/linux versions). - The cp implies an update of videodev2.h to the linux kernel 2.6.34.14 one. The update makes video in skype v4 work on FreeBSD. Tested by: Artyom Mirgorodskiy <artyom.mirgorodsky@gmail.com> (update of header only) Notes: svn path=/head/; revision=252892
* MFS security patches which seem to have accidentally not reached HEAD:Colin Percival2012-11-231-2/+3
| | | | | | | | | | | | | | Fix insufficient message length validation for EAP-TLS messages. Fix Linux compatibility layer input validation error. Security: FreeBSD-SA-12:07.hostapd Security: FreeBSD-SA-12:08.linux Security: CVE-2012-4445, CVE-2012-4576 With hat: so@ Notes: svn path=/head/; revision=243419
* Convert files to UTF-8Ulrich Spörlein2012-01-151-1/+1
| | | | Notes: svn path=/head/; revision=230132
* In sys/compat/linux/linux_ioctl.c, work around a warning when a pointerDimitry Andric2012-01-031-1/+1
| | | | | | | | | | | is compared to an integer, by casting the pointer to l_uintptr_t. No functional difference on both i386 and amd64. Reviewed by: ed, jhb MFC after: 1 week Notes: svn path=/head/; revision=229402
* In order to maximize the re-usability of kernel code in user space thisKip Macy2011-09-161-127/+127
| | | | | | | | | | | | | | | | patch modifies makesyscalls.sh to prefix all of the non-compatibility calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel entry points and all places in the code that use them. It also fixes an additional name space collision between the kernel function psignal and the libc function of the same name by renaming the kernel psignal kern_psignal(). By introducing this change now we will ease future MFCs that change syscalls. Reviewed by: rwatson Approved by: re (bz) Notes: svn path=/head/; revision=225617
* Second-to-last commit implementing Capsicum capabilities in the FreeBSDRobert Watson2011-08-111-20/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kernel for FreeBSD 9.0: Add a new capability mask argument to fget(9) and friends, allowing system call code to declare what capabilities are required when an integer file descriptor is converted into an in-kernel struct file *. With options CAPABILITIES compiled into the kernel, this enforces capability protection; without, this change is effectively a no-op. Some cases require special handling, such as mmap(2), which must preserve information about the maximum rights at the time of mapping in the memory map so that they can later be enforced in mprotect(2) -- this is done by narrowing the rights in the existing max_protection field used for similar purposes with file permissions. In namei(9), we assert that the code is not reached from within capability mode, as we're not yet ready to enforce namespace capabilities there. This will follow in a later commit. Update two capability names: CAP_EVENT and CAP_KEVENT become CAP_POST_KEVENT and CAP_POLL_KEVENT to more accurately indicate what they represent. Approved by: re (bz) Submitted by: jonathan Sponsored by: Google Inc Notes: svn path=/head/; revision=224778
* Add FEATURE macros for v4l and v4l2 to the linuxulator.Alexander Leidinger2011-05-041-0/+4
| | | | | | | Suggested by: ae Notes: svn path=/head/; revision=221428
* This is v4l2 support for the linuxulator. This allows to access FreeBSDAlexander Leidinger2011-05-041-0/+306
| | | | | | | | | | | | native devices which support the v4l2 API from processes running within the linuxulator, e.g. skype or flash can access the multimedia/pwcbsd or multimedia/webcamd supplied drivers. Submitted by: nox MFC after: 1 month Notes: svn path=/head/; revision=221426
* Fix the LINUX_SOUND_MIXER_INFO ioctl to return success after theSean Farley2010-12-301-2/+6
| | | | | | | | | | | | | | | information is set to FreeBSD. It had been falling through to the end of linux_ioctl_sound() and returning ENOIOCTL. Noticed when running the Linux ALSA amixer tool. Add a LINUX_SOUND_MIXER_READ_CAPS ioctl which is used by the Skype v2.1.0.81 binary. Reviewed by: gavin MFC after: 2 weeks Notes: svn path=/head/; revision=216813
* Replace sbuf_overflowed() with sbuf_error(), which returns any errorMatthew D Fleming2010-09-101-2/+2
| | | | | | | | | code associated with overflow or with the drain function. While this function is not expected to be used often, it produces more information in the form of an errno that sbuf_overflowed() did. Notes: svn path=/head/; revision=212425
* Bring USB fixes for linux(4).Wojciech A. Koszek2010-05-241-11/+111
| | | | | | | | | | | | | | | | | | | | | | | | | Intention of this commit is to let us take a full advantage of libusb(8) ported to Linux. This decreases a possibility of getting any collisions within ioctl() "command" space, especially with relation to LINUX_SNDCTL_SEQ... stuff. Basically, we provide commands, that will be mapped in the kernel to correct ones and forward those to the USB layer. Port enabling functionality brought with this patch is here: http://www.freebsd.org/cgi/query-pr.cgi?pr=146895 Bump __FreeBSD_version to catch, since which version installing a port makes sense. This patch should bring no regressions. So far, only i386 is tested. Tested by: thompsa@ Reviewed by: thompsa@ OKed by: netchild@ Notes: svn path=/head/; revision=208486
* - #ifdef out the cliplist part, skype seems like using an uninitializedAlexander Leidinger2010-05-031-7/+24
| | | | | | | | | | | | | variable and can cause problems, without the cliplist handling it works without problems - improve the cliplist error handling - fix VIDIOCGTUNER and VIDIOCSMICROCODE (still no hardware available to test) Submitted by: J.R. Oldroyd <jr@opal.com> X-MFC after: soon (together with all the v4l stuff) Notes: svn path=/head/; revision=207569
* Fix some problems which may lead to a panic:Alexander Leidinger2010-03-261-1/+3
| | | | | | | | | | - right order of src and dst in memcpy - NULL out the clips after freeing to prevent an accident Noticed by: hselasky Notes: svn path=/head/; revision=205678
* Let us to use our libusb(3) in Linuxolator.Wojciech A. Koszek2010-01-181-0/+22
| | | | | | | | | | | | | | With this change, Linux binaries can work with our libusb(3) when it's compiled against our header files on GNU/Linux system -- this solves the problem with differences between /dev layouts. With ported libusb(3), I am able to use my USB JTAG cable with Linux binaries that support it. Reviewed by: thompsa Notes: svn path=/head/; revision=202598
* Whitespace change to be able to provide the correct commit log for r202364:Alexander Leidinger2010-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---snip--- Add video clipping support but with the caveats below. Background info: Video clipping allows the user to provide either a series of clip rectangles or a clip bitmap to the driver and have the driver mask the video according to the clipping specs provided. Adding support for clipping to the FreeBSD Linux emulator is problematic because it seems that this feature is not supported by many drivers and therefore it is ignored by many applications. Unfortunately, when not using it, rather than passing in a null clipping list, some apps leave the clipping fields uninitialized, casuing random values to be passed in. In the case where the driver does not use the clipping info, this is not a problem (although it is bad form). But the Linux emulator does not know which drivers will use this and which won't, so the Linux emulator must try to handle this clip list, and deal gracefully with cases where the values seem to be uninitialized. Video clipping info is passed in using the VIDIOCSWIN ioctl in two fields in the video_window structure: the integer clipcount and the pointer clips. How the linuxulator handles this from this commit on: * if (clipcount == VIDEO_CLIP_BITMAP) The clips variable is a void * pointer to a 128*625 byte (1024*625 bit) memory area containing a bitmap of the clipping area. The pointer in the video_window structure is copied, but no video_clip structures are copied. * if (clipcount > 0 && clipcount <= 16384) The clips variable is pointer to a list of video_clip structures. Up to clipcount structures are copied and passed to the driver. The upper limit of 16384 was imposed here so that user code that does not properly initialize clipcount falls through below and no attempt is made to copy an uninitialized list. This value was found by examining Linux drivers that support the clip list. * else The clipcount is either negative (but not VIDEO_CLIP_BITMAP), zero or positive (> 16384). All these cases are treated as invalid data. Both the clipcount field and clips pointer are forced to zero/NULL and passed to the driver. It should be noted that, at the time of developing this V4L emulator code, the pwc(4) V4L driver does not support clipping. Submitted by: J.R. Oldroyd <fbsd@opal.com> MFC after: 1 month ---snip--- Notes: svn path=/head/; revision=202376
* This is v4l support for the linuxulator. This allows to access FreeBSDAlexander Leidinger2010-01-151-33/+80
| | | | | | | | | | | | | | | | | | native devices which support the v4l API from processes running within the linuxulator, e.g. skype or flash can access the multimedia/pwcbsd driver. Not tested is firmware upload, framebuffer stuff and video tuner stuff due to lack of hardware. The clipping part (VIDIOCSWIN) needs a little bit of further work (partly in progress, but can not be tested due to lack of a suitable device). The submitter tested this sucessfully with Skype and flash apps on amd64 and i386 with the multimedia/pwcbsd driver. Submitted by: J.R. Oldroyd <fbsd@opal.com> Notes: svn path=/head/; revision=202364
* This is v4l support for the linuxulator. This allows to access FreeBSDAlexander Leidinger2009-12-041-0/+296
| | | | | | | | | | | | | | | | | | native devices which support the v4l API from processes running within the linuxulator, e.g. skype or flash can access the multimedia/pwcbsd driver. Not tested is firmware upload, framebuffer stuff and video tuner stuff due to lack of hardware. The clipping part (VIDIOCSWIN) needs a little bit of further work (partly in progress, but can not be tested due to lack of a suitable device). The submitter tested this sucessfully with Skype and flash apps on amd64 and i386 with the multimedia/pwcbsd driver. Submitted by: J.R. Oldroyd <fbsd@opal.com> Notes: svn path=/head/; revision=200110
* Lock the ifnet list while iterating over it.Marko Zec2009-09-131-0/+2
| | | | | | | | Submitted by: julian MFC after: 3 days Notes: svn path=/head/; revision=197176
* Fix a few panics in linuxulator + VIMAGE due to curvnet not being set.Marko Zec2009-08-281-1/+8
| | | | | | | | | | This change affects only options VIMAGE builds. Reviewed by: julian MFC after: 3 days Notes: svn path=/head/; revision=196635
* Rework global locks for interface list and index management, correctingRobert Watson2009-08-231-6/+4
| | | | | | | | | | | | | | | | | several critical bugs, including race conditions and lock order issues: Replace the single rwlock, ifnet_lock, with two locks, an rwlock and an sxlock. Either can be held to stablize the lists and indexes, but both are required to write. This allows the list to be held stable in both network interrupt contexts and sleepable user threads across sleeping memory allocations or device driver interactions. As before, writes to the interface list must occur from sleepable contexts. Reviewed by: bz, julian MFC after: 3 days Notes: svn path=/head/; revision=196481
* Merge the remainder of kern_vimage.c and vimage.h into vnet.c andRobert Watson2009-08-011-1/+0
| | | | | | | | | | | | | vnet.h, we now use jails (rather than vimages) as the abstraction for virtualization management, and what remained was specific to virtual network stacks. Minor cleanups are done in the process, and comments updated to reflect these changes. Reviewed by: bz Approved by: re (vimage blanket) Notes: svn path=/head/; revision=196019
* Build on Jeff Roberson's linker-set based dynamic per-CPU allocatorRobert Watson2009-07-141-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (DPCPU), as suggested by Peter Wemm, and implement a new per-virtual network stack memory allocator. Modify vnet to use the allocator instead of monolithic global container structures (vinet, ...). This change solves many binary compatibility problems associated with VIMAGE, and restores ELF symbols for virtualized global variables. Each virtualized global variable exists as a "reference copy", and also once per virtual network stack. Virtualized global variables are tagged at compile-time, placing the in a special linker set, which is loaded into a contiguous region of kernel memory. Virtualized global variables in the base kernel are linked as normal, but those in modules are copied and relocated to a reserved portion of the kernel's vnet region with the help of a the kernel linker. Virtualized global variables exist in per-vnet memory set up when the network stack instance is created, and are initialized statically from the reference copy. Run-time access occurs via an accessor macro, which converts from the current vnet and requested symbol to a per-vnet address. When "options VIMAGE" is not compiled into the kernel, normal global ELF symbols will be used instead and indirection is avoided. This change restores static initialization for network stack global variables, restores support for non-global symbols and types, eliminates the need for many subsystem constructors, eliminates large per-subsystem structures that caused many binary compatibility issues both for monitoring applications (netstat) and kernel modules, removes the per-function INIT_VNET_*() macros throughout the stack, eliminates the need for vnet_symmap ksym(2) munging, and eliminates duplicate definitions of virtualized globals under VIMAGE_GLOBALS. Bump __FreeBSD_version and update UPDATING. Portions submitted by: bz Reviewed by: bz, zec Discussed with: gnn, jamie, jeff, jhb, julian, sam Suggested by: peter Approved by: re (kensmith) Notes: svn path=/head/; revision=195699
* After cleaning up rt_tables from vnet.h and cleaning up opt_route.hBjoern A. Zeeb2009-06-231-1/+0
| | | | | | | | a lot of files no longer need route.h either. Garbage collect them. While here remove now unneeded vnet.h #includes as well. Notes: svn path=/head/; revision=194739
* Add explicit includes for jail.h to the files that need them andBjoern A. Zeeb2009-06-171-0/+1
| | | | | | | remove the "hidden" one from vimage.h. Notes: svn path=/head/; revision=194368
* Get vnets from creds instead of threads where they're available, and fromJamie Gritton2009-06-151-3/+3
| | | | | | | | | | passed threads instead of curthread. Reviewed by: zec, julian Approved by: bz (mentor) Notes: svn path=/head/; revision=194252
* After r193232 rt_tables in vnet.h are no longer indirectly dependent onBjoern A. Zeeb2009-06-081-1/+0
| | | | | | | | | | | | the ROUTETABLES kernel option thus there is no need to include opt_route.h anymore in all consumers of vnet.h and no longer depend on it for module builds. Remove the hidden include in flowtable.h as well and leave the two explicit #includes in ip_input.c and ip_output.c. Notes: svn path=/head/; revision=193744
* linux_ioctl_cdrom: reduce stack usageAndriy Gapon2009-05-271-11/+16
| | | | | | | | | | | | | | ... by moving two ~2KB structures from stack to heap allocation. I experienced stack overflow in linux emulation on i386 (8K stack) when LINUX_DVD_READ_STRUCT ioctl was performed on atapicam cd device and there was an error that resulted in additional quite heavy stack use in cam layer. Reviewed by: dchagin Approved by: jhb (mentor) Notes: svn path=/head/; revision=192899
* To avoid excessive code duplication move MI definitions to the MIDmitry Chagin2009-05-071-0/+1
| | | | | | | | | | header file. As it is defined in Linux. Approved by: kib (mentor) MFC after: 1 month Notes: svn path=/head/; revision=191876
* For all files including net/vnet.h directly include opt_route.h andBjoern A. Zeeb2009-02-271-0/+2
| | | | | | | | | | | | | | | | | net/route.h. Remove the hidden include of opt_route.h and net/route.h from net/vnet.h. We need to make sure that both opt_route.h and net/route.h are included before net/vnet.h because of the way MRT figures out the number of FIBs from the kernel option. If we do not, we end up with the default number of 1 when including net/vnet.h and array sizes are wrong. This does not change the list of files which depend on opt_route.h but we can identify them now more easily. Notes: svn path=/head/; revision=189106
* Rather than using hidden includes (with cicular dependencies),Bjoern A. Zeeb2008-12-021-0/+1
| | | | | | | | | | | | | | directly include only the header files needed. This reduces the unneeded spamming of various headers into lots of files. For now, this leaves us with very few modules including vnet.h and thus needing to depend on opt_route.h. Reviewed by: brooks, gnn, des, zec, imp Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=185571
* Retire the MALLOC and FREE macros. They are an abomination unto style(9).Dag-Erling Smørgrav2008-10-231-2/+2
| | | | | | | MFC after: 3 months Notes: svn path=/head/; revision=184205
* Step 1.5 of importing the network stack virtualization infrastructureMarko Zec2008-10-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from the vimage project, as per plan established at devsummit 08/08: http://wiki.freebsd.org/Image/Notes200808DevSummit Introduce INIT_VNET_*() initializer macros, VNET_FOREACH() iterator macros, and CURVNET_SET() context setting macros, all currently resolving to NOPs. Prepare for virtualization of selected SYSCTL objects by introducing a family of SYSCTL_V_*() macros, currently resolving to their global counterparts, i.e. SYSCTL_V_INT() == SYSCTL_INT(). Move selected #defines from sys/sys/vimage.h to newly introduced header files specific to virtualized subsystems (sys/net/vnet.h, sys/netinet/vinet.h etc.). All the changes are verified to have zero functional impact at this point in time by doing MD5 comparision between pre- and post-change object files(*). (*) netipsec/keysock.c did not validate depending on compile time options. Implemented by: julian, bz, brooks, zec Reviewed by: julian, bz, brooks, kris, rwatson, ... Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation Notes: svn path=/head/; revision=183550
* All opt_x.h includes go at the top of other includes.Julian Elischer2008-08-251-2/+2
| | | | Notes: svn path=/head/; revision=182141