summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* - 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.
OpenPOWER on IntegriCloud