summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
Commit message (Collapse)AuthorAgeFilesLines
* Remove obsoleted sysctl interface for switching between standard and 3Comglebius2005-07-051-39/+1
| | | | | | | | | | PPPoE modes. The interface was declared obsoleted before 5.3-RELEASE. When running as access concentrator ng_pppoe(4) supports both modes simultanously. When running as client mode can be swicthed in ppp(8) configuration. Approved by: re (scottl)
* In the splnet times, netgraph was functional and synchronous. Nowadays,glebius2005-07-054-3/+82
| | | | | | | | | | | | | | | | | | | | | | an item may be queued and processed later. While this is OK for mbufs, this is a problem for control messages. In the framework: - Add optional callback function pointer to an item. When item gets applied the callback is executed from ng_apply_item(). - Add new flag NG_PROGRESS. If this flag is supplied, then return EINPROGRESS instead of 0 in case if item failed to deliver synchronously and was queued. - Honor NG_PROGRESS in ng_snd_item(). In ng_socket: - When userland sends control message add callback to the item. - If ng_snd_item() returns EINPROGRESS, then sleep. This change fixes possible races in ngctl(8) scripts. Reviewed by: julian Approved by: re (scottl)
* - After LibAlias processing check for TCP packet with th_x2 fieldglebius2005-06-271-8/+51
| | | | | | | | set. If found, then recalculate its checksum. - Remove debugging printfs. - Slightly rearrange code in ng_nat_rcvdata(). Approved by: re (scottl)
* Fix some long standing bugs in writing to the BPF device attached todwmalone2005-06-262-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | a DLT_NULL interface. In particular: 1) Consistently use type u_int32_t for the header of a DLT_NULL device - it continues to represent the address family as always. 2) In the DLT_NULL case get bpf_movein to store the u_int32_t in a sockaddr rather than in the mbuf, to be consistent with all the DLT types. 3) Consequently fix a bug in bpf_movein/bpfwrite which only permitted packets up to 4 bytes less than the MTU to be written. 4) Fix all DLT_NULL devices to have the code required to allow writing to their bpf devices. 5) Move the code to allow writing to if_lo from if_simloop to looutput, because it only applies to DLT_NULL devices but was being applied to other devices that use if_simloop possibly incorrectly. PR: 82157 Submitted by: Matthew Luckie <mjl@luckie.org.nz> Approved by: re (scottl)
* Eliminate unused argument in PCMCIA_CARD macro.imp2005-06-241-1/+1
| | | | | | | | Provide a backwards compatible way to have the extra macro by defining PCCARD_API_LEVEL 5 before including pccarddevs for driver writers that want/need to have the same driver on 5 and 6 with pccard attachments. Approved by: re (dwhite)
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-108-78/+85
| | | | | | | | | | | | | | | | | | | | struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam
* - Remove redundant parenthesis in M_CHECK macro.glebius2005-06-101-13/+8
| | | | | | | | - Do not edit pullup_len outside M_CHECK macro. - Do not reimplement NG_FWD_NEW_DATA(). - Remove redundant check for item being not NULL. Submitted by: ru
* Add ng_tcpmss node, which alters MSS options of TCP packets. Useful toglebius2005-06-102-0/+525
| | | | | | | | | | | hack MSS of packets outgoing via interface with small MTU, to workaround path MTU discovery problems. Written by Alexey Popov, with some cleanups from me. There are also plans to improve mpd port, so that it uses this node, instead of doing MSS hacking in userland, when 'enable tcpmssfix' option is on. Submitted by: Alexey Popov <lollypop@flexuser.ru>
* Refer to the mbuf header length field via the official method.ru2005-06-091-8/+8
|
* Update statistics only in case if delivery was successfull.glebius2005-06-071-2/+4
|
* MPPC node is not thread safe.glebius2005-06-031-0/+3
| | | | | | | PR: kern/79990 Reported by: Arcadiy Ivanov Reported by: atckoe.zlo @ gmail.com MFC after: 1 week
* Fix check for leading zero, so that it does not block two zeroesglebius2005-05-291-1/+5
| | | | in hook name.
* Fix use of uninitialized variable len in ngd_send.bz2005-05-281-3/+7
| | | | | | | | | Note: len gets intialized to 0 for sap == NULL case only to make compiler on amd64 happy. This has nothing todo with the former uninitialized use of len in sap != NULL case. Reviewed by: glebius Approved by: pjd (mentor)
* Move AVM USB Bluetooth-Adapter BlueFritz! from "broken" devices listemax2005-05-281-4/+6
| | | | | | | (where I incorrectly put it initially) to "ignored" devices list (where it should be). Pointy hat goes to me. MFC after: 3 days
* Remove local error variable, which leads to hiding error from returnglebius2005-05-231-1/+0
| | | | | | | | value. PR: kern/81371 Submitted by: Wojciech A. Koszek MFC after: 1 week
* Return EINVAL for incorrect hook names.glebius2005-05-231-3/+2
| | | | | PR: kern/81349 Submitted by: Wojciech A. Koszek
* - Unwind NG_SEND_MSG_PATH() macro and merge it with already unwindedglebius2005-05-171-28/+26
| | | | | version under TRACE_MESSAGES. - Pass NG_WAITOK flag to ng_package_data() in unwinded macro.
* Use NG_QUEUE instead of constant.glebius2005-05-161-1/+1
|
* Refactor places where ng_package_data() failed.glebius2005-05-161-13/+13
| | | | Suggested & reviewed by: archie
* - Fix build with TRACE_MESSAGES on.glebius2005-05-161-41/+42
| | | | | | - Reformat code under TRACE_MESSAGES to make it more readable. - Move linker hackery out of #ifdef. - Break long lines in linker hackery block.
* Close race between node being shutdown and socket being detached. Toglebius2005-05-161-7/+27
| | | | | | | do this, obtain netgraph locking in detach method via ng_send_fn1(). Reviewed by: julian MFC after: 2 weeks
* Catch up with new ng_package_data().glebius2005-05-161-1/+1
|
* Catch up with new ng_package_data(). Use NG_WAITOK on userlandglebius2005-05-161-1/+1
| | | | path.
* - Catch up with new interface to ng_package_data().glebius2005-05-161-5/+8
| | | | - Handle errors from ng_package_data().
* Catch up with new ng_send_fn1() interface.glebius2005-05-161-1/+4
|
* - Extend interface of ng_getqblk(), so that malloc wait flags areglebius2005-05-162-36/+34
| | | | | | | | | | | | specified by caller. - Change ng_send_item() interface - use 'flags' argument instead of boolean 'queue'. - Extend ng_send_fn(), ng_package_data() and ng_package_msg() interface - add possibility to pass flags. Rename ng_send_fn() to ng_send_fn1(). Create macro for ng_send_fn(). - Update all macros, that use ng_package_data() and ng_package_msg(). Reviewed by: julian
* Make NETGRAPH_DEBUG a kernel option, so that it can't be turned offglebius2005-05-161-1/+3
| | | | | | without hacking source. In collaboration with: ru, julian
* Move queue element routines upper, so that all relatedglebius2005-05-141-85/+85
| | | | | declarations are in one place, to improve readability. No functional changes.
* Use uma(9) for allocating netgraph items:glebius2005-05-142-109/+48
| | | | | | | | | | | - ng_getqblk() simply runs uma_zalloc(). - ng_free_item() simply frees. - ngq_mtx is pushed down under NETGRAPH_DEBUG. - NGQF_FREE is removed. Increase default maxalloc to 512. Reviewed by: julian
* When used as divert socket we need to decouple stack when node is enteredglebius2005-05-131-1/+3
| | | | from socket side. Use ng_queue_fn() instead of ng_send_fn().
* Since there is no way to queue a function call to node, createglebius2005-05-132-3/+18
| | | | ng_queue_fn() - a queue version of ng_send_fn().
* - Gather statistics about failed mbuf+cluster+ng_item allocations.glebius2005-05-122-11/+12
| | | | - Adjust comments and variables names in nfinfo.
* A new version of NetFlow node.glebius2005-05-114-302/+340
| | | | | | | | | | | | | | | | | | | The most significant changes are: - Use UMA zone instead of own chunk of memory. - Lock each hash entry separately. - Expire items "actively" - interrupt method can expire flows from hash slot, when it searches through it. - Remove global tailqueue. Make callout thread search through every hash slot. - Export datagram is detached from private data and filled. If it is incomplete, it is attached back. Another thread will continue working with it. Lesser, but also important speedups: - Flows in hash slot are stored in tailqueue. Whenever a flow is hit, it is moved to the begging, so it can be located quicker. - When callout thread works with hash slot it bails out if slot mutex is contested.
* Move assertion below initializer.glebius2005-05-111-3/+3
| | | | | Submitted by: Noritoshi Demizu Pointy hat to: glebius
* Mark AVM USB Bluetooth-Adapter BlueFritz! as "broken". This device is notemax2005-05-101-1/+1
| | | | | | | | supported by ng_ubt(4) driver and needs its own driver. PR: kern/76205 Submitted by: Tim Hemel < bsd AT timit DOT nl > MFC after: 1 week
* - Assert that mbuf length equals packet length.glebius2005-05-101-5/+10
| | | | | - Tell libalias, that we have MCLBYTES to play with. - Obtain length of data in mbuf from updated IP header.
* ng_nat - a netgraph(4) node, which does NATglebius2005-05-052-0/+351
|
* Change m_uiotombuf so it will accept offset at which data should be copiedemax2005-05-041-1/+1
| | | | | | | | | | to the mbuf. Offset cannot exceed MHLEN bytes. This is currently used to fix Ethernet header alignment problem on alpha and sparc64. Also change all users of m_uiotombuf to pass proper offset. Reviewed by: jmg, sam Tested by: Sten Spans "sten AT blinkenlights DOT nl" MFC after: 1 week
* - Initialize interface as UP when hook is connected.glebius2005-04-201-2/+5
| | | | | | | - Call if_link_state_change() when netgraph flow control messages are received. Sponsored by: Rambler
* When netgraph flow control message comes from downstream, broadcastglebius2005-04-201-0/+28
| | | | | | it to all vlans. Sponsored by: Rambler
* Remove extra ifnet pointer from private data. It can be accessed via arpcom.glebius2005-04-201-6/+5
|
* Add macro NG_COPYMESSAGE(), which allocates memory and creates aglebius2005-04-201-1/+22
| | | | copy of given control message.
* Fix panics with misconfigured routing:glebius2005-04-181-6/+8
| | | | | | | - Backout previous revision, the check is useless. - Turn node to queue mode, since it is edge node. Reported by: sem
* - Return error, if there was one.glebius2005-04-151-2/+2
| | | | | | | - No need to initialize error here. PR: kern/79884 Submitted by: Wojciech A. Koszek
* NG_MKRESPONSE() macro includes sizeof struct ng_mesg when doing allocation.glebius2005-04-131-2/+1
| | | | | PR: kern/79806 Submitted by: Wojciech A. Koszek
* Remove goto.glebius2005-04-111-20/+16
|
* Change the embedded module name from "bluetooth" to "ng_bluetooth" to matchpeter2005-04-081-1/+1
| | | | the rest of the names assigned to this object.
* Correct typo that could cause FIFO overflow.emax2005-04-061-1/+1
| | | | | PR: kern/78431 MFC after: 3 days
* Remove PR_ATOMIC flag in ng_btsocket_protosw[] for BLUETOOTH_PROTO_RFCOMMemax2005-04-061-1/+1
| | | | | | | | protocol. RFCOMM is a SOCK_STREAM protocol not SOCK_SEQPACKET. This was a serious bug caused by cut-and-paste. I'm surprised it did not bite me before. Dunce hat goes to me. MFC after: 3 days
* In ng_btsocket_rfcomm_receive_frame() correctly set length variable whenemax2005-04-061-1/+1
| | | | | | | EA bit is set in hdr->length (16-bit length). This currently has no effect on the rest of the code. It just fixes the debug message. MFC After: 3 weeks
OpenPOWER on IntegriCloud