summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
Commit message (Collapse)AuthorAgeFilesLines
* In ng_netflow_disconnect() check whether we are working with "iface"glebius2005-12-281-2/+6
| | | | | | or with "out" hook, and clear the right pointer. Reported by: Vitaliy Ovsyannikov <V.Ovsyannikov kr.ru>
* Implement an upper limit for packets per second sent by node.glebius2005-12-232-4/+47
|
* Fix memory leak.ru2005-12-091-0/+1
| | | | | PR: kern/90113 Submitted by: Antoine Brodin
* Fix build without BPF_JITTER option.jkim2005-12-071-1/+3
|
* Add BPF Just-In-Time compiler support for ng_bpf(4).jkim2005-12-071-2/+28
| | | | | The sysctl is changed from net.bpf.jitter.enable to net.bpf_jitter.enable and this controls both bpf(4) and ng_bpf(4) now.
* Fix -Wundef from compiling the amd64 LINT.ru2005-12-041-6/+6
|
* Use __LP64__ to check for the 64-bit pointer type, and fix -Wundef.ru2005-12-041-4/+2
|
* - Update the flow sequence before converting count toglebius2005-11-271-5/+2
| | | | | | | | | network byte order. - Update the flow sequence in one atomic op instead of two. Reported by: Denis Shaposhnikov <dsh vlink.ru> Reported by: Daniil Kharoun <kdl chelcom.ru> PR: kern/89417
* Some whitespace and style cleanup.glebius2005-11-152-89/+88
|
* - Store pointer to the link-level address right in "struct ifnet"ru2005-11-112-7/+7
| | | | | | | | | | rather than in ifindex_table[]; all (except one) accesses are through ifp anyway. IF_LLADDR() works faster, and all (except one) ifaddr_byindex() users were converted to use ifp->if_addr. - Stop storing a (pointer to) Ethernet address in "struct arpcom", and drop the IFP2ENADDR() macro; all users have been converted to use IF_LLADDR() instead.
* Make IFP2NG() usable as an lvalue.ru2005-11-092-9/+6
|
* Use sparse initializers for "struct domain" and "struct protosw",ru2005-11-092-88/+49
| | | | so they are easier to follow for the human being.
* Simplify setting the link-level address.ru2005-11-081-19/+3
|
* Use if_setlladdr() to reprogram the link-level addresses; it causesru2005-11-041-21/+4
| | | | | | a synchronous reprogramming of hardware MAC filters if the physical interface are up and running. Previously, MAC filters would be reconfigured only when the fec interface was brought up.
* Bring some level of stability to this driver:ru2005-11-041-3/+19
| | | | | | | | | | | | | | | | | | | - Disallow bundle reconfiguration when virtual interface is running; otherwise, removing a port from a running configuration will cause a panic in the start() method on the next packet on an assumption that a bundle has an even number of ports (2 or 4). - Disallow bringing of virtual interface to a running state when a bundle size is 0; otherwise, adding and then removing the port will similarly cause a panic. - Add missing initialization of fec_ifstat when adding a new port and fix media status reporting when virtual interface isn't yet up (check for fec_status of 1 rather than != 0).
* - Fix another fallout from the if_alloc() conversion:ru2005-11-041-6/+6
| | | | | | | | | | | | | | | | | | previously, ifp->if_type was set to IFT_ETHER by ether_ifattach(), now it's done by if_alloc() so an assignment of if_type to IFT_PROPVIRTUAL after if_alloc() but before ether_ifattach() broke it. This makes arp(8) and friends happy about the fec interfaces, and will allow us to use if_setlladdr() on the fec interface. - Set/reset IFF_DRV_RUNNING/IFF_DRV_OACTIVE in init() and stop() methods rather than in ioctl(), like the rest of the drivers do. This fixes a bug when an "ifconfig fec0 ipv4_address" would not have made the interface running, didn't launch the ticker function to track media status of bundled ports, etc.
* Restore part of the code dropped in rev. 1.25 that makes sure ether_demux()ru2005-11-031-0/+9
| | | | | will receive an mbuf chain with Ethernet header in the data portion of the first mbuf.
* Fix several races between socket closure and node/hookglebius2005-11-021-77/+97
| | | | | | | | | | | | | destruction: - Backout 1.62, since it doesn't fix all possible problems. - Upon node creation, put an additional reference on node. - Add a mutex and refcounter to struct ngsock. Netgraph node, control socket and data socket all count as references. - Introduce ng_socket_free_priv() which removes one reference from ngsock, and frees it when all references has gone. - No direct pointers between pcbs and node, all pointing is done via struct ngsock and protected with mutex.
* Fix two races which happen when netgraph is restructuring:glebius2005-11-021-8/+47
| | | | | | | | | | | | - Introduce ng_topo_mtx, a mutex to protect topology changes. - In ng_destroy_node() protect with ng_topo_mtx the process of checking and pointing at ng_deadnode. [1] - In ng_con_part2() check that our peer is not a ng_deadnode, and protect the check with ng_topo_mtx. - Add KASSERTs to ng_acquire_read/write, to make more understandible synopsis in case if called on ng_deadnode. Reported by: Roselyn Lee [1]
* Rework the ng_item queueing on nodes:glebius2005-11-022-124/+118
| | | | | | | | | | | | | - Introduce a new flags NGQF_QREADER and NGQF_QWRITER, which tell how the item should be actually applied, overriding NGQF_READER/NGQF_WRITER flags. - Do not differ between pending reader or writer. Use only one flag that is raised, when there are pending items. - Schedule netgraph ISR in ng_queue_rw(), so that callers do not need to do this job. - Fix several comments. Submitted by: julian
* Normalize a significant number of kernel malloc type names:rwatson2005-10-312-3/+3
| | | | | | | | | | | | | | | | | | | - Prefer '_' to ' ', as it results in more easily parsed results in memory monitoring tools such as vmstat. - Remove punctuation that is incompatible with using memory type names as file names, such as '/' characters. - Disambiguate some collisions by adding subsystem prefixes to some memory types. - Generally prefer lower case to upper case. - If the same type is defined in multiple architecture directories, attempt to use the same name in additional cases. Not all instances were caught in this change, so more work is required to finish this conversion. Similar changes are required for UMA zone names.
* Push the assignment of a new or updated so_qlimit from solisten()rwatson2005-10-304-6/+6
| | | | | | | | | | | | | | following the protocol pru_listen() call to solisten_proto(), so that it occurs under the socket lock acquisition that also sets SO_ACCEPTCONN. This requires passing the new backlog parameter to the protocol, which also allows the protocol to be aware of changes in queue limit should it wish to do something about the new queue limit. This continues a move towards the socket layer acting as a library for the protocol. Bump __FreeBSD_version due to a change in the in-kernel protocol interface. This change has been tested with IPv4 and UNIX domain sockets, but not other protocols.
* Use variable-sized arrays where appropriate.ru2005-10-285-7/+7
|
* Do not manually allocate/free device's softc structure.emax2005-10-261-14/+2
| | | | | Pointed by: jhb Reviewed by: imp, jhb
* - Use swi_remove() to teardown swi handlers rather thanjhb2005-10-261-2/+2
| | | | | intr_event_remove_handler(). - Remove tty: prefix from a couple of swi handler names.
* Catch up with new interrupt handling code.ru2005-10-261-3/+3
|
* Make the cookie constant name canonical.ru2005-10-251-1/+1
|
* Use new (inline) functions for calls into driver.phk2005-10-162-4/+2
|
* In preparation for making the modules actually use opt_*.h filesyar2005-10-141-0/+6
| | | | | | | | | | | | | | | | | provided in the kernel build directory, fix modules that were failing to build this way due to not quite correct kernel option usage. In particular: ng_mppc.c uses two complementary options, both of which are listed in sys/conf/files. Ideally, there should be a separate option for including ng_mppc.c in kernel build, but now only NETGRAPH_MPPC_ENCRYPTION is usable anyway, the other one requires proprietary files. nwfs and smbfs were trying to ensure they were built with proper network components, but the check was rather questionable. Discussed with: ru
* Further clean up the bridge hooks in if_ethersubr.c and ng_ether.cthompsa2005-10-141-17/+4
| | | | | | - move the function pointer definitions to if_bridgevar.h - move most of the logic to the new BRIDGE_INPUT and BRIDGE_OUTPUT macros - remove unneeded functions from if_bridgevar.h and sort a little.
* - When flushing node input queue, check whether item has a callback. Ifglebius2005-10-131-0/+6
| | | | | it does, then call it suppling ENOENT as error value. - Add assert, that helped to catch the above error.
* Clean up the if_bridge hooks a bit in if_ethersubr.c and ng_ether.c, movethompsa2005-10-131-19/+0
| | | | | | the broadcast/multicast test to bridge_input(). Requested by: glebius
* After rev. 1.103 the oitem and ierror are no longer needed, remove them.glebius2005-10-121-18/+4
|
* Fix a regression introduced in rev. 1.107. If an item once had a writerglebius2005-10-111-22/+28
| | | | | | | | | | | | | | | | semantics, and then was reused for next node, it still would be applied as writer again. To fix the regression the decision is made never to alter item->el_flags after the item has been allocated. This requires checking for overrides both in ng_dequeue() and in ng_snd_item(). Details: - Caller of the ng_apply_item() knows what is the current access to node and specifies it to ng_apply_item(). The latter drops the given access after item has beem applied. - ng_dequeue() needs to be supplied with int pointer, where it stores the obtained access on node. - Check for node/hook access overrides in ng_dequeue().
* Style and other fixes for the last commit.glebius2005-10-111-7/+9
| | | | Submitted by: ru
* ALTQ support for ng_iface(4). Before turning on please consult manual page.glebius2005-10-101-26/+68
|
* In ngt_input(), do not derefer sc (= (sc_p) tp->t_lsc) before makingtanimura2005-10-081-2/+5
| | | | sure sc != NULL.
* A deja vu of:glebius2005-10-071-2/+41
| | | | | | | | | | | | | | http://lists.freebsd.org/pipermail/cvs-src/2004-October/033496.html The same problem applies to if_bridge(4), too. - Copy-and-paste the if_bridge(4) related block from if_ethersubr.c to ng_ether.c - Add XXXs, so that copy-and-paste would be noticed by any future editors of this code. - Also add XXXs near if_bridge(4) declarations. Silence from: thompsa
* Remove bridge(4) from the tree. if_bridge(4) is a full functionalmlaier2005-09-271-4/+1
| | | | | | | | replacement and has additional features which make it superior. Discussed on: -arch Reviewed by: thompsa X-MFC-after: never (RELENG_6 as transition period)
* Fix commentemax2005-09-221-1/+1
|
* Finish last commit: actually remove compat methods from bt3c_pccard_methodsimp2005-09-221-7/+3
|
* Remove broken OLDCARD compat shims.imp2005-09-221-16/+4
| | | | | "PC Card" is the correct spelling. "PC-Card" isn't, per the PCMCIA standard.
* Dej'a vu of revision 1.35glebius2005-09-191-1/+1
| | | | | PR: kern/86258 Submitted by: Hiroshi Oota <ghelp excite.co.jp>
* When message can't fit into socket receive buffer return ENOBUFSglebius2005-09-121-2/+3
| | | | | | to userland program instead of letting it wait until end of days. PR: kern/85907
* Remove ng_callout_init_mtx() macro. Mutexed callouts are incompatibleglebius2005-09-121-1/+0
| | | | with netgraph(4).
* Fix an item leak, that happens when some node calls ng_callout() twoglebius2005-09-081-2/+6
| | | | | | | | | | | times consequently, without checking whether callout has been serviced or not. (ng_pptpgre and ng_ppp were catched in this behavior). - In ng_callout() save old item before calling callout_reset(). If the latter has returned 1, then free this item. - In ng_uncallout() clear c->c_arg. Problem reported by: Alexandre Kardanev
* Rework locking, that I have introduced recently, since it was incorrect:glebius2005-09-081-35/+54
| | | | | | | | | | | | | | | | | First, mutexed callouts are incompatible with netgraph nodes, because netgraph(4) can guarantee that the function will be called with mutex held. Second, nodes should not send data to their neighbor holding their mutex. A node does not know what stack can it enter sending data in some direction. May be executing will encounter a place to sleep. New locking: - ng_pptpgre_recv() and ng_pptpgre_xmit() must be entered with mutex held. - ng_pptpgre_recv() and ng_pptpgre_xmit() unlock mutex before sending data and then return unlocked. - callout routines acquire mutex themselves.
* Fix build.glebius2005-09-061-1/+1
|
* When we read data from socket buffer using soreceive() the socket layerglebius2005-09-061-4/+13
| | | | | | | | | | | | | | | | | | | | | | | does not clear m_nextpkt for us. The mbufs are sent into netgraph and then, if they contain a TCP packet delivered locally, they will enter socket code again. They can pass the first assert in sbappendstream() because m_nextpkt may be set not in the first mbuf, but deeper in the chain. So the problem will trigger much later, when local program reads the data from socket, and an mbuf with m_nextpkt becomes a first one. This bug was demasked by revision 1.54, when I made upcall queueable. Before revision 1.54 there was a very small probability to have 2 mbufs in GRE socket buffer, because ng_ksocket_incoming2() dequeued the first one immediately. - in ng_ksocket_incoming2() clear m_nextpkt on all mbufs read from socket. - restore rev. 1.54 change in ng_ksocket_incoming(). PR: kern/84952 PR: kern/82413 In collaboration with: rwatson
* In INVARIANTS case also check that nodes do not pass queues of mbufsglebius2005-09-061-1/+5
| | | | each other.
OpenPOWER on IntegriCloud