summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
...
* It does not make much sense to include net/route.h twice.bz2008-12-091-2/+0
| | | | Remove one #include.
* Add rwlock.h (and lock.h for that) to keep no-INET kernels compilingbz2008-12-091-0/+2
| | | | | after RADIX_NODE_HEAD_{,UN}LOCK() were added. Must have been "learned" by pollution before (most likely: route.h -> radix.h -> rwlock.h)
* Fix a bug introduced in r185747: rather than dereferencing an uninitializedbz2008-12-091-1/+1
| | | | | | | *rt to something undefined, use the fibnum that came in as function argument. Found with: Coverity Prevent(tm) CID: 4168
* - avoid recursively locking the radix node head lockkmacy2008-12-081-2/+4
| | | | - assert that it is held if RTF_RNH_LOCKED is not passed
* Add missing include to sys/lock.h before sys/rwlock.himp2008-12-081-0/+1
|
* - convert radix node head lock from mutex to rwlockkmacy2008-12-075-71/+127
| | | | | | | | - make radix node head lock not recursive - fix LOR in rtexpunge - fix LOR in rtredirect Reviewed by: sam
* Rather than using hidden includes (with cicular dependencies),bz2008-12-0217-2/+19
| | | | | | | | | | | 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
* MFp4:bz2008-11-292-13/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bring in updated jail support from bz_jail branch. This enhances the current jail implementation to permit multiple addresses per jail. In addtion to IPv4, IPv6 is supported as well. Due to updated checks it is even possible to have jails without an IP address at all, which basically gives one a chroot with restricted process view, no networking,.. SCTP support was updated and supports IPv6 in jails as well. Cpuset support permits jails to be bound to specific processor sets after creation. Jails can have an unrestricted (no duplicate protection, etc.) name in addition to the hostname. The jail name cannot be changed from within a jail and is considered to be used for management purposes or as audit-token in the future. DDB 'show jails' command was added to aid debugging. Proper compat support permits 32bit jail binaries to be used on 64bit systems to manage jails. Also backward compatibility was preserved where possible: for jail v1 syscalls, as well as with user space management utilities. Both jail as well as prison version were updated for the new features. A gap was intentionally left as the intermediate versions had been used by various patches floating around the last years. Bump __FreeBSD_version for the afore mentioned and in kernel changes. Special thanks to: - Pawel Jakub Dawidek (pjd) for his multi-IPv4 patches and Olivier Houchard (cognet) for initial single-IPv6 patches. - Jeff Roberson (jeff) and Randall Stewart (rrs) for their help, ideas and review on cpuset and SCTP support. - Robert Watson (rwatson) for lots and lots of help, discussions, suggestions and review of most of the patch at various stages. - John Baldwin (jhb) for his help. - Simon L. Nielsen (simon) as early adopter testing changes on cluster machines as well as all the testers and people who provided feedback the last months on freebsd-jail and other channels. - My employer, CK Software GmbH, for the support so I could work on this. Reviewed by: (see above) MFC after: 3 months (this is just so that I get the mail) X-MFC Before: 7.2-RELEASE if possible
* Unhide declarations of network stack virtualization structs fromzec2008-11-281-3/+2
| | | | | | | | | | | | | | | | | | underneath #ifdef VIMAGE blocks. This change introduces some churn in #include ordering and nesting throughout the network stack and drivers but is not expected to cause any additional issues. In the next step this will allow us to instantiate the virtualization container structures and switch from using global variables to their "containerized" counterparts. Reviewed by: bz, julian Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation
* Merge more of currently non-functional (i.e. resolving tozec2008-11-264-1/+12
| | | | | | | | | | | | | | | | | whitespace) macros from p4/vimage branch. Do a better job at enclosing all instantiations of globals scheduled for virtualization in #ifdef VIMAGE_GLOBALS blocks. De-virtualize and mark as const saorder_state_alive and saorder_state_any arrays from ipsec code, given that they are never updated at runtime, so virtualizing them would be pointless. Reviewed by: bz, julian Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation
* use consistent stylesam2008-11-241-10/+8
|
* convert calls to IFQ_HANDOFF to if_transmitkmacy2008-11-226-11/+7
|
* - bump __FreeBSD version to reflect added buf_ring, memory barriers,kmacy2008-11-222-21/+56
| | | | | | | | | | | | | | | | | and ifnet functions - add memory barriers to <machine/atomic.h> - update drivers to only conditionally define their own - add lockless producer / consumer ring buffer - remove ring buffer implementation from cxgb and update its callers - add if_transmit(struct ifnet *ifp, struct mbuf *m) to ifnet to allow drivers to efficiently manage multiple hardware queues (i.e. not serialize all packets through one ifq) - expose if_qflush to allow drivers to flush any driver managed queues This work was supported by Bitgravity Inc. and Chelsio Inc.
* Change the initialization methodology for global variables scheduledzec2008-11-196-21/+45
| | | | | | | | | | | | | | | | | | | | | | | | for virtualization. Instead of initializing the affected global variables at instatiation, assign initial values to them in initializer functions. As a rule, initialization at instatiation for such variables should never be introduced again from now on. Furthermore, enclose all instantiations of such global variables in #ifdef VIMAGE_GLOBALS blocks. Essentialy, this change should have zero functional impact. In the next phase of merging network stack virtualization infrastructure from p4/vimage branch, the new initialization methology will allow us to switch between using global variables and their counterparts residing in virtualization containers with minimum code churn, and in the long run allow us to intialize multiple instances of such container structures. Discussed at: devsummit Strassburg Reviewed by: bz, julian Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation
* - Use RTFREE_LOCKED macrokmacy2008-11-111-3/+3
| | | | | | | | - Don't clone route on lookup (was causing arpresolve to fail) - u_int_32 -> uint32_t Reviewed by: qingli MFC after: 3 days
* Include if_arp.h for IFP2AC so that the netgraph parts in if.cbz2008-11-061-0/+1
| | | | | | are happy even if compiled without INET or INET6. MFC after: 2 months
* Check for INET not AF_INET in #ifdef. Makes it compile without INET.bz2008-11-061-1/+1
| | | | MFC after: 2 months
* Hide an unused variable in case we compile without INET.bz2008-11-061-0/+4
| | | | | | | | Include ethernet.h and if_arp.h directly so that the constants are always defined. Makes token compile without INET. MFC after: 2 months
* Hide an unused variable in case we compile without INET.bz2008-11-061-0/+3
| | | | | | | Include ethernet.h directly so that the constants are always defined. Makes fddi compile without INET. MFC after: 2 months
* Make compile without INET.bz2008-11-051-2/+89
| | | | | | The change is modelled after the way it was done for (without) INET6. MFC after: 2 months
* Hide the IPv4 init function if the kernel is compiled without INET.bz2008-11-051-0/+3
| | | | It is not used in that case and would not compile.
* Make compile without INET.bz2008-11-051-0/+2
| | | | MFC after: 2 months
* Make tun(4) compile without INET.bz2008-11-051-0/+2
| | | | MFC after: 2 months
* Do only define the variable if either INET or INET6 is defined.bz2008-11-051-0/+2
| | | | | | | | To prevent it from compiling without INET and INET6 we should put an explicit #error in there like we have in other files, but not rely on an unused variable. MFC after: 2 months
* Fix a number of style issues in the MALLOC / FREE commit. I've tried todes2008-10-231-1/+2
| | | | | be careful not to fix anything that was already broken; the NFSv4 code is particularly bad in this respect.
* Retire the MALLOC and FREE macros. They are an abomination unto style(9).des2008-10-2313-34/+33
| | | | MFC after: 3 months
* Step 1.5 of importing the network stack virtualization infrastructurezec2008-10-0221-35/+260
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Do not mangle if_oerrors of the underlying interface. This counterglebius2008-09-301-2/+0
| | | | | | | | belongs solely to the driver. We don't lose any statistics with this change, because in a error case the drop counter on the interface output queue is always incremented. Reviewed by: thompsa
* Replace all calls to minor() with dev2unit().ed2008-09-273-25/+25
| | | | | | | | | | | | | | | After I removed all the unit2minor()/minor2unit() calls from the kernel yesterday, I realised calling minor() everywhere is quite confusing. Character devices now only have the ability to store a unit number, not a minor number. Remove the confusion by using dev2unit() everywhere. This commit could also be considered as a bug fix. A lot of drivers call minor(), while they should actually be calling dev2unit(). In -CURRENT this isn't a problem, but it turns out we never had any problem reports related to that issue in the past. I suspect not many people connect more than 256 pieces of the same hardware. Reviewed by: kib
* Remove unit2minor() use from kernel code.ed2008-09-263-5/+5
| | | | | | | | | | | | | | | When I changed kern_conf.c three months ago I made device unit numbers equal to (unneeded) device minor numbers. We used to require bitshifting, because there were eight bits in the middle that were reserved for a device major number. Not very long after I turned dev2unit(), minor(), unit2minor() and minor2unit() into macro's. The unit2minor() and minor2unit() macro's were no-ops. We'd better not remove these four macro's from the kernel, because there is a lot of (external) code that may still depend on them. For now it's harmless to remove all invocations of unit2minor() and minor2unit(). Reviewed by: kib
* Some people's 6to4 routers seem to have been blowing up because ofdwmalone2008-09-251-6/+30
| | | | | | | | | | | | | the unlocked route caching in if_stf. Add a mutex that protects access to cached route. This seemed to fix problems for Pekka Savola. Nick Sayer had similar problems, and in his case completly disabling the route cache seemed to help. Add a sysctl net.link.stf.route_cache that can be used to turn off route caching in if_stf. PR: 122283 MFC after: 2 weeks Tested by: Pekka Savola, Nick Sayer.
* Fix clone destruction, can't use the simple api because that does not removethompsa2008-09-202-2/+2
| | | | | | the ifnet from cloner's list. Expose if_clone_destroyif api to do this. Submitted by: sam
* Move #defines for MRT-related constants from net/route.c tozec2008-09-202-20/+21
| | | | | | | | | net/route.h, because the vnet code will need those constants as well. Reviewed by: bz Approved by: julian (mentor) MFC after: never
* Move the protocol and port count checks to outside the loop, these conditionsthompsa2008-09-181-8/+8
| | | | can not change while we have the lock so no point retesting.
* Make sure there is at least one port to avoid divide by zero when choosing thethompsa2008-09-181-1/+2
| | | | | | | tx port. PR: kern/122794 MFC after: 3 days
* Hey, committed the same typo twice! must be a recordjulian2008-09-151-1/+1
|
* rewrite rt_check. Ztake into account that whiel teh rtentry is unlocked,julian2008-09-151-40/+83
| | | | | | | | | someone else might change it, so after we re-acquire the lock on it, we need to check it is still valid. People have been panicing in this function due to soem edge cases which I have hopefully removed. Reviewed by: keramida @ Obtained from: 1 week
* come on Julian, make up if you're committing one change or the other.julian2008-09-142-13/+29
| | | | fix braino
* Revert a part of the MRT commit that proved un-needed.julian2008-09-145-17/+7
| | | | | | | | | | rt_check() in its original form proved to be sufficient and rt_check_fib() can go away (as can its evil twin in_rt_check()). I believe this does NOT address the crashes people have been seeing in rt_check. MFC after: 1 week
* Add a missing break statement; IFDATA_LINKSPECIFIC would fall throughbms2008-09-101-0/+1
| | | | | | | to IFDATA_DRIVERNAME otherwise. Reviewed by: brooks MFC after: 1 week
* Add new TAPGIFNAME tap(4) character device ioctl. This is aemax2008-09-082-0/+7
| | | | | | | | convenient shortcut to obtain network interface name using file descriptor for character device. Obtained from: NetBSD MFC after: 1 week
* Put the bridge mac inheritance behind a sysctl with the default off as thisthompsa2008-09-081-2/+7
| | | | | | still needs all the edge cases fixed. Submitted by: Eygene Ryabinkin
* Be consistent about whether these multi-lined macros are separated byjulian2008-09-051-0/+2
| | | | | a blank line. Some were, some weren't. Decide in favour of the line as it matches what an inline would do, and it's easier to read.
* Wrap a line that became too long with the addition of V_.brooks2008-09-011-1/+2
| | | | (This file contains many more unwrapped or badly wrapped lines.)
* Make bpf_maxinsns visible from ng_bpf.c.jkim2008-08-291-1/+1
| | | | Pass me the pointyhat, please.
* Fix the last missing parentheses for a return statement in bpf_filter.c.jkim2008-08-291-1/+1
|
* More convergence towards style(9).jkim2008-08-291-32/+27
|
* - Directly match code wherever possible instead of using macros.jkim2008-08-291-11/+14
| | | | | | | | | | - Macrofy bitmap table lookup. Constify the table while I am here. - Add missing continue statements in the for loop. Functionally it should be the last remaining fix from: PR: kern/89752 MFC after: 1 month
* Simplify jump instruction range checks.jkim2008-08-291-7/+6
| | | | MFC after: 1 month
* Fix to bug kern/126850. Only dispatch event hander if thejfv2008-08-282-22/+29
| | | | | | | interface had a parent (was attached). Reviewed by: EvilSam MFC after: 1 week
OpenPOWER on IntegriCloud