summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
Commit message (Collapse)AuthorAgeFilesLines
* Added m_tag_copy_chain() call to copy original outgoing packet tags to all ofmav2007-04-201-0/+1
| | | | | | | it's fragments. Reviewed by: archie Approved by: glebius (mentor)
* Optimized packet distribution plan for the equal links case. Do notmav2007-04-201-13/+20
| | | | | | | | split packet on fragments smaller then MP_MIN_FRAG_LEN to reduce total overhead. Reviewed by: archie Approved by: glebius (mentor)
* - Changed sequence numbers processing to avoid incorrect timeout waitingmav2007-04-201-66/+65
| | | | | | | | | | | | when one of links is inactive and have stale sequence number. To avoid this sequence numbers of all links are getting updated on every successful packet reassembling. - ng_ppp_bump_mseq function created to simplify code. - ng_ppp_frag_drop function separated from ng_ppp_frag_process to simplify code. Reviewed by: archie Approved by: glebius (mentor)
* - Fixed mistakes in latency and xmitBytes calculation mathmav2007-04-201-6/+22
| | | | | | | | | | | | which lead to ineffective multilink packet distribution plans. - Changed bytesInQueue calculation math to have more precise information about links utilization. - Taken rough account of the link overhead. Better way to do it could be to get exact overhead from user-level, but I have not done it to keep binary compatibility. Reviewed by: archie Approved by: glebius (mentor)
* We don't need spinning locks here. Change them to the adaptive mutexes. Thiswkoszek2007-03-311-6/+6
| | | | | | | change should bring no performance decrease, as it did not in my tests. Reviewed by: julian, glebius Approved by: cognet (mentor)
* Instead of direct manipulation on queue and worklist mutexes, bring macroswkoszek2007-03-301-27/+40
| | | | | | | | for doing this job. This change will make it easy to migrate from using spinning locks to adaptive ones. Reviewed by: glebius, julian Approved by: cognet (mentor)
* Try to silence Coverity by adding (void) in front of function call.emax2007-03-281-1/+11
| | | | | | | Also add a comment, explaining why return value is not being checked. Requested by: netchild MFC after: 1 week
* Bump maximum number of interface hooks to the maximum possible value.glebius2007-03-282-1/+2
| | | | | | | | This will increase the memory consumption for more than 1 Mb, but this is required for operation on multiinterface access concentrators running mpd. Requested by: Alexander Motin
* o Update a comment: sonewconn() lives in uipc_socket.c now.maxim2007-03-261-1/+1
|
* Implement reference counting for ifmultiaddr, in_multi, and in6_multibms2007-03-201-3/+18
| | | | | | | | | | | | | | | | | | | structures. Detect when ifnet instances are detached from the network stack and perform appropriate cleanup to prevent memory leaks. This has been implemented in such a way as to be backwards ABI compatible. Kernel consumers are changed to use if_delmulti_ifma(); in_delmulti() is unable to detect interface removal by design, as it performs searches on structures which are removed with the interface. With this architectural change, the panics FreeBSD users have experienced with carp and pfsync should be resolved. Obtained from: p4 branch bms_netdev Reviewed by: andre Sponsored by: Garance A Drosehn Idea from: NetBSD MFC after: 1 month
* Prefer more traditional spellings of some words in comments.rwatson2007-03-181-15/+15
|
* oops committed the wrong patch.julian2007-03-101-6/+10
| | | | try this one..
* ng_apply_item should be void. It is called from the interrupt source orjulian2007-03-091-14/+85
| | | | | | | | | | from whoever has dequeued the item from the queue. Generally they have no interest in the result, and even if it is called by the queuer, it should still pretend that it was queued. The queuer should be assuming that the call was queued and giving them the false confidence that they are getting status leads to hard to find bugs. Make it a void and remove all the code that tried to return status through it.
* ng_send_fn() can return with an error, the function of interestru2007-03-081-1/+2
| | | | | | | will never be called and OACTIVE will never be reset. Fix this. Submitted by: Vsevolod Lobko MFC after: 3 days
* Ensure message passed to "settimestamp" and "setcounter" is the rightemaste2007-03-021-1/+9
| | | | | | length. Use NULL instead of 0. Submitted by: glebius, ru
* Add "setcounter" and "getcounter" messages, providing the the abilityemaste2007-03-022-0/+137
| | | | | | | | | | | | | to embed up to four counters in outgoing packets. The message specifies the offset at which the counter should be inserted as well as the parameters of the counter. Example usage: ngctl msg src0: setcounter \ '{ index=0 offset=0x40 flags=1 width=4 increment=1 max_val=12345 }' Sponsored by: Sandvine Incorporated
* Add "settimestamp" and "gettimestamp" messages, providing the the abilityemaste2007-03-012-5/+139
| | | | | | | | | | | | | to embed a timestamp (struct timeval) in outgoing packets. The message specifies the offset at which the timestamp should be inserted. NG_SOURCE(4) gives an example usage that queues an ICMP packet. Using that example, the following command will insert a timestamp in the ICMP's data payload: ngctl msg src0: settimestamp '{ offset=0x2a flags=1 }' Sponsored by: Sandvine Incorporated
* 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
|
OpenPOWER on IntegriCloud