summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_pptpgre.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove alignment constraints.mav2010-04-011-11/+11
|
* Retire the MALLOC and FREE macros. They are an abomination unto style(9).des2008-10-231-2/+2
| | | | MFC after: 3 months
* Some minor code and math optimizations.mav2008-03-261-40/+21
|
* Rewrite node to support multiple hooks, alike to ng_l2tp, to use one pairmav2008-03-241-241/+280
| | | | | | | | | | | | | | of pptpgre and ksocket nodes for all calls between two peers. This patch modifies node's API by adding new "session_%04x" hook names support, while keeping backward compatibility. Together with appropriate user-level support (by latest mpd5) it gives huge performance benefits for case of multiple active calls between two peers because of avoiding data duplication and extra socket processing. On my benchmarks I have got more then 10 times speedup for the 200 simultaneous PPTP calls between two peers. In conclusion, it allows now to build effective "clients <=> PAC <=> PNS" setups.
* 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
* Rework locking, that I have introduced recently, since it was incorrect:glebius2005-09-081-35/+54
| | | | | | | | | | | | | | | | | First, mutexed callouts are incompatible with netgraph nodes, because netgraph(4) can guarantee that the function will be called with mutex held. Second, nodes should not send data to their neighbor holding their mutex. A node does not know what stack can it enter sending data in some direction. May be executing will encounter a place to sleep. New locking: - ng_pptpgre_recv() and ng_pptpgre_xmit() must be entered with mutex held. - ng_pptpgre_recv() and ng_pptpgre_xmit() unlock mutex before sending data and then return unlocked. - callout routines acquire mutex themselves.
* Lock down PPTP node, since it has many data structures, that won't surviveglebius2005-08-301-7/+25
| | | | | | | | | | | | | | | | parallel ng_pptp_rcvdata(): - Add a per-node mutex. - Acquire mutex during all ng_pptp_rcvdata() method. - Make callouts protected by mutex. Now callouts count as netgraph writers, but there are plans to allow reader callouts for nodes, that have internal locking. - Acquire mutex in ng_pptp_reset(), which can be triggered by a message or node shutdown. PR: kern/80035 Tested by: Deomid Ryabkov <myself rojer.pp.ru> Reviewed by: Deomid Ryabkov <myself rojer.pp.ru>
* Utilize callout_pending() macroglebius2005-01-111-1/+1
|
* /* -> /*- for license, minor formatting changesimp2005-01-071-2/+3
|
* Use ng_callout() and ng_uncallout() instead of home-grownglebius2004-12-091-108/+17
| | | | | | | | implementation. Tested by: Savchuk Taras Reviewed by: archie Approved by: julian (mentor)
* Increase PPTP_MAX_TIMEOUT up to 3 seconds. 10 prooved too much for high packetglebius2004-09-061-1/+1
| | | | | | | | | | loss links, and 1 second appeared to be too small for high latency links. If we will receive more complaints, we should make this parameter configurable. PR: kern/69536 Approved by: archie, julian (mentor) MFC after: 3 days
* Switch to using C99 sparse initialisers for the type methods array.julian2004-05-291-12/+9
| | | | | | | | Should make no binary difference. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru> Reviewed by: Harti Brandt <harti@freebsd.org> MFC after: 1 week
* Add 'enableWindowing' configuration knob to the ng_pptpgre(4) netgraph node.archie2004-04-261-35/+49
| | | | | Submitted by: Michael Bretterklieber <mbretter@a-quadrat.at> MFC after: 2 weeks
* Lower the maximum ACK timeout for GRE packets from 10 to 1 second.archie2003-11-181-1/+1
| | | | | | | | | In practice it seems that in situations of high packet loss the ACK timeout seems to hit this maximum (perhaps inappropriately, but the estimation algorithm is not perfect, so apparently it happens). In any case, 10 seconds is way too high a value so lower to 1 second. MFC after: 3 days
* Don't use ovbcopy().des2003-04-041-1/+1
|
* Back out M_* changes, per decision of the TRB.imp2003-02-191-2/+2
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-2/+2
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* o Untangle the confusion with the malloc flags {M_WAITOK, M_NOWAIT} andbmilekic2002-12-191-1/+1
| | | | | | | | | | the mbuf allocator flags {M_TRYWAIT, M_DONTWAIT}. o Fix a bpf_compat issue where malloc() was defined to just call bpf_alloc() and pass the 'canwait' flag(s) along. It's been changed to call bpf_alloc() but pass the corresponding M_TRYWAIT or M_DONTWAIT flag (and only one of those two). Submitted by: Hiten Pandya <hiten@unixdaemons.com> (hiten->commit_count++)
* Relax checking of incoming PPTP GRE packets a bit: ignore a bogus payloadarchie2002-09-141-1/+1
| | | | | length field when there's no payload indicated by the header 'S' bit. This works around semi-brokenness in the Mac OS X PPTP client.
* Const'ify variables to make it clear we're not writing to the mbuf data.archie2002-06-051-8/+9
| | | | | Reviewed by: julian, brian MFC after: 1 week
* Fix GCC warnings caused by initializing a zero length array. In the process,archie2002-05-311-6/+6
| | | | | | | simply things a bit by getting rid of 'struct ng_parse_struct_info' which was useless because it only contained one field. MFC after: 2 weeks
* Use 'struct callout' instead of 'struct callout_handle' to avoidarchie2002-04-141-25/+81
| | | | | | | | | | | exhausting the kernel timeout table. Perform the usual gymnastics to avoid race conditions between node shutdown and timeouts occurring. Also fix a bug in handling ack delays < PPTP_MIN_ACK_DELAY. Before, we were ack'ing immediately. Instead, just impose a minimum ack delay time, like the name of the macro implies. MFC after: 1 week
* Update to C99, s/__FUNCTION__/__func__/,obrien2001-12-101-6/+6
| | | | also don't use ANSI string concatenation.
* Don't reference a node after we dropped a reference to itarchie2001-04-111-1/+2
| | | | (same as in previous checkin, but in a different function).
* netgraph.h:julian2001-03-101-1/+2
| | | | | | | | | | | | | | | | | | | Change a prototype. Add a function version of ng_ref_node() when debugging so a breakpoint can be set on it. ng_base.c: add 'node' as an argument to ng_apply_item so that it is up to the caller to take over and release the item's reference on the node. If the release reports back that the node went away due to the reference going to 0, the caller should cease referencing the now defunct node. (e.g. the item was a 'kill node' message). Alter ng_unref_node to report back the residual references as a result. ng_pptpgre.c: Don't reference a node after we dropped a reference to it. (What if it was the last?) Fixes a node leak reported by Harti Brandt <brandt@fokus.gmd.de> which was due to an incorrect earlier attempt to fix the "accessing node after dropping the last reference" problem.
* Fix potential crash caused by packets with bogus ACK's.archie2001-03-081-1/+2
| | | | Reported by: Fabien THOMAS <fabient@netasq.com>
* Part 2 of the netgraph rewrite.julian2001-01-081-31/+30
| | | | | | This is mostly cosmetic changes, (though I caught a bug or two while makeing them) Reviewed by: archie@freebsd.org
* Rewrite of netgraph to start getting ready for SMP.julian2001-01-061-46/+55
| | | | | | | | This version is functional and is aproaching solid.. notice I said APROACHING. There are many node types I cannot test I have tested: echo hole ppp socket vjc iface tee bpf async tty The rest compile and "Look" right. More changes to follow. DEBUGGING is enabled in this code to help if people have problems.
* Divorce the kernel binary ABI version number from the messagejulian2000-12-181-2/+2
| | | | | | | | | format version number. (userland programs should not need to be recompiled when the netgraph kernel internal ABI is changed. Also fix modules that don;t handle the fact that a caller may not supply a return message pointer. (benign at the moment because the calling code checks, but that will change)
* Reviewed by: Archie@freebsd.orgjulian2000-12-121-2/+1
| | | | | | | | | | | | | This clears out my outstanding netgraph changes. There is a netgraph change of design in the offing and this is to some extent a superset of soem of the new functionality and some of the old functionality that may be removed. This code works as before, but allows some new features that I want to work with and evaluate. It is the basis for a version of netgraph with integral locking for SMP use. This is running on my test machine with no new problems :-)
* Add the use of M_ZERO to netgraph.dwmalone2000-11-181-2/+1
| | | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Submitted by: archie Approved by: archie
* Since neither archie nor I work at Whistle any more, change our emailjulian2000-10-241-1/+1
| | | | | | addresses to be the more usefu @freebsd.org ones so we can keep getting bug-reports. - man pages to follow..
* Calling untimeout(9) leads to a race window where memory could be leaked.archie2000-10-111-21/+5
| | | | Close this window by simply not calling untimeout(9).
* Remove unnecessary #include's as reported by phk's script.archie2000-09-221-3/+0
|
* Allocate all memory (including within node constructors) with M_NOWAITarchie2000-09-211-1/+1
| | | | instead of M_WAITOK, to allow for maximum flexibility.
* Followup to previous commit..archie2000-07-251-20/+40
| | | | | | | - It's worthwhile to use untimeout(9), even though we must still protect against "false" timeouts, because most of the time it saves having to handle a dummy timeout event. - Slight tweaks to the delayed ACK algorithm paramters.
* Several fixes:archie2000-07-251-25/+54
| | | | | | | | | | | - Fix slowness when operating over fast connections, where the timeout(9) granularity is on the same order of magnitude as the round trip time. timeout(9) can happen up to 1 tick early, which was causing receive ack timeouts to happen too early, causing bogus "lost" packets. - Increase the local time counter to 64 bits to avoid roll-over. - Keep statistics on memory allocation failures. - Add a new option to always include the ack when sending data packets. Might be useful in high packet loss situations. Might not.
* Fix incorrectly implemented receive ACK timeout algorithm:archie2000-06-281-14/+20
| | | | | | | | instead of bumping the recvAck counter by one, pretend that all outstanding xmit packets are acknowleged, and restart transmitting anew, with an empty (but halved) transmit window. Put a lower bound on the adaptive timeout value.
* - Start sequence numbers at zero instead of one; the rest of thearchie2000-06-261-84/+57
| | | | | | | world seems to interpret the spec this way - Initialize transmit window to two instead of one; helps get things going initially when the first packet may get dropped - Really fix the shutdown + timeout race condition this time
* Fix a couple of bugs:archie2000-05-051-41/+209
| | | | | | | - Properly handle 32 bit sequence numbers when they wrap around - Don't drop GRE packets with stale ACK numbers, just ignore the ACK - Close race between node being shutdown and timer going off Also add support for lots of statistics, and control message ASCIIfication
* Two simple changes to the kernel internal API for netgraph modules,julian2000-04-281-2/+3
| | | | | | | to support future work in flow-control and 'packet reject/replace' processing modes. reviewed by: phk, archie
* Remove ~25 unneeded #include <sys/conf.h>phk2000-04-191-1/+0
| | | | Remove ~60 unneeded #include <sys/malloc.h>
* Fix race condition caused by missing splnet()'s.archie2000-01-041-0/+4
|
* New netgraph node type 'pptpgre': this performs GRE encapsulationarchie1999-12-081-0/+759
for the PPTP protocol as specified in RFC 2637.
OpenPOWER on IntegriCloud