Commit Graph

148 Commits

Author SHA1 Message Date
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
archie
53ecfd0ecb Export ng_ether_enaddr_type for other nodes that want to use it. 2000-08-30 18:39:29 +00:00
archie
d826d6c208 Add three more control messages to complement their opposites:
NGM_ETHER_SET_ENADDR, NGM_ETHER_GET_PROMISC, and NGM_ETHER_GET_AUTOSRC.
Alter parsing algorithm so the EN address really looks like one.
2000-08-15 01:05:50 +00:00
archie
3c201be096 Oops, previous commit fixed a bug that was already fixed before.
Back it out.
2000-08-10 23:04:46 +00:00
archie
6c05154b7a Add new control message to atomically get and clear statistics. 2000-08-10 22:52:40 +00:00
archie
7ef7c5b042 Increase the maximum allowable datagram length. 2000-08-10 22:51:57 +00:00
archie
f007bb028b "u_int32_t" should have been "int32_t". 2000-08-10 22:51:26 +00:00
archie
dab4141f83 Use a bigger buffer for NGM_BINARY2ASCII conversion, to handle really
long ASCII control messages.
2000-08-10 22:50:38 +00:00
archie
4f3c325b7d - Add new control message NGM_VJC_GET_CONFIG
- Implement control message ASCII'fication for all control messages
2000-08-10 22:48:03 +00:00
archie
91912098c3 Take advantage of the new unsigned and hex integer types. 2000-08-10 22:45:54 +00:00
archie
16765ea997 - Make statistics unsigned.
- Add new control message to atomically get and clear statistics.
2000-08-10 22:44:41 +00:00
archie
2b894febdd - Add new unsigned and hex integer parse types
- Fix bug in commented example code
2000-08-10 22:43:38 +00:00
archie
126052eaab - Add new unsigned and hex integer parse types; this allows simplifying
the bytearray parse type.
- Allocate (larger) temporary work buffer dynamically instead of on the
  stack when comparing to the default value.
2000-08-10 22:42:25 +00:00
archie
36af4d0d2a RFC 1661 requires that all LCP packets are sent with no address and
control field compression. The ng_ppp(4) node correctly follows this
rule. However, PPPoE is an exception: when doing PPPoE *all* frames
are sent with address and control field compression.

Alter this node's behavior so that when an outgoing frame is received,
any leading address and control field bytes are removed. This makes
this node compatible with ng_ppp(4).
2000-08-10 20:05:12 +00:00
archie
7c1fac0cb6 In a struct sockaddr, sa->sa_len can be zero if uninitialized.
Make sure that this doesn't cause a problem when parsing.
2000-08-09 23:57:44 +00:00
archie
7dc4fea48b Fix bug where bundle-level receive statistics were not getting updated. 2000-08-09 01:43:21 +00:00
archie
abc93090fb Fix a bug where we were accessing already free'd memory during node shutdown.
Detected via:	0xdeadc0de
2000-08-07 22:41:12 +00:00
archie
ee875aa6c2 Add three new control messages to the ng_ether(4) netgraph node type:
NGM_ETHER_GET_ENADDR:	Get the device's Ethernet address
    NGM_ETHER_SET_PROMISC:	Enable/disable promiscuous mode
    NGM_ETHER_SET_AUTOSRC:	Enable/disable packet source address override
2000-08-07 18:52:26 +00:00
archie
03d498eb80 Fix misspelling. 2000-08-05 20:17:04 +00:00
archie
044c01152e 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
02b7ccf840 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
add7c59d4f Allocate memory with M_NOWAIT instead of M_WAITOK, because it's possible
for these routines to be called from an interrupt context.

PR:		kern/20057
2000-07-20 17:23:49 +00:00
archie
32c8825fe1 Remove node's name reference when the interface is detached;
otherwise, the ng_ether.ko KLD will never be unloadable after
all Ethernet interfaces are detached, as it should be, because
of the lingering extra reference.

Submitted by:	"Yevmenkin, Maksim N, CSCIO" <myevmenkin@att.com>
2000-07-19 17:33:53 +00:00
archie
c7fb04c331 Set NG_INVALID flag when destroying node. 2000-07-14 22:35:13 +00:00
asmodai
492e7a5ec0 Fix typo, teh -> the. 2000-07-14 11:17:16 +00:00
archie
e713486f3b Fix race condition caused by using NG_SEND_DATAQ() where we meant
to use ng_queue_data().

Reported by:	Udo Erdelhoff <ue@nathan.ruhr.de>
2000-07-12 23:55:07 +00:00
julian
8c0bd98e14 Don't forget to set our MAC address into packets we wre sending out via
netgraph. Eventually we may need to have a separate hook for packets
that already have a source AMC address but for now just drop it in.
Should fix PPPoE.
2000-07-06 15:35:59 +00:00