summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
Commit message (Collapse)AuthorAgeFilesLines
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-231-1/+1
| | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@
* In the output path, mask off M_BCAST|M_MCAST so as to prevent incorrectbms2007-02-091-0/+3
| | | | | | | | | | addressing if a packet is later re-encapsulated and sent to a non-broadcast, non-multicast destination after being received on the ng_ksocket input hook. PR: 106999 Submitted by: Kevin Lahey MFC after: 4 weeks
* Quoting Alexander:glebius2007-02-021-4/+5
| | | | | | | | | | | | | | | | | | | Formulas described in RFC require high precision of floating point. Formulas of integer math implemented in ng_pptpgre give mistake in range of +0-7ms on RTT and +0-3ms on deviation. This leads to significant underestimation of real packet RTT. I have made a very simple patch to reduce mistake to +4-3ms on RTT and +2-1ms on deviation. Mistake in RTT is not good, but gets covered by deviation. To cover worst possible negative mistake in deviation I have added 2ms to it. Also this 2 ms cover the case when measured deviation is so small (about zero) that it can interfere with process scheduling delays or weather on Mars. My tests show decreasing of packet losses on 20ms RTT link from 2.5% to 0.3% while speed increased un 1/3. Reviewed by: archie
* - Create ng_ppp_bypass() function, that prepares a packetglebius2007-01-251-30/+66
| | | | | | | | | | | | | | with bypass header, to send it out to userland. - Use ng_ppp_bypass() in ng_ppp_proto_recv(). - Use ng_ppp_bypass() in ng_ppp_comp_recv() and in ng_ppp_crypt_recv() if compression or encryption is disabled, respectively. - Any LCP packet goes directly to ng_ppp_bypass(), instead of passing through PPP stack. - Any non-LCP packet on disabled link is discarded. This is behavior defined in RFC. Submitted by: Alexander Motin <mav alkar.net>
* A less draconian fix to the build.mjacob2007-01-181-3/+1
|
* Temporarily comment out the KASSERT that broke the kernel build.obrien2007-01-181-0/+2
|
* Revise the ng_ppp(4) node, so that code flow is more clear. All non-linkglebius2007-01-181-514/+805
| | | | | | | | hooks get their per hook rcvdata methods, and all functions are organized corresponding to protocol stack model. Submitted by: Alexander Motin <mav alkar.net> Reviewed by: archie, julian
* Whitespace cleanup.glebius2007-01-152-14/+14
| | | | Checked with: cvs diff -b
* Update ip and tcp pointers after m_pullup().glebius2007-01-151-0/+3
| | | | Submitted by: Alexander Motin <mav alkar.net>
* Fix accounting of incoming octets.glebius2007-01-101-1/+2
| | | | Submitted by: Alexander Motin <mav alkar.net>
* Various bpf(4) related fixes to catch places up to the new bpf(4)jhb2006-12-291-4/+2
| | | | | | | | | | | | | semantics. - Stop testing bpf pointers for NULL. In some cases use bpf_peers_present() and then call the function directly inside the conditional block instead of the macro. - For places where the entire conditional block is the macro, remove the test and make the macro unconditional. - Use BPF_MTAP() in if_pfsync on FreeBSD instead of an expanded version of the old semantics. Reviewed by: csjp (older version)
* A node that implements Predictor-1 compression for PPP.glebius2006-12-292-0/+781
| | | | Submitted by: Alexander Motin <mav alkar.net>
* A node that implements the Deflate sub-protocols of the Compression Controlglebius2006-12-282-0/+768
| | | | | | Protocol (CCP). Submitted by: Alexander Motin <mav alkar.net>
* Before this commit, if the compression is enabled the, ng_ppp(4)glebius2006-12-282-48/+127
| | | | | | | | | | | | | | | | | | | | | | | | | node would send every outgoing frame to the "compress" hook. Packets received on the "compress" hook were expected to be compressed and PROT_COMPD tag was put on them unconditionally. After this commit an alternative compression mode can be set. In this mode the node doesn't put the PROT_COMPD, the compressor should put it itself. This is important for such kind of compressors, that can submit uncompressed frames. Before this commit, if the decompression is enabled, the ng_ppp(4) node would send and incoming frame to the "decompress" hook only if it has the PROT_COMPD proto tag on it. After this commit an alternative decompression mode can be set. In this mode the node sends all the incoming packets to the decompression hook. This is important for such kind of compressors that need uncompressed packets too, to keep their library in sync. These new features will be used in new version of mpd4, and in new compressor nodes. Submitted by: Alexander Motin <mav alkar.net>
* Return value PKT_ALIAS_FOUND_HEADER_FRAGMENT isn't an error case. Theglebius2006-12-211-1/+2
| | | | | | packet shouldn't be dropped. Submitted by: Alexander Motin <mav alkar.net>
* Correctly calculate length of IP header.glebius2006-12-121-1/+2
| | | | Submitted by: Eugene Hartmann <eugene tpsb.com.ru>
* Remove m_megapullup from ng_nat and put it under libalias.piso2006-12-011-35/+0
| | | | Approved by: gleb
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-11-065-6/+14
| | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
* Rename m_getm() to m_getm2() and rewrite it to allocate up to page sizedandre2006-11-021-1/+1
| | | | | | | | | | | | | | mbuf clusters. Add a flags parameter to accept M_PKTHDR and M_EOR mbuf chain flags. Provide compatibility macro for m_getm() calling m_getm2() with M_PKTHDR set. Rewrite m_uiotombuf() to use m_getm2() for mbuf allocation and do the uiomove() in a tight loop over the mbuf chain. Add a flags parameter to accept mbuf flags to be passed to m_getm2(). Adjust all callers for the extra parameter. Sponsored by: TCP/IP Optimization Fundraise 2005 MFC after: 3 month
* Check pointer before dereferencing.glebius2006-10-181-1/+2
| | | | | Reported by: Coverity CID: 1556
* Some clenaup of ngs_rcvmsg():glebius2006-10-171-60/+46
| | | | | | | - Inline ship_msg() into ngs_rcvmsg(). - Plug memory leak in case if no control socket present. - Remove malloc() and allocate the sockaddr on stack. - style(9).
* Some cleanup and small changes:glebius2006-10-171-121/+74
| | | | | | | | | | - Use malloc() and free() instead of MALLOC() and FREE() macros. - Do not check malloc results if M_WAITOK was used. - Remove linked list of all netgraph sockets. It isn't needed. - Use ng_findhook() instead of searching the list ourselves. - Use NG_WAITOK in syscalls. - Remove unneeded includes. - style(9)
* Make the sg_len and sg_family members of the sockaddr_ng the same typeglebius2006-10-171-5/+3
| | | | as the corresponding values in sockaddr are.
* Make ng_ID_t fixed size, so that its maximum value is platform independent.glebius2006-10-171-2/+2
| | | | This will be important in future.
* - ng_address_ID() has already freed the message, don't do double free.glebius2006-10-171-6/+2
| | | | | | - Get error from ng_address_ID(). Reported by: Coverity via pjd
* Fix result of some mechanical change that I did some time ago, whenglebius2006-10-131-2/+2
| | | | writing this node.
* Recognize 802.1q frames in Ethernet input and process them.glebius2006-10-111-1/+29
| | | | | PR: kern/101162 Submitted by: CoolDavid (Tseng Guo-Fu) <cooldavid cdpa.nsysu.edu.tw>
* Do not leak hooks in ng_bypass().glebius2006-10-111-0/+3
| | | | Submitted by: Alexander Motin <mav alkar.net>
* Make it buildable.glebius2006-10-111-1/+1
|
* Unbreak a short one.glebius2006-10-111-2/+1
| | | | Submitted by: maxim
* Break long line.glebius2006-10-111-1/+2
|
* Use hash functions with better distribution. Tested on live traffic.glebius2006-10-111-12/+12
| | | | Submitted by: Alexander Motin <mav alkar.net>
* Use bitcount32() from sys/systm.h instead of my own.glebius2006-10-111-17/+4
|
* Don't use data after free.netchild2006-09-301-1/+4
| | | | | | Found by: Coverity Prevent CID: 536 Submitted by: harti (via vs)
* Move ethernet VLAN tags from mtags to its own mbuf packet header fieldandre2006-09-171-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | m_pkthdr.ether_vlan. The presence of the M_VLANTAG flag on the mbuf signifies the presence and validity of its content. Drivers that support hardware VLAN tag stripping fill in the received VLAN tag (containing both vlan and priority information) into the ether_vtag mbuf packet header field: m->m_pkthdr.ether_vtag = vlan_id; /* ntohs()? */ m->m_flags |= M_VLANTAG; to mark the packet m with the specified VLAN tag. On output the driver should check the mbuf for the M_VLANTAG flag to see if a VLAN tag is present and valid: if (m->m_flags & M_VLANTAG) { ... = m->m_pkthdr.ether_vtag; /* htons()? */ ... pass tag to hardware ... } VLAN tags are stored in host byte order. Byte swapping may be necessary. (Note: This driver conversion was mechanic and did not add or remove any byte swapping in the drivers.) Remove zone_mtag_vlan UMA zone and MTAG_VLAN definition. No more tag memory allocation have to be done. Reviewed by: thompsa, yar Sponsored by: TCP/IP Optimization Fundraise 2005
* Fix input byte counting. Now the sum of the ipackets/ibytes countersru2006-09-151-2/+8
| | | | | | | | | of individual interfaces should match the ipackets/ibytes counter of the aggregate (FEC) interface. PR: kern/82189 Submitted by: Stikheev Andrew <sand AT zunet DOT ru> MFC after: 3 days
* Make it possible to set a larger MTU by attempting to set MTUs on allru2006-09-151-1/+19
| | | | | | | | | | | | | | | trunk ports first. If that succeeds, and we're inside our own bounds, so be it. Still not ideal -- adding a port after changing an MTU doesn't change port's MTU, but a step in the right direction. PR: kern/95417 Submitted by: Vladimir Ivanov <wawa AT yandex-team DOT ru> MFC after: 3 days I've slightly edited a patch to make the conditional logic positive and remove (what I think was) a redundant ng_fec_init() call.
* SIOCSIFFLAGS doesn't require an argument in kernel land; instead, flagsru2006-09-151-1/+1
| | | | | | | | | are supposed to be set directly in ifnet already. This change fixes a panic when ng_eiface node is attached to ng_fec node and the latter is shut down (ng_fec sets flags and then calls SIOCSIFFLAGS with a NULL argument). MFC after: 3 days
* s/USBDEVNAME/device_get_nameunit/gemax2006-09-072-110/+105
| | | | s/USBBASEDEVICE/device_t/g
* more usb fallout changesmjacob2006-09-073-75/+86
|
* - Catch up with ongoing rwatson's socket work;emax2006-08-252-184/+68
| | | | | | | | | | - Fix a couple of LORs and panics; - Temporarily remove the code that tries to cleanup sockets that stuck on accepting queues (both complete and incomplete). I'm taking an ostrich approach here until I find a better way to deal with sockets that were disconnected before accepting (i.e. while socket was on complete or incomplete accept queue).
* Fix another fallout from the IF_LLADDR() type change.ru2006-08-241-1/+2
| | | | Spotted by: mwlucas
* Define mtu as u_int16_t not as int. This should fix problem with rfcommemax2006-08-241-1/+2
| | | | | | | | on sparc64. Reported by: Andrew Belashov <bel at orel dot ru> Tested by: Andrew Belashov <bel at orel dot ru> MFC after: 3 days
* Some perfectionizm against last revision.glebius2006-08-101-2/+2
| | | | Submitted by: ru
* Fix ng_pppoe(4) after turning off "autosrc feature" on ng_ether(4).glebius2006-08-092-21/+74
| | | | | | | | | | | | - Store the Ethernet header in node softc. - Initialize header with dst addr and ethertype in node constructor method. - In node connect method send NGM_ETHER_GET_ENADDR message downwards. - If received reply from ng_ether(4) store the src addr in softc. - Add NGM_PPPOE_SETENDADDR message that allows user to override the address with whatever he/she wants.
* - Use log(9) instead of printf(9).glebius2006-08-071-26/+44
| | | | | | | | - Print node ID, where possible. - Prepend log messages with function name, or at least with "ng_pppoe". Reviewed by: julian Tested by: Joao Barros <joao.barros gmail.com>
* Turn off by default "feature" that overwrites MAC addressglebius2006-08-041-1/+0
| | | | | | | | on output frames. Many people were confused with not working CARP, ng_bridge(4) and other subsystems, because ng_ether(4) overwritten source MAC address.
* Remove the dependency of bridgestp.h on if_bridgevar.h by moving a couple ofthompsa2006-07-271-1/+0
| | | | private structures to if_bridge.c.
* Fixing compilation bustage: net/if_bridgevar.h depends on net/bridgestp.h.avatar2006-07-271-0/+1
|
* soreceive_generic(), and sopoll_generic(). Add new functions sosend(),rwatson2006-07-242-9/+7
| | | | | | | | | | | | | | | | soreceive(), and sopoll(), which are wrappers for pru_sosend, pru_soreceive, and pru_sopoll, and are now used univerally by socket consumers rather than either directly invoking the old so*() functions or directly invoking the protocol switch method (about an even split prior to this commit). This completes an architectural change that was begun in 1996 to permit protocols to provide substitute implementations, as now used by UDP. Consumers now uniformly invoke sosend(), soreceive(), and sopoll() to perform these operations on sockets -- in particular, distributed file systems and socket system calls. Architectural head nod: sam, gnn, wollman
OpenPOWER on IntegriCloud