summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
Commit message (Collapse)AuthorAgeFilesLines
* Kill a half dead comment. It's first half was killed in rev 1.12.rik2005-01-041-1/+0
| | | | MFC after: 3 days
* Rename 'class' field to 'uclass' in the ng_hci_inquiry_response structure.emax2005-01-041-1/+1
| | | | | | | class is a reserved word in C++ Submitted by: Markus Brueffer < markus AT brueffer DOT de > MFC after: 3 days
* Remove a check that never returns true, because in this case we have panicglebius2004-12-301-2/+0
| | | | before the check.
* - Plug a memory leak in ng_netflow_cache_init().glebius2004-12-281-5/+10
| | | | | | | - Initialize error to 0 in ng_netflow_flow_add() (a nop change). - Update cache statistics holding workqueue mutex. MFC after: 3 days
* tsleep => msleeprik2004-12-261-2/+2
| | | | | | | | | read sys/kern/kern_synch.c, msleep (): KASSERT(timo != 0 || mtx_owned(&Giant) || mtx != NULL, ("sleeping without a mutex")); MFC after: 3 days
* Fix creation on "dlciX" hook in ng_sample.rik2004-12-231-2/+3
| | | | | Approved by: julian MFC after: 3 days
* Fix counting length of leadin for hook name (sizeof () => strlen ()).rik2004-12-231-1/+1
| | | | | Approved by: julian MFC after: 3 days
* Move systm.h up, since it is required by mbuf.h.glebius2004-12-231-1/+1
| | | | Requested by: ru
* - sort includesglebius2004-12-231-5/+4
| | | | - remove duplicate include sys/sysctl.h
* Assert queue mutex in ng_dequeue() and ng_queue_rw().glebius2004-12-191-0/+4
|
* - Use ng_callout() instead of timeout.glebius2004-12-141-13/+7
| | | | | | | | - Schedule next timeout *after* finishing job of the current one. - Remove spl(9) calls. Tested by: ru Reviewed by: julian
* Use ng_callout() and ng_uncallout() instead of home-grownglebius2004-12-091-108/+17
| | | | | | | | implementation. Tested by: Savchuk Taras Reviewed by: archie Approved by: julian (mentor)
* - Use ng_callout() instead of timeout()glebius2004-12-081-30/+23
| | | | | | | - remove spl(9) calls Tested by: Ilya Pizik Approved by: julian (mentor)
* - Use ng_callout() instead of timeout(9).glebius2004-12-061-37/+14
| | | | | | | | | | - Do not put/remove node references, since this no longer needed. - Remove timerActive flag, use callout flags. - Schedule next callout after doing current one. Reviewed by: archie Approved by: julian (mentor)
* Use ng_callout() instead of timeout(9).glebius2004-12-051-7/+7
| | | | Approved by: julian (mentor)
* - Use uint16_t to pass argument for NGM_NETFLOW_IFINFO, bump cookie.glebius2004-12-052-6/+12
| | | | | | | | | | - Always check that index number passed from userland is <= NG_NETFLOW_MAXIFACES. [1] - Increase NG_NETFLOW_MAXIFACES up to 512. [2] Noticed by: Roman Palagin [1] Requested by: Yuri Y. Bushmelev [2] MFC after: 1 week
* Mechanically rename s/ng_timeout/ng_callout/g, s/ng_untimeout/ng_uncallout/g.glebius2004-12-018-33/+33
| | | | | | | This is done to keep both versions in RELENG_5 and support both APIs. Reviewed by: scottl Approved by: julian (mentor), implicitly
* Move ng_socket and ng_btsocket initialization to SI_SUB_PROTO_DOMAIN as theymlaier2004-11-302-2/+3
| | | | | | | | | | | | | | | call net_add_domain(). Calling this function too early (or late) breaks assertations about the global domains list. Actually it should be forbidden to call net_add_domain() outside of SI_SUB_PROTO_DOMAIN completely as there are many places where we traverse the domains list unprotected, but for now we allow late calls (mostly to support netgraph). In order to really fix this we have to lock the domains list in all places or find another way to ensure that we can safely walk the list while another thread might be adding a new domain. Spotted by: se Reviewed by: julian, glebius PR: kern/73321 (partly)
* Disable protocol field compression on the inner PPP frame when also doingarchie2004-11-271-1/+1
| | | | | | | normal PPP compression, as a workaround for certain (arguably) broken Linux PPP implementations that can't handle this particular case. MFC after: 1 week
* Netgraph flow control: change interface status when node receiveglebius2004-11-231-0/+12
| | | | | | | LINK_IS_UP/LINK_IS_DOWN messages. Approved by: julian (mentor), implicitly MFC after: 1 week
* Introduce new failure detection algorithm, called NG_ONE2MANY_FAIL_NOTIFY.glebius2004-11-232-1/+66
| | | | | | | | | | It means, that node listens to flow control messages from downstreams and removes link from list of active links whenever a LINK_IS_DOWN message is received. If LINK_IS_UP message is received, then links is put back into list of active links. Approved by: julian (mentor), implicitly MFC after: 1 week
* o Use ng_timeout() instead of timeout(9).glebius2004-11-231-11/+33
| | | | | | | | | | | o Implement some netgraph flow control: - Whenever status of HDLC heartbeat from pear is timed out, send NGM_LINK_IS_DOWN message. - If HDLC link changes status from down to up, send NGM_LINK_IS_UP message. Approved by: julian (mentor), implicitly MFC after: 1 week
* Remove unused macro.glebius2004-11-191-3/+0
| | | | Approved by: julian (mentor)
* Cancel pending timeout before scheduling a new one. This fixesglebius2004-11-191-0/+1
| | | | | | item leak, I've introduced with previous change. Approved by: julian (mentor)
* Correct typo. Return ENXIO instead of EIO.emax2004-11-191-1/+1
|
* Add myself to copyright.glebius2004-11-101-0/+1
| | | | Approved by: marks
* Initialize struct pr_userreqs in new/sparse style and fill in commonphk2004-11-082-126/+68
| | | | | | default elements in net_init_domain(). This makes it possible to grep these structures and see any bogosities.
* Partically backout previous commit. Since _callout_stop_safe() clearsglebius2004-11-041-2/+7
| | | | | | | | | | out c->c_func, we can't take it after callout_stop(). To take it before we need to acquire callout_lock, to avoid race. This commit narrows down area where lock is held, but hack is still present. This should be redesigned. Approved by: julian (mentor)
* Adapt to the new ng_timeout/ng_untimeout arguments. These now useharti2004-11-042-17/+11
| | | | | | the callout instead of the timeout interface. Submitted by: glebius
* Fix kernel build (caused by recent ng_{un}timeout API change)emax2004-11-035-23/+23
| | | | Submitted by: glebius
* - Make ng_timeout() to use callout() interface instead of timeout().glebius2004-11-023-30/+28
| | | | | | | - Remove callout-hacking from ng_untimeout(). Approved by: julian (mentor) MFC after: 1 month
* Fix a harmless error in order of ng_timeout() arguments.glebius2004-11-021-2/+2
| | | | Approved by: julian (mentor)
* Fix broken ng_h4(4). Basically, do not abuse t_sc field and use new t_lscemax2004-11-021-7/+9
| | | | | field created for line disciplne drivers private use. Also add NET_NEEDS_GIANT warning. For whatever reason ng_tty(4) was fixed but ng_h4(4) was not :(
* Removed bogus comment.glebius2004-11-011-2/+0
|
* o style changes:glebius2004-11-011-13/+11
| | | | | | | | | | - tabs after defines - tabs instead of many spaces - sort local variables by size o remove spl(9) calls Approved by: julian (mentor)
* Since last change moved ';' from macro to code, we need to embraceglebius2004-10-312-4/+4
| | | | | | | | macros with 'do {} while (0)' to avoid error in case macro is not defined. Prodded by: julian, archie Pointy hat to: glebius
* Rename debug macro to DBG and indent it properly.glebius2004-10-282-35/+34
| | | | | Requested by: maxim Approved by: julian (mentor)
* Push acquisition of the accept mutex out of sofree() into the callerrwatson2004-10-184-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (sorele()/sotryfree()): - This permits the caller to acquire the accept mutex before the socket mutex, avoiding sofree() having to drop the socket mutex and re-order, which could lead to races permitting more than one thread to enter sofree() after a socket is ready to be free'd. - This also covers clearing of the so_pcb weak socket reference from the protocol to the socket, preventing races in clearing and evaluation of the reference such that sofree() might be called more than once on the same socket. This appears to close a race I was able to easily trigger by repeatedly opening and resetting TCP connections to a host, in which the tcp_close() code called as a result of the RST raced with the close() of the accepted socket in the user process resulting in simultaneous attempts to de-allocate the same socket. The new locking increases the overhead for operations that may potentially free the socket, so we will want to revise the synchronization strategy here as we normalize the reference counting model for sockets. The use of the accept mutex in freeing of sockets that are not listen sockets is primarily motivated by the potential need to remove the socket from the incomplete connection queue on its parent (listen) socket, so cleaning up the reference model here may allow us to substantially weaken the synchronization requirements. RELENG_5_3 candidate. MFC after: 3 days Reviewed by: dwhite Discussed with: gnn, dwhite, green Reported by: Marc UBM Bocklet <ubm at u-boot-man dot de> Reported by: Vlad <marchenko at gmail dot com>
* Major overhaul.glebius2004-10-182-360/+280
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | List of functional changes: - Make a single device per single node with a single hook. This gives us parrallelizm, which can't be achieved on a single node with many devices/hooks. This also gives us flexibility - we can play with a particular device node, not affecting others. - Remove read queue as it is. Use struct ifqueue instead. This change removes a lot of extra memcpy()ing, m_devget()ting and m_copymem()ming. In ng_device_receivedata() we enqueue an mbuf and wake readers. In ngdread() we take one mbuf from qeueue and uiomove() it to userspace. If no mbuf is present we optionally block. [1] - In ngdwrite() we create an mbuf from uio using m_uiotombuf(). This is faster then uiomove() into buffer, and then m_copydata(), and this is much better than huge m_pullup(). - Perform locking of device - Perform locking of connection list. - Clear out _rcvmsg method, since it does nothing good yet. - Implement NGM_DEVICE_GET_DEVNAME message. - #if 0 ioctl method, while nothing is done here yet. - Return immediately from ngdwrite() if uio_resid == 0. List of tidyness changes: - Introduce device2priv(), to remove cut'n'paste. - Use MALLOC/FREE, instead of malloc/free. - Use unit2minor(). - Use UID_ROOT/GID_WHEEL instead of 0/0. - Define NGD_DEVICE_DEVNAME, use it. - Use more nice macros for debugging. [2] - Return Exxx, not -1. style(9) changes: - No "#endif" after short block. - Break long lines. - Remove extra spaces, add needed spaces. [1] Obtained from: if_tun.c [2] Obtained from: ng_pppoe.c Reviewed by: marks Approved by: julian (mentor) MFC after: 1 month
* Get rid of device nodes interface. It is useless and confusing.emax2004-10-122-532/+1
| | | | | | | | | | The original idea was to use it for firmware upgrading and similar operations. In real life almost all Bluetooth USB devices do not need firmware download. If device does require firmware download then ugen(4) (or specialized driver like ubtbcmfw(8)) should be used instead. MFC after: 3 days
* Fix packet flow when both ng_ether(4) and bridge(4) are in use:glebius2004-10-121-0/+5
| | | | | | | | | | | | | | | - push all bridge logic from if_ethersubr.c into bridge.c make bridge_in() return mbuf pointer (or NULL). - call only bridge_in() from ether_input(), after ng_ether_input() was optinally called. - call bridge_in() from ng_ether_rcv_upper(). Long description: http://lists.freebsd.org/mailman/htdig/freebsd-net/2004-May/003881.html Reported by: Jian-Wei Wang <jwwang at FreeBSD.csie.NCTU.edu.tw> Tested by: myself, Sergey Lyubka Reviewed by: sam Approved by: julian (mentor) MFC after: 2 months
* Return 0, not NULL, from a function declared as returning int.des2004-10-091-1/+1
|
* Fix an issue with ng_tty which (ab)used the tty->t_sc field which isphk2004-09-171-6/+6
| | | | | | reserved for the device drivers: Add a t_lsc field for line discipline private use.
* - Remove advertising clause from copyright [1]glebius2004-09-174-32/+4
| | | | | | - Change my email to glebius@FreeBSD.org Requested by: ru [1]
* A netgraph node implementing Netflow version 5.glebius2004-09-164-0/+1670
| | | | | Supported by: Bestcom ISP, Rinet ISP Approved by: julian (mentor)
* Remove orphaned comment about Meta data.glebius2004-09-111-1/+0
|
* Increase PPTP_MAX_TIMEOUT up to 3 seconds. 10 prooved too much for high packetglebius2004-09-061-1/+1
| | | | | | | | | | loss links, and 1 second appeared to be too small for high latency links. If we will receive more complaints, we should make this parameter configurable. PR: kern/69536 Approved by: archie, julian (mentor) MFC after: 3 days
* In FreeBSD 5.x, curthread is always defined, so we don't need to to testrwatson2004-09-021-3/+3
| | | | | | and optionally use &thread0 if it's NULL. Spotted by: julian
* Acquire Giant arounds calls into the linker from Netgraph sockets.rwatson2004-08-301-0/+2
| | | | | | | | We now no longer hold Giant in send(), so it isn't inheritted by the linker, which calls into VFS. Reported by: glebius Discussed with: glebius, bz
* Mark Netgraph TTY, KAME IPSEC, and IPX/SPX as requiring Giant for correctrwatson2004-08-281-0/+2
| | | | | | | operation using NET_NEEDS_GIANT(). This will result in a boot-time restoration of Giant-enabled network operation, or run-time warning on dynamic load (applicable only to the Netgraph component). Additional components will likely need to be marked with this in the future.
OpenPOWER on IntegriCloud