Commit Graph

22 Commits

Author SHA1 Message Date
David E. O'Brien
6e551fb628 Update to C99, s/__FUNCTION__/__func__/,
also don't use ANSI string concatenation.
2001-12-10 08:09:49 +00:00
Archie Cobbs
422c727634 Don't reference a node after we dropped a reference to it
(same as in previous checkin, but in a different function).
2001-04-11 22:04:47 +00:00
Julian Elischer
5951069a87 netgraph.h:
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.
2001-03-10 16:31:00 +00:00
Archie Cobbs
22dfb9bdb7 Fix potential crash caused by packets with bogus ACK's.
Reported by:	Fabien THOMAS <fabient@netasq.com>
2001-03-08 20:10:02 +00:00
Julian Elischer
30400f03aa Part 2 of the netgraph rewrite.
This is mostly cosmetic changes, (though I caught a bug or two while
makeing them)
Reviewed by:	archie@freebsd.org
2001-01-08 05:34:06 +00:00
Julian Elischer
069154d55f Rewrite of netgraph to start getting ready for SMP.
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.
2001-01-06 00:46:47 +00:00
Julian Elischer
589f6ed8ce Divorce the kernel binary ABI version number from the message
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)
2000-12-18 20:03:32 +00:00
Julian Elischer
859a4d166c Reviewed by: Archie@freebsd.org
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 :-)
2000-12-12 18:52:14 +00:00
David Malone
99cdf4ccb2 Add the use of M_ZERO to netgraph.
Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>
Submitted by:	archie
Approved by:	archie
2000-11-18 15:17:43 +00:00
Julian Elischer
cc3bbd68c5 Since neither archie nor I work at Whistle any more, change our email
addresses to be the more usefu @freebsd.org ones
so we can keep getting bug-reports.
- man pages to follow..
2000-10-24 17:32:45 +00:00
Archie Cobbs
034d9dac34 Calling untimeout(9) leads to a race window where memory could be leaked.
Close this window by simply not calling untimeout(9).
2000-10-11 20:29:12 +00:00
Archie Cobbs
ee79f58e34 Remove unnecessary #include's as reported by phk's script. 2000-09-22 16:51:14 +00:00
Archie Cobbs
65b9a0da90 Allocate all memory (including within node constructors) with M_NOWAIT
instead of M_WAITOK, to allow for maximum flexibility.
2000-09-21 18:01:23 +00:00
Archie Cobbs
da010626df Followup to previous commit..
- 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.
2000-07-25 18:57:20 +00:00
Archie Cobbs
678f9e335e Several fixes:
- 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.
2000-07-25 00:23:19 +00:00
Archie Cobbs
e962a82308 Fix incorrectly implemented receive ACK timeout algorithm:
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.
2000-06-28 19:43:34 +00:00
Archie Cobbs
3cd7db2297 - Start sequence numbers at zero instead of one; the rest of the
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
2000-06-26 19:43:24 +00:00
Archie Cobbs
9bee7adfa8 Fix a couple of bugs:
- 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
2000-05-05 01:11:39 +00:00
Julian Elischer
a4ec03cfa8 Two simple changes to the kernel internal API for netgraph modules,
to support future work in flow-control and 'packet reject/replace'
processing modes.

reviewed by: phk, archie
2000-04-28 17:09:00 +00:00
Poul-Henning Kamp
3389ae9350 Remove ~25 unneeded #include <sys/conf.h>
Remove ~60 unneeded #include <sys/malloc.h>
2000-04-19 14:58:28 +00:00
Archie Cobbs
4164c44770 Fix race condition caused by missing splnet()'s. 2000-01-04 22:06:08 +00:00
Archie Cobbs
add85a1d6e New netgraph node type 'pptpgre': this performs GRE encapsulation
for the PPTP protocol as specified in RFC 2637.
1999-12-08 18:55:39 +00:00