aboutsummaryrefslogtreecommitdiff
path: root/sys/netgraph
Commit message (Collapse)AuthorAgeFilesLines
* MFC rev. 201924: Send link state change control messagesMax Khon2010-01-241-6/+10
| | | | | | | | | to "orphans" hook as well. Approved by: re (kib) Notes: svn path=/stable/7/; revision=202932
* propagate MFC of 195148 to -STABLE:Kip Macy2009-07-101-1/+1
| | | | | | | | | | | - Turn the third (islocked) argument of the knote call into flags parameter. Introduce the new flag KNF_NOKQLOCK to allow event callers to be called without KQ_LOCK mtx held. - Modify VFS knote calls to always use KNF_NOKQLOCK flag. This is required for ZFS as its getattr implementation may sleep. Notes: svn path=/stable/7/; revision=195586
* MFC rev.195335:Alexander Motin2009-07-041-1/+2
| | | | | | | | | | | Fix infinite loop in ng_iface, that happens when packet passes out via two different ng interfaces sequentially due to tunnelling. PR: kern/134557 Submitted by: Mikolaj Golub Notes: svn path=/stable/7/; revision=195336
* MFC rev.194699:Alexander Motin2009-07-011-1/+1
| | | | | | | | | Mark ng_ether node hooks as HI_STACK. It is usually the last point when netgraph may unroll the call stack, and I have found that in some cases 2K guarantied there for i386 may be not enough for NIC driver and BPF. Notes: svn path=/stable/7/; revision=195232
* MFC of 179973George V. Neville-Neil2009-06-151-0/+2
| | | | | | | | Make it simpler to build netgraph modules outside of the kernel source tree. This change follows similar ones in the device tree. Notes: svn path=/stable/7/; revision=194270
* MFC rev. 192032Alexander Motin2009-05-201-1/+1
| | | | | | | | | | Fix copy-paste bug in NGM_NETFLOW_SETCONFIG argument size verification. PR: kern/134220 Submitted by: Eugene Mychlo Notes: svn path=/stable/7/; revision=192415
* MFC rev. 186093Alexander Motin2009-03-201-16/+29
| | | | | | | | | To avoid one doubtless netgraph SMP scalability limitation point, switch node queues processing from single swi:net thread to several specialized threads. Notes: svn path=/stable/7/; revision=190175
* MFC r188132Maksim Yevmenkin2009-03-061-5/+0
| | | | | | | Allow unprivileged users to run l2ping(8). Notes: svn path=/stable/7/; revision=189425
* MFC r188452Maksim Yevmenkin2009-02-131-14/+6
| | | | | | | | | Update comment. soalloc() is no longer performing M_WAITOK memory allocations. Submitted by: ru Notes: svn path=/stable/7/; revision=188547
* MFC r186466Maksim Yevmenkin2009-02-091-1/+1
| | | | | | | | Change message severity level from WARN to INFO. This should reduce amount of messages sent to syslog Notes: svn path=/stable/7/; revision=188401
* MFC r187454Maksim Yevmenkin2009-02-091-20/+26
| | | | | | | | | | | | Properly return error code to the caller. This should fix the following 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. Notes: svn path=/stable/7/; revision=188400
* MFC rev. 187387Alexander Motin2009-02-011-5/+6
| | | | | | | | | Remove strict limitation on minimal multilink MRRU. RFC claims that MRRU of 1500 must be supported, but allows smaller values to be negotiated. Enforce specified MRRU for outgoing frames. Notes: svn path=/stable/7/; revision=187982
* MFC rev. 187495Alexander Motin2009-01-312-0/+21
| | | | | | | | | | Check for infinite recursion possible on some broken PPTP/L2TP/... VPN setups. Mark packets with mbuf_tag on first interface passage and drop on second. PR: ports/129625, ports/125303 Notes: svn path=/stable/7/; revision=187955
* MFC rev. 187410Alexander Motin2009-01-311-34/+51
| | | | | | | | If source mbuf chain consists of only one mbuf, use it directly as source buffer to avoid extra copying. Notes: svn path=/stable/7/; revision=187954
* MFC rev. 187405Alexander Motin2009-01-313-49/+80
| | | | | | | | | Use m_unshare()+m_copyback() instead of m_freem()+m_devget() to keep 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. Notes: svn path=/stable/7/; revision=187953
* MFC rev. 186907:Alexander Motin2009-01-111-0/+3
| | | | | | | | | Mark ng_vjc node as FORCE_WRITER to protect slcompress state. I think it can be the reason of livelock in netgraph reported by some mpd users. Notes: svn path=/stable/7/; revision=187051
* MFC rev. 182995Alexander Motin2009-01-091-6/+14
| | | | | | | | | | | | | | We can't implicitly trust the hook on NGQF_FN/NGQF_FN2 processing in 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. Notes: svn path=/stable/7/; revision=186976
* MFC rev. 183693Alexander Motin2009-01-093-20/+116
| | | | | | | | | | | | | | Add ability to generate egress netflow instead or in addition to ingress. 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 Notes: svn path=/stable/7/; revision=186973
* MFC rev. 185183Alexander Motin2009-01-091-3/+2
| | | | | | | | | | Remove unused variable. Found with: Coverity Prevent(tm) CID: 3682 Notes: svn path=/stable/7/; revision=186971
* MFC rev. 185182Alexander Motin2009-01-091-1/+1
| | | | | | | | | | Fix typo. Clear session stats instead of config and part of stats. Found with: Coverity Prevent(tm) CID: 2472 Notes: svn path=/stable/7/; revision=186970
* MFC rev. 185179Alexander Motin2009-01-091-2/+1
| | | | | | | | | | Remove unneeded NULL check. At first msg can't be null here and and at second NG_FREE_MSG() also checks it. Found with: Coverity Prevent(tm) Notes: svn path=/stable/7/; revision=186969
* MFC rev. 185723, 186189:Alexander Motin2009-01-071-20/+36
| | | | | | | | | | | Carefully handle memory errors to keep peers compression/encryption state consistent. There are some cases reported where peers fatally getting out of sync without any visible reason. I hope this solve the problem. Unroll two loops of SHA1Update(). 60 bytes of static memory is not a price. Notes: svn path=/stable/7/; revision=186859
* Merge r179308 from head to stable/7:Robert Watson2008-08-314-1961/+0
| | | | | | | | | | | | | | | | | | | | | | | | Remove netatm from HEAD as it is not MPSAFE and relies on the now removed NET_NEEDS_GIANT. netatm has been disconnected from the build for ten months in HEAD/RELENG_7. Specifics: - netatm include files - netatm command line management tools - libatm - ATM parts in rescue and sysinstall - sample configuration files and documents - kernel support as a module or in NOTES - netgraph wrapper nodes for netatm - ctags data for netatm. - netatm-specific device drivers. Reviewed by: bz Discussed with: bms, bz, harti MFC discussed with: des, peter Notes: svn path=/stable/7/; revision=182526
* MFC r180943Alexander Motin2008-08-251-40/+22
| | | | | | | | | Don't use memcpy() to copy several bytes. 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(). Notes: svn path=/stable/7/; revision=182181
* MFC SVN rev 181093Maksim Yevmenkin2008-08-084-16/+40
| | | | | | | | | Implement ratelimiting for debug messages. For now, allow at most one message per second. In the future might add a sysctl knob for each socket family to fine tune this. Notes: svn path=/stable/7/; revision=181441
* MFC: SVN rev 181089Maksim Yevmenkin2008-08-041-2/+1
| | | | | | | Increase maximum input queue size limit for raw Bluetooth HCI sockets. Notes: svn path=/stable/7/; revision=181310
* MFC an ABI compatible implementation of Multiple routing tables.Julian Elischer2008-07-241-2/+3
| | | | | | | | | | | See the commit message for http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/net/route.c version 1.129 (svn change # 178888) for more info. Obtained from: Ironport (Cisco Systems) Notes: svn path=/stable/7/; revision=180774
* MFC rev. 1.155-1.156Alexander Motin2008-06-261-259/+102
| | | | | | | | | | | | Rewrite node's r/w/q-lock semantics using only atomics instead of mutex and atomics combination. Mutex is now used only for queue protection. Also avoid unneded extra swi scheduling calls. Add memory barriers to the node locking operations. Add some comments. Notes: svn path=/stable/7/; revision=180035
* MFC r179477:Alexander Motin2008-06-231-2/+2
| | | | | | | | | Pass really available buffer size to libalias instead of MCLBYTES constant. MCLBYTES constant were used with believe that m_megapullup() always moves date into a fresh cluster that may become not so. Notes: svn path=/stable/7/; revision=179953
* MFC rev. 1.158Alexander Motin2008-05-171-40/+70
| | | | | | | | | | | | | | Use separate UMA zone for data items allocation. It is a partial rev. 1.149 rework. It allows to save several percents of CPU time on SMP by using UMA's internal per-CPU allocation limits instead of own global variable each time updated with atomics. Also it restores NG_WAITOK flag processing. PR: kern/123741 Notes: svn path=/stable/7/; revision=179068
* MFC:Kris Kennaway2008-05-161-1/+1
| | | | | | | | Replace callout_init(..., 1) with callout_init(..., CALLOUT_MPSAFE) for better grep-compliance and to standardize with the rest of the kernel. Notes: svn path=/stable/7/; revision=179044
* MFC some small optimizations:Alexander Motin2008-04-201-30/+11
| | | | | | | | | | | rev. 1.151: Remove impossible (hk_peer == NULL) check. rev. 1.152: Remove ng_setisr() call from ng_dequeue(). rev. 1.153: There is no need to erase hook->hk_node before freeing hook. rev. 1.154: Use new atomic_fetchadd() primitive instead of looping atomic_cmpset(). rev. 1.158: ng_address_hook() microoptimization. Notes: svn path=/stable/7/; revision=178326
* MFC rev. 1.6-1.7Alexander Motin2008-04-011-57/+50
| | | | | | | | | | | | | - Switch from timeval to bintime, to use 1/(2^20) of seconds instead of microseconds. It allows to use bit shifts instead of some heavy 64bit mul/div math operations. - Account all node stats at the shape mode. - Do not check destination hook presence, it will be done by netgraph. - Use u_int instead of int in some places to simplify type conversions. - Use NG_SEND_DATA_ONLY() macro instead of selfmade equivalent. Notes: svn path=/stable/7/; revision=177838
* Merge amd64/machdep.c:1.680, amd64/mp_watchdog.c:1.6,Robert Watson2008-03-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | uart_dev_at91usart.c:1.13, scsi_low.h:1.9, subr_ntoskrnl.c:1.94, OsdDebug.c:1.14, dcons_os.c:1.20, ofw_consle.c:1.37, dev/sio.c:1.473, syscons.c:1.454, uart_core.c:1.23, union_subr.c:1.96, i386/machdep.c:1.664, i386/mp_watchdog.c:1.6, ia64/machdep.c:1.228, kern_clock.c:1.206, kern_shutdown.c:1.186, subr_kdb.c:1.25, subr_witness.c:1.239, vfs_subr.c:1.711, ng_base.c:1.140, cbus/sio.c:1.247, pc98/machdep.c:1.399, aim/machdep.c:1.107, pswitch.c:1.7, mac_test.c:19.3, psycho.c:1.73, sparc64/machdep.c:1.140, sparc64/trap.c:1.89, hvcons.c:1.7, sun4v/machdep.c:1.17, sun4v/trap.c:1.17, kdb.h:1.6 from HEAD to RELENG_7: Add a new 'why' argument to kdb_enter(), and a set of constants to use for that argument. This will allow DDB to detect the broad category of reason why the debugger has been entered, which it can use for the purposes of deciding which DDB script to run. Assign approximate why values to all current consumers of the kdb_enter() interface. For ABI/KPI reasons, the MFC creates a new function, kdb_enter_why(), with the new argument, updating existing consumers to use that, preserving kdb_enter() with the current argument, and wrapping it around kdb_enter_why(). Notes: svn path=/stable/7/; revision=177734
* MFC ng_pptpgre.c rev. 1.41-1.42Alexander Motin2008-03-302-260/+284
| | | | | | | | | | Rewrite node to support multiple hooks, alike to ng_l2tp, to use one pair of pptpgre and ksocket nodes for all calls between two peers. This patch modifies node's API by adding new "session_%04x" hook names support, while keeping backward compatibility. Notes: svn path=/stable/7/; revision=177733
* MFC rev. 1.25Alexander Motin2008-03-181-38/+47
| | | | | | | | | Add session ID hashing to speedup incoming packets dispatch in case of many connections working via the same tunnel. For example, in case of full "client <-> LAC <-> LNS" setup. Notes: svn path=/stable/7/; revision=177354
* MFC:Alexander Motin2008-03-163-10/+28
| | | | | | | | | | | | | | | Improve apply callback error reporting: Before this patch callback returned result of the last finished call chain. Now it returns last nonzero result from all call chain results in this request. As soon as this improvement gives reliable error reporting, it is now possible to remove dirty workaround in ng_socket, made to return ENOBUFS error statuses of request-response operations. That workaround was responsible for returning ENOBUFS errors to completely unrelated requests working at the same time on socket. Notes: svn path=/stable/7/; revision=177281
* MFC rev. 1.23-1.24Alexander Motin2008-03-111-54/+45
| | | | | | | | | | To avoid control data losses, do not acknowledge recieving of control packet if netgraph reported error while delivering to destination. Reset 'next send' counter to the last requested by peer on ack timeout, to resend all subsequest packets after lost one again without additional hints. Notes: svn path=/stable/7/; revision=177066
* MFC rev. 1.61Alexander Motin2008-03-111-32/+26
| | | | | | | | | | | | Send only one incoming notification at a time to reduce queue trashing and improve performance. Remove waitflag argument from ng_ksocket_incoming2(), it means nothing as function call was queued by netgraph. Remove node validity check, as node validity guarantied by netgraph. Update comments. Notes: svn path=/stable/7/; revision=177065
* MFC: rev. 1.148-1.149Alexander Motin2008-03-091-48/+85
| | | | | | | | | | | | | Implement 128 items node name hash for faster name search. Increase node ID hash size from 32 to 128 items. Increase default queue items allocation limit from 512 to 4096 items to avoid terrible unpredicted effects for netgraph operation of their exhaustion while allocating control messages. Add separate configurable 512 items limit for data items allocation for DoS/overload protection. Notes: svn path=/stable/7/; revision=177001
* MFC rev. 1.92-1.93Alexander Motin2008-03-071-100/+67
| | | | | | | | | | | Make session ID generator to use session ID hash. Make session ID generator thread-safe. Use more compact LIST instead of TAILQ for session hash. Add all listening hooks into LIST to simplify searches. Use ng_findhook() instead of own equal implementation. Notes: svn path=/stable/7/; revision=176913
* MFC: Add support for the libalias redirect functionality.Alexander Motin2008-03-072-1/+558
| | | | | | | Submitted by: Vadim Goncharov <vadim_nuclight@mail.ru> Notes: svn path=/stable/7/; revision=176912
* MFC rev. 1.147Alexander Motin2008-02-261-1/+1
| | | | | | | Fix incorrect constant used in rev. 1.146 that broke node writer locking. Notes: svn path=/stable/7/; revision=176591
* MFC rev. 1.35Alexander Motin2008-02-241-0/+1
| | | | | | | Fix shutdown bug made by previous commit. Notes: svn path=/stable/7/; revision=176529
* MFC:Alexander Motin2008-02-062-22/+77
| | | | | | | | Add option to set packets per second limits instead of default bits per second ones. Notes: svn path=/stable/7/; revision=176067
* MFC:Alexander Motin2008-02-062-4/+4
| | | | | | | Do not use bcmp() to compare two bytes with constants. Notes: svn path=/stable/7/; revision=176066
* MFC rev. 1.47Alexander Motin2008-02-061-0/+1
| | | | | | | | | Implement stack protection based on GET_STACK_USAGE() macro. This fixes system panics possible with complicated netgraph setups and allows to avoid unneded extra queueing for stack unwrapping. Notes: svn path=/stable/7/; revision=176064
* MFC ng_base.c rev. 1.141-1.146:Alexander Motin2008-02-062-145/+120
| | | | | | | | | Implement stack protection based on GET_STACK_USAGE() macro. This fixes system panics possible with complicated netgraph setups and allows to avoid unneded extra queueing for stack unwrapping. Notes: svn path=/stable/7/; revision=176062
* MFC rev. 1.23-1.24Alexander Motin2008-02-051-27/+78
| | | | | | | | | | - Avoid data copying when it is possible. bpf_filter() is able to work directly on mbuf chain - Prepare hooks direct pointers on setup to avoid heavy ng_findhook() calls during operarion. Notes: svn path=/stable/7/; revision=176005
* MFC rev. 1.34Alexander Motin2008-02-051-96/+90
| | | | | | | | | Move all possible node logic out of the rcvdata() function to the newhook()/disconnect(). Unify function names with other nodes. Notes: svn path=/stable/7/; revision=176003