Commit Graph

174 Commits

Author SHA1 Message Date
julian
a91cde79fe Add MTX_SPIN to an mtx_init( 2001-01-22 17:51:48 +00:00
julian
506e7f0e18 remove stupid braino (recursive mutex)
tripped over by: PHK
2001-01-21 23:32:00 +00:00
julian
95d27233f3 Add a generic "queued function callin" mechanism
Use it to implement (hopefully) SMP safe node/hook addition
and removal.
Fix some debug stuff.
2001-01-14 23:25:54 +00:00
julian
8e135edc9d remove debug sysctl
slight tweek to hook removal. (or is that tweak?)
2001-01-11 23:05:34 +00:00
julian
eb53c55f36 Make hook deletion SMP safe. 2001-01-11 22:22:52 +00:00
julian
420cd96845 Add an exported function ng_rmhook_self() that removes a hook
from a node, but does it via the locking queue, thus ensuring that the
node is locked when it's hook is removed.

Add 'deadnode' and 'deadhook' structures for when a node or hook is
invalidated but not yet freed. (not yet freed)
2001-01-11 19:27:54 +00:00
julian
c24ab624c0 Another brian fix, luckily not in live code. 2001-01-11 15:44:41 +00:00
julian
077abe8f38 Fix uninitialised pointer.
Found by: Brian Sommers
2001-01-11 15:42:22 +00:00
archie
9d27a6e8b5 Unbreak compilation. 2001-01-11 04:13:46 +00:00
julian
0012f9ab76 Only free items that are not already free or passed to other nodes.
Clever work by: Brian Sommers (Brian@freeBSD.org)
2001-01-10 23:49:03 +00:00
julian
d3ebfde307 Changes to stop zombie nodes showing up in active node lists.
Also some changes resulting from debug work done earlier.
2001-01-10 23:19:32 +00:00
julian
bb6dbcf3b2 Fix some memory leaks
Add memory leak detection assitance.
2001-01-10 07:13:58 +00:00
julian
eea659140e Missing FREE(). 2001-01-09 00:49:31 +00:00
julian
a34250a5a0 Bad julian.. forgot to destroy mutex before freeing the
structure it was part of!
2001-01-08 06:28:30 +00:00
julian
ff86256bf7 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
f0c46a9d00 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
0c949560a1 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
archie
00bc527735 Use "node->ID" for the node's ID, instead of "(long)node".
Reported by:	julian
2000-12-18 17:18:35 +00:00
julian
2615d1c940 Impossible to see typo.. |= instead of != 2000-12-18 13:41:46 +00:00
archie
36e782e2e6 Fix bug in parse type for struct ng_one2many_config.
Reported by:	Yian Zhu <Yian.Zhu@qobra.com>
2000-12-12 23:12:22 +00:00
julian
b42849698a I have no idea at all why this file was not included in the last commit. 2000-12-12 22:35:36 +00:00
julian
126b557e53 oops that commit included a local hack... take it out.. 2000-12-12 18:59:09 +00:00
julian
2d1192e612 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
archie
db0edd3c39 Fix a bug where if the interface was in promiscuous mode when the
last hook was disconnected, the interface would not get reset to
non-promiscuous mode.

Reported by:	jdp
2000-12-11 03:36:26 +00:00
julian
0bade0c230 Add splhigh()s to protect against a race condition
that shows up when running with ethernet bridging
at high speed.

Submitted by: Chris Csanady <ccsanady@iastate.edu>
(and extended by me)
2000-12-02 13:27:58 +00:00
jlemon
17aeda1452 Fix another callout_init() that I missed. 2000-11-26 21:59:30 +00:00
dwmalone
918549eb31 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
brian
5d83d171df Go back to using data_len in struct ngpppoe_init_data after discussions
with Julian and Archie.

Implement a new ``sizedstring'' parse type for dealing with field pairs
consisting of a uint16_t followed by a data field of that size, and use
this to deal with the data_len and data fields.

Written by:		Archie with some input by me
Agreed in principle by:	julian
2000-11-16 23:14:53 +00:00
archie
84d919eea0 New netgraph node type ng_one2many(4). 2000-11-16 05:58:33 +00:00
mckusick
3303fdc1ee In preparation for deprecating CIRCLEQ macros in favor of TAILQ
macros which provide the same functionality and are a bit more
efficient, convert use of CIRCLEQ's in netgraph PPP code to TAILQ's.

Reviewed by:	Archie Cobbs <archie@dellroad.org>
2000-11-15 19:40:34 +00:00
julian
27f10d8332 Swap the order of two tags in the pppoe PADI and PADS packets
as there are apparently some buggy switches that need them in that order.
(I hope there aren't any that require them in the old order!)
2000-10-31 14:40:23 +00:00
brian
87f7d0a784 Change the format of ngpppoe_init_data so that the provider is NUL
terminated and the data_len field is no longer necessary.

Add ASCII2BINARY and BINARY2ASCII capabilities.

The old format is still understood and dealt with, but can't do
the ASCII2BINARY and BINARY2ASCII stuff.

Approved by: archie
2000-10-31 02:45:24 +00:00
phk
ff5cdfae2d Move suser() and suser_xxx() prototypes and a related #define from
<sys/proc.h> to <sys/systm.h>.

Correctly document the #includes needed in the manpage.

Add one now needed #include of <sys/systm.h>.
Remove the consequent 48 unused #includes of <sys/proc.h>.
2000-10-29 16:06:56 +00:00
julian
bf2394b8d4 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
phk
beadbd4365 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
archie
2eb0a98177 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
b8962bd43f Fix memory leak.
Submitted by:	Christopher N. Harrell <cnh@ivmg.net>
2000-10-11 19:04:34 +00:00
archie
f5ae415528 Fix typo in NETGRAPH_INIT() macro. 2000-10-09 18:37:11 +00:00
archie
a5984fa40e More complete fix for multi-link sequence number handling bugs.
Add a new control message for querying the sequence number state.
2000-10-06 23:42:02 +00:00
archie
79dad751f1 Fix bug in handling of multi-link sequence numbers.
Reported by:	Becca Anderson <becca@worldint.com>
2000-10-06 20:36:17 +00:00
archie
7280bb2b3d Use m_dup() instead of m_copypacket() for the time being. Not all
of the code in the kernel properly checks for read-onlyness before
writing into an mbuf data area. When that code is fixed, the m_dup()
can go back to being m_copypacket().

Requested by:	nsayer
2000-09-23 23:22:27 +00:00
archie
63c14c2c25 Remove unnecessary #include's as reported by phk's script. 2000-09-22 16:51:14 +00:00
archie
1023c32e1a 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
2ecfa84ffe Allocate memory with M_NOWAIT instead of M_WAITOK because we could
be called in an interrupt context.
2000-09-21 17:33:33 +00:00
julian
0a22d74ab0 When sending a packet back to a network interface to simulate an arrived
packet, make sure that the packet has the interface marked in the first mbuf,
the same a truely arrived packets would have.
2000-09-19 08:35:44 +00:00
archie
cfb71271f0 Rename "struct session" to "struct sess_con" to avoid conflict with
upcoming "struct session" in proc.h.

Requested by:	jasone
2000-09-19 03:22:06 +00:00
jasone
769e0f974d Major update to the way synchronization is done in the kernel. Highlights
include:

* Mutual exclusion is used instead of spl*().  See mutex(9).  (Note: The
  alpha port is still in transition and currently uses both.)

* Per-CPU idle processes.

* Interrupts are run in their own separate kernel threads and can be
  preempted (i386 only).

Partially contributed by:	BSDi (BSD/OS)
Submissions by (at least):	cp, dfr, dillon, grog, jake, jhb, sheldonh
2000-09-07 01:33:02 +00:00
archie
a7dc49b632 New netgraph node type for Ethernet bridging.
No ipfw support yet.
2000-09-01 01:37:13 +00:00
archie
495b9ed9e0 Fix wrong offset bug in ng_enaddr_unparse(). 2000-09-01 00:28:03 +00:00
archie
bfbd66dc36 Avoid free'ing a NULL pointer. 2000-08-31 23:08:52 +00:00