summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
Commit message (Collapse)AuthorAgeFilesLines
* Use kern_kldload() and kern_kldunload() to load and unload modules whenjhb2006-06-131-6/+5
| | | | | | | | we intend for the user to be able to unload them later via kldunload(2) instead of calling linker_load_module() and then directly adjusting the ref count on the linker file structure. This makes the resulting consumer code simpler and cleaner and better hides the linker internals making it possible to sanely lock the linker.
* When counting nodes second time, use the same criteria as forglebius2006-06-071-4/+4
| | | | | | | the first time. PR: kern/98529 Submitted by: Michael Heyman
* Use NET_CALLOUT_MPSAFE for netgraph callout initializer.glebius2006-06-062-3/+1
|
* add missed calls to bpf_peers_presentsam2006-06-021-1/+1
|
* Conditionally acquire Giant in netgraph callouts to honor mpsafenet=0.jhb2006-06-021-0/+2
| | | | | Reported by: sekes <gexlie at gmail dot com> MFC after: 1 week
* Replace the array initialization using the gcc-specific formatdds2006-06-021-5/+5
| | | | | | [constant] value with the C99 format [constant] = value
* Add new SIOC_HCI_RAW_NODE_LIST_NAMES ioctl. User-space applications canemax2006-05-173-1/+75
| | | | | | | | | | | | | use this ioctl to obtain the list of HCI nodes. User-space application is expected to preallocate 'ng_btsocket_hci_raw_node_list_names' structure and set limit in 'num_nodes' field. The 'nodes' field should be allocated as well and it should have space for at least 'num_nodes' elements. The SIOC_HCI_RAW_NODE_LIST_NAMES should be issued on bound raw HCI socket. It does not really really matter what HCI name the socket is bound to, as long as it is not empty. MFC after: 1 week
* Remove unneeded check.glebius2006-05-161-4/+0
| | | | Coverity ID: 445
* Do not leak kernel memory in case if userland has been compiledglebius2006-05-161-0/+1
| | | | | | against older NG_VERSION. Coverity ID: 1131
* o Replace disappeared URLs to Cisco docs by new ones, style.maxim2006-04-251-8/+14
| | | | No functional changes.
* o Set to zero engine_type, engine_id and pad (cisco calls itmaxim2006-04-251-0/+3
| | | | | | | | | | sampling_interval) fields in netflow v5 header. We do not use them but some netflow tools show garbage. PR: kern/96296 Submitted by: David Duchscher Approved by: glebius MFC after: 1 week
* Correct assertion in ng_detach().rwatson2006-04-061-1/+1
| | | | | Submitted by: tegge MFC after: 3 months
* Chance protocol switch method pru_detach() so that it returns voidrwatson2006-04-018-47/+21
| | | | | | | | | | | | | | | | | | | | | | | | | rather than an error. Detaches do not "fail", they other occur or the protocol flags SS_PROTOREF to take ownership of the socket. soclose() no longer looks at so_pcb to see if it's NULL, relying entirely on the protocol to decide whether it's time to free the socket or not using SS_PROTOREF. so_pcb is now entirely owned and managed by the protocol code. Likewise, no longer test so_pcb in other socket functions, such as soreceive(), which have no business digging into protocol internals. Protocol detach routines no longer try to free the socket on detach, this is performed in the socket code if the protocol permits it. In rts_detach(), no longer test for rp != NULL in detach, and likewise in other protocols that don't permit a NULL so_pcb, reduce the incidence of testing for it during detach. netinet and netinet6 are not fully updated to this change, which will be in an upcoming commit. In their current state they may leak memory or panic. MFC after: 3 months
* Change protocol switch pru_abort() API so that it returns void ratherrwatson2006-04-017-12/+12
| | | | | | | | | | | | | | than an int, as an error here is not meaningful. Modify soabort() to unconditionally free the socket on the return of pru_abort(), and modify most protocols to no longer conditionally free the socket, since the caller will do this. This commit likely leaves parts of netinet and netinet6 in a situation where they may panic or leak memory, as they have not are not fully updated by this commit. This will be corrected shortly in followup commits to these components. MFC after: 3 months
* Free private data when deleting hook.glebius2006-03-151-0/+2
| | | | | PR: kern/93952 Submitted by: Antoine Brodin <antoine.brodin laposte.net>
* Clear csum_flags after reading data from socket buffer. Otherwise,ru2006-02-211-0/+1
| | | | | | | | if ksocket is connected to an interface-type node somewhere later in the graph (e.g., ng_eiface or ng_iface), the csum_data may be applied to a wrong packet (if we encapsulate Ethernet or IP). MFC after: 3 days
* Remove unused now field.glebius2006-02-171-1/+0
|
* Unbreak this.ru2006-02-141-3/+1
|
* Don't count output bytes twice (the byte accouting is doneru2006-02-111-7/+4
| | | | | | in if.c). Count output errors. MFC after: 3 days
* - Increase maximum number of interfaces to 2048.glebius2006-02-091-9/+8
| | | | | | - Regroup softc so that frequently used elements are grouped in the beginning, while the interfaces array is at the end.
* Two fixes:ru2006-02-061-33/+33
| | | | | | | | | - Run send queue down to completion, not just one packet. It has been observed to cause a stall queue otherwise. - Prevent queueing multiple function calls to a node. MFC after: 3 days
* Fix module from panic.rik2006-01-291-0/+1
| | | | | Pointy hat: brooks MFC after: 3 days
* o Introduce D-Link compat mode, that is default to off and can be setglebius2006-01-272-64/+87
| | | | | | | | | | by NGM_PPPOE_SETMODE message. When D-Link compat mode is on, we will broadcast PADI with empty Service-Name to all listening hooks. o Rewrite the compatibility options. Before we had two modes - standard and non-standard (aka 3Com). Now we have standard mode and two compat flags, that can be combined. o Be consistent and do s/STUPID/3COM/g. I don't say that 3Com mode isn't stupid, just want to make code easier to read.
* From the RFC2516 it is not clear, what is the correct behavior for aglebius2006-01-261-43/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PPPoE AC, servicing a specific Service-Name, when client sends a PADI with an empty Service-Name. Should it reply with all available service names or should it be silent? Our implementation had chosen the latter, while some other had chosen the former (they say Linux and Cisco). Now some PPPoE clients appear, that rely on the assumption that AC will send all names in a PADO reply to a PADI with wildcard Service-Name. These clients can't connect to FreeBSD AC. I have requested comments from authors of RFC2516 via email, but received no reply. This change makes FreeBSD AC compatible with D-Link DI-614+ and D-Link DI-624+ SOHO routers, and probably others. Big thanks to D-Link's Russian office, namely Victor Platov, for assistance and support in investigation and testing of this change. Details: o Split pppoe_match_svc() into three different functions serving different purposes: - pppoe_match_svc() - match non-empty Service-Name tag from PADI against all available hooks in listening state. - pppoe_find_svc() - check that given Service-Name is not yet registered. - pppoe_broadcast_padi() - send a copy of PADI packet with empty Service-Name tag to all listening hooks. o For NGM_PPPOE_LISTEN message use pppoe_find_svc(). o In ng_pppoe_rcvdata() in a PADI case use pppoe_match_svc() for a non-empty Service-Name tag, and pppoe_broadcast_padi() in either case. A side effect from the above changes is that now pppoed(8) and mpd will reply to a empty Service-Name PADI sending a PADO with two Service-Name tags - an empty one and correct one. This is not fatal, and will be corrected in pppoed(8) and mpd later. No need to update node interface version. Supported by: D-Link
* Simplify ng_source_send() removing temporary queue and merging twoglebius2006-01-231-25/+9
| | | | cycles into one.
* - Remove debugging printfs.glebius2006-01-211-240/+243
| | | | | | | - Add some ktr(4) debugging. - Whitespaces at eols. - Tidy up comments. - u_intXX -> uintXX
* Fix two accesses to uninitialized variables that a revision 1.27ru2006-01-181-4/+8
| | | | | | has introduced. Found with: Coverity Prevent(tm)
* Initialize variable.glebius2006-01-141-1/+1
| | | | Found with: Coverity Prevent(tm)
* Make code simplier fixing memory leak.glebius2006-01-141-5/+2
| | | | Found with: Coverity Prevent(tm)
* Remove dead code.glebius2006-01-141-3/+0
| | | | Found with: Coverity Prevent(tm)
* Correct off-by-one errors.glebius2006-01-141-3/+3
| | | | Found with: Coverity Prevent(tm)
* Fix two memory leakages.glebius2006-01-141-4/+5
| | | | Found with: Coverity Prevent(tm)
* When sending export datagram from interrupt thread, use NG_QUEUEglebius2006-01-121-15/+15
| | | | | | | in flags. When sending export datagram from expiry thread, then use default zero flags. This removes unpleasant contention of the interrupt thread on mutexes (usually ng_ksocket's socket buffer mutex).
* Provide additional macros for sending netgraph items, which allowglebius2006-01-121-9/+17
| | | | | to use non-default flags for netgraph functions. Implement current macros via new ones.
* - Print also node ID in ktr(9) messages. [1]glebius2006-01-121-29/+33
| | | | | | | - Use fixed length for function name, making ktrdump(8) output easier to read. Suggested by: julian [1]
* Do not force queueing on peer hooks. This was important only forglebius2006-01-121-14/+0
| | | | | | | 5.0-CURRENT. And it looks like this didn't work before Julian's revamp of netgraph queue code. Reviewed by: julian
* Remove old debugging leftover.glebius2006-01-122-11/+1
| | | | Reviewed by: julian
* Mark appropriate commands with NGM_READONLY and NGM_HASREPLY andglebius2006-01-121-7/+7
| | | | bump type cookie.
* In the splnet(9) times netgraph(4) was synchronous and if a messageglebius2006-01-121-18/+32
| | | | | | | | | | | | | | | | | | had been replied, the reply was always delivered to the originator synchronously. With introduction of netgraph item callbacks and a wait channel with mutex in ng_socket(4), we have fixed the problem with ngctl(8) returning earlier than the command has been proceeded by target node. But still ngctl(8) can return prior to the reply has arrived to its node. To fix this: - Introduce a new flag for netgraph(4) messages - NGM_HASREPLY. This flag is or'ed with message like NGM_READONLY. - In netgraph userland library if we have sent a message with NGM_HASREPLY flag, then select(2) until reply comes. - Mark appropriate generic commands with NGM_HASREPLY flag, gathering them into one enum {}. Bump generic cookie.
* Fix wording in last commit.glebius2006-01-121-1/+1
| | | | Submitted by: julian
* Add ktr(9) hooks to easier tracing of the netgraph item flow throughglebius2006-01-111-2/+36
| | | | netgraph.
* 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
|
OpenPOWER on IntegriCloud