summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
Commit message (Collapse)AuthorAgeFilesLines
* Update comment. soalloc() is no longer performing M_WAITOK memory allocations.emax2009-02-101-14/+6
| | | | | Submitted by: ru MFC after: 3 days
* Allow unprivileged users to run l2ping(8).emax2009-02-041-5/+0
| | | | MFC after: 1 month
* Check for infinite recursion possible on some broken PPTP/L2TP/... VPN setups.mav2009-01-202-0/+21
| | | | | | | Mark packets with mbuf_tag on first interface passage and drop on second. PR: ports/129625, ports/125303, MFC after: 2 weeks
* Properly return error code to the caller. This should fix the followingemax2009-01-191-20/+26
| | | | | | | | | | panic in ng_l2cap(4). panic: ng_l2cap_l2ca_con_req: ubt0l2cap - could not find connection! While i'm here get rid of few goto's. MFC after: 1 week
* If source mbuf chain consists of only one mbuf, use it directly as sourcemav2009-01-181-34/+51
| | | | buffer to avoid extra copying.
* Use m_unshare()+m_copyback() instead of m_freem()+m_devget() to keepmav2009-01-183-49/+80
| | | | | original mbuf chain headers. It can be less efficient in some cases, but it looks better then mess of copying headers into the nonempty chain.
* Remove strict limitation on minimal multilink MRRU. RFC claims that MRRUmav2009-01-181-5/+6
| | | | | | | of 1500 must be supported, but allows smaller values to be negotiated. Enforce specified MRRU for outgoing frames. MFC after: 2 weeks
* Mark ng_vjc node as FORCE_WRITER to protect slcompress state.mav2009-01-081-0/+3
| | | | | | | I think it can be the reason of livelock in netgraph reported by some mpd users. MFC after: 3 days
* shave about 7% off the overhead of ng_ether by using per-hookjulian2008-12-251-17/+23
| | | | receive data methods.
* Add a trivial node to reflect ethernet frames to whence they came.julian2008-12-252-0/+196
| | | | MFC after: 1 month
* Change message severity level from WARN to INFO. This should reduceemax2008-12-241-1/+1
| | | | | | amount of messages sent to syslog MFC after: 1 week
* Unroll two loops of SHA1Update(). 60 bytes of static memory is not a price.mav2008-12-161-9/+12
|
* This main goals of this project are:qingli2008-12-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. separating L2 tables (ARP, NDP) from the L3 routing tables 2. removing as much locking dependencies among these layers as possible to allow for some parallelism in the search operations 3. simplify the logic in the routing code, The most notable end result is the obsolescent of the route cloning (RTF_CLONING) concept, which translated into code reduction in both IPv4 ARP and IPv6 NDP related modules, and size reduction in struct rtentry{}. The change in design obsoletes the semantics of RTF_CLONING, RTF_WASCLONE and RTF_LLINFO routing flags. The userland applications such as "arp" and "ndp" have been modified to reflect those changes. The output from "netstat -r" shows only the routing entries. Quite a few developers have contributed to this project in the past: Glebius Smirnoff, Luigi Rizzo, Alessandro Cerri, and Andre Oppermann. And most recently: - Kip Macy revised the locking code completely, thus completing the last piece of the puzzle, Kip has also been conducting active functional testing - Sam Leffler has helped me improving/refactoring the code, and provided valuable reviews - Julian Elischer setup the perforce tree for me and has helped me maintaining that branch before the svn conversion
* To avoid one doubtless netgraph SMP scalability limitation point, switchmav2008-12-141-13/+32
| | | | | | | | node queues processing from single swi:net thread to several specialized threads. Reviewed by: julian Tested with: Netperf Cluster
* Revert rev. 183277:mav2008-12-132-9/+2
| | | | | | | | | | Remove ng_rmnode_flags() function. ng_rmnode_self() was made to be called only while having node locked. When node is properly locked, any function call sent to it will always be queued. So turning ng_rmnode_self() into the ng_rmnode_flags() is not just meaningless, but incorrent, as it violates node locking when called outside. No objections: julian, thompsa
* Remove node shutdown on tty close. This could be easily done by user-levelmav2008-12-131-11/+0
| | | | | while it's present implementation with ng_rmnode_flags() is at least incorrect.
* Change ttyhook_register() second argument from thread to process pointer.mav2008-12-131-5/+5
| | | | | Thread was not really needed there, while previous ng_tty implementation that used thread pointer had locking issues (using sx while holding mutex).
* Conditionally compile out V_ globals while instantiating the appropriatezec2008-12-106-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | container structures, depending on VIMAGE_GLOBALS compile time option. Make VIMAGE_GLOBALS a new compile-time option, which by default will not be defined, resulting in instatiations of global variables selected for V_irtualization (enclosed in #ifdef VIMAGE_GLOBALS blocks) to be effectively compiled out. Instantiate new global container structures to hold V_irtualized variables: vnet_net_0, vnet_inet_0, vnet_inet6_0, vnet_ipsec_0, vnet_netgraph_0, and vnet_gif_0. Update the VSYM() macro so that depending on VIMAGE_GLOBALS the V_ macros resolve either to the original globals, or to fields inside container structures, i.e. effectively #ifdef VIMAGE_GLOBALS #define V_rt_tables rt_tables #else #define V_rt_tables vnet_net_0._rt_tables #endif Update SYSCTL_V_*() macros to operate either on globals or on fields inside container structs. Extend the internal kldsym() lookups with the ability to resolve selected fields inside the virtualization container structs. This applies only to the fields which are explicitly registered for kldsym() visibility via VNET_MOD_DECLARE() and vnet_mod_register(), currently this is done only in sys/net/if.c. Fix a few broken instances of MODULE_GLOBAL() macro use in SCTP code, and modify the MODULE_GLOBAL() macro to resolve to V_ macros, which in turn result in proper code being generated depending on VIMAGE_GLOBALS. De-virtualize local static variables in sys/contrib/pf/net/pf_subr.c which were prematurely V_irtualized by automated V_ prepending scripts during earlier merging steps. PF virtualization will be done separately, most probably after next PF import. Convert a few variable initializations at instantiation to initialization in init functions, most notably in ipfw. Also convert TUNABLE_INT() initializers for V_ variables to TUNABLE_FETCH_INT() in initializer functions. 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
* Carefully handle memory errors to keep peers compression/encryption statemav2008-12-061-11/+24
| | | | | consistent. There are some cases reported where peers fatally getting out of sync without any visible reason. I hope this solve the problem.
* Rather than using hidden includes (with cicular dependencies),bz2008-12-024-0/+4
| | | | | | | | | | | 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
* Unhide declarations of network stack virtualization structs fromzec2008-11-283-4/+11
| | | | | | | | | | | | | | | | | | 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
* Remove unused variable.mav2008-11-221-3/+2
| | | | | Found with: Coverity Prevent(tm) CID: 3682
* Fix typo. Clear session stats instead of config and part of stats.mav2008-11-221-1/+1
| | | | | Found with: Coverity Prevent(tm) CID: 2472
* Remove unneeded NULL check. At first msg can't be null here and and at secondmav2008-11-221-2/+1
| | | | | | NG_FREE_MSG() also checks it. Found with: Coverity Prevent(tm)
* convert calls to IFQ_HANDOFF to if_transmitkmacy2008-11-221-1/+1
|
* Don't use curthread to resolve file descriptor. Request may be queued, somav2008-11-081-2/+10
| | | | | thread will be different. Instead require sender to send process ID together with file descriptor.
* Assign new cookie to the node to reflect API change.mav2008-11-081-1/+1
| | | | All applications will have to be adapted and rebuilt.
* Don't assign completely meaningless name to the node on creation.mav2008-11-071-11/+0
| | | | | As soon as node is created from the netgraph side now, it can be found without using this. Allow application to assign whatever name it want later.
* Fix a number of style issues in the MALLOC / FREE commit. I've tried todes2008-10-237-11/+18
| | | | | 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-2354-248/+233
| | | | MFC after: 3 months
* Add ability to generate egress netflow instead or in addition to ingress.mav2008-10-083-20/+116
| | | | | | | | | | Use mbuf tagging for accounted packets to not account packets twice when both ingress and egress netflow enabled. To keep compatibility new "setconfig" message added to control new functionality. By default node works as before, doing only ingress accounting without using mbuf tags. Reviewed by: glebius
* Abort transfers on all pipes before closing them. This fixes the crashemax2008-10-031-0/+5
| | | | | | | when Bluetooth USB device is pulled out without stopping the stack first. Submitted by: Vladimir Grebenschikov vova at fbsd dot ru MFC after: 1 week
* Update ng_tty for MPSAFE TTY.thompsa2008-10-032-454/+282
| | | | | | | | | | | | | This changes from a line discipline to the tty_hooks mechanism. Data will come in directly via rint_bypass and sent to the peer node in a single mbuf. As line disciplines are no longer used a new netgraph command called NGM_TTY_SET_TTY is used to attach the tty. This takes a pointer to to the open file descriptor of the tty and registers the tty hooks. When the tty disappears the node will shutdown. Thanks to: ed Sponsored by: Hobnob, Inc
* Step 1.5 of importing the network stack virtualization infrastructurezec2008-10-026-10/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Replace all calls to minor() with dev2unit().ed2008-09-271-2/+2
| | | | | | | | | | | | | | | 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-261-1/+1
| | | | | | | | | | | | | | | 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
* Add ng_rmnode_flags() so the caller can pass NG_QUEUE and have the nodethompsa2008-09-222-2/+9
| | | | | | destroyed asynchronously due to locking or other constraints. Reviewed by: julian
* Fix error message content.zec2008-09-211-1/+1
| | | | | Approved by: julian (mentor) MFC after: 3 days
* We can't implicitly trust the hook on NGQF_FN/NGQF_FN2 processing inmav2008-09-131-6/+14
| | | | | | | | | | ng_apply_item(). There are possible (and I have got one) use-after-free class panics because of it. If hook is specified, require it to be valid at the apply time. The only exceptions are the internal ng_con_part2(), ng_con_part3() and ng_rmhook_part2() functions which are specially made to work with invalid hooks.
* Add Marko's pipe node.julian2008-09-032-0/+1226
| | | | | This allows one to do flow modulation similar to dummynet between arbitrary nodes.
* Make sure BPF program is not bigger than set maximum (net.bpf.maxinsns).jkim2008-08-291-1/+5
|
* A bunch of formatting fixes brough to light by, or created by the Vimage commitjulian2008-08-201-1/+1
| | | | a few days ago.
* Commit step 1 of the vimage project, (network stack)bz2008-08-178-22/+30
| | | | | | | | | | | | | | | | | | | | | | | | virtualization work done by Marko Zec (zec@). This is the first in a series of commits over the course of the next few weeks. Mark all uses of global variables to be virtualized with a V_ prefix. Use macros to map them back to their global names for now, so this is a NOP change only. We hope to have caught at least 85-90% of what is needed so we do not invalidate a lot of outstanding patches again. Obtained from: //depot/projects/vimage-commit2/... Reviewed by: brooks, des, ed, mav, julian, jamie, kris, rwatson, zec, ... (various people I forgot, different versions) md5 (with a bit of help) Sponsored by: NLnet Foundation, The FreeBSD Foundation X-MFC after: never V_Commit_Message_Reviewed_By: more people than the patch
* Implement ratelimiting for debug messages. For now, allow at mostemax2008-08-015-20/+50
| | | | | | | one message per second. In the future might add a sysctl knob for each socket family to fine tune this. MFC after: 1 week
* Increase maximum input queue size limit for raw Bluetooth HCI sockets.emax2008-08-011-2/+1
| | | | MFC after: 3 days
* Fix locking bug, i.e. lock "wildcard" matched pcb before return.emax2008-08-011-0/+3
|
* Introduce support for Bluetooth SCO sockets. This is based on olderemax2008-07-303-1/+2132
| | | | | | code that was revisted. MFC after: 3 months
* Simplify ubt_isoc_in_complete2(). Also should fix off by 1 bug.emax2008-07-291-28/+18
| | | | MFC after: 3 months
* Don't use memcpy() to copy several bytes.mav2008-07-281-40/+22
| | | | | Store IDs is host order. It is not so important to bloat code for it. Combine m_adj() and M_PREPEND() into single M_PREPEND().
* Fill in the string portion of the bluetooth stack version sysctl.trhodes2008-07-141-1/+1
| | | | Approved by: emax
OpenPOWER on IntegriCloud