Commit Graph

451 Commits

Author SHA1 Message Date
Luigi Rizzo
65d5a8999d fix an mbuf leak when using ipfw to filger bridged packets
(from -stable, since this code is not yet active in -current)
1998-09-18 20:55:50 +00:00
Bill Fenner
c2b0c42413 Add DLT_{SLIP,PPP}_BSDOS from libpcap 0.4 1998-09-15 19:35:37 +00:00
Luigi Rizzo
cb1e41ca65 Bring in files for bridging support. 1998-09-12 22:07:47 +00:00
Garrett Wollman
cfe8b629f1 Yow! Completely change the way socket options are handled, eliminating
another specialized mbuf type in the process.  Also clean up some
of the cruft surrounding IPFW, multicast routing, RSVP, and other
ill-explored corners.
1998-08-23 03:07:17 +00:00
Andrey A. Chernov
22f05c4320 Implement DLT_RAW from libpcap 1998-08-18 10:13:11 +00:00
Bruce Evans
138d060a6e Fixed printf format errors. sppp_dotted_quad() was yet another private,
broken, version of inet_ntoa().  It should go away.
1998-08-17 00:29:34 +00:00
Bruce Evans
f9d8181868 Fixed yet more ioctl breakage due to the type of the `cmd' arg changing
from int to u_long but not changing here.
1998-08-15 21:58:09 +00:00
Bill Paul
c7323482f4 One-liner: add a call to the underlying device driver's SIOCDELMULTI
ioctl() routine at the end of if_delmulti() so that interfaces with
hardware multicast filtering can update their filters in a timely
manner.

If the interface doesn't support hardware multicast filtering, then
reception of multicast frames is done using 'promiscious mode' or
'capture all multicast frames' mode and software filtering in the
kernel. In this case, it doesn't matter if if_delmulti() ever does
an SCIODELMULTI on the interface or not: if MULTICAST support is
enabled, then we join the 'all hosts' group when the interface is
configured, and remain in it until the interface is brought down.
Without hardware filtering, joining one group means joining all
groups, so it makes no difference if we call the SIOCDELMULTI
routine.

If the interface does support hardware multicast filtering, then
by not reprogramming the hardware filter in if_delmulti(), we have
to wait until somebody calls if_setmulti(), during which time the
interface is receiving frames for multicast groups in which we are
no longer interested.
1998-08-12 22:51:59 +00:00
Julian Elischer
84dd0fd0bb fix broken loopback code for ddp (again)
Submitted by: Stefan Bethke <stb@hanse.de>
1998-08-04 23:17:05 +00:00
Kenjiro Cho
4f53e3cc7a update ATM driver. (base version: midway.c 1.67 --> 1.68)
several new features are added:
	- support vc/vp shaping
	- support pvc shadow interface

code cleanup:
	- remove WMAYBE related code.  ENI WMAYBE DMA doen't work.
	- remove updating if_lastchange for every packet.
	- BPF related code is moved to midway.c as it should be.
	  (bpfwrite should work if atm_pseudohdr and LLC/SNAP are
	  prepended.)
	- BPF link type is changed to DLT_ATM_RFC1483.
	  BPF now understands only LLC/SNAP!! (because bpf can't
	  handle variable link header length.)
	  It is recommended to use LLC/SNAP instead of NULL
	  encapsulation for various reasons.  (BPF, IPv6,
	  interoperability, etc.)

the code has been used for months in ALTQ and KAME IPv6.

OKed by phk long time ago.
1998-07-29 05:35:16 +00:00
Doug Rabson
8a261b8f7f Make sure the link level sockaddr size is rounded up correctly on alpha. 1998-07-20 13:21:56 +00:00
Bruce Evans
a23d65bfc8 Cast pointers to uintptr_t/intptr_t instead of to u_long/long,
respectively.  Most of the longs should probably have been
u_longs, but this changes is just to prevent warnings about
casts between pointers and integers of different sizes, not
to fix poorly chosen types.
1998-07-15 02:32:35 +00:00
Bruce Evans
c086febef5 Don't attempt to optimize the space allocated for bpf headers if
sizeof(struct bpf_hdr) > 20.  20 is normal on 32-bit systems with
32-bit alignment, but we still assume that the last 2 bytes of the
struct are unnecessary padding on such systems.  On systems with
64-bit longs, struct timeval is bloated to 16 bytes, so bpf headers
certainly don't fit in 18 bytes.
1998-07-13 10:44:02 +00:00
Doug Rabson
3a43ad8f22 Make sure the packet is aligned correctly for the alpha in if_simloop. 1998-07-12 16:46:52 +00:00
Bruce Evans
da2181925b Fixed printf format errors. 1998-07-11 10:51:01 +00:00
Bruce Evans
e5b19842ef Removed unused includes. 1998-06-21 14:53:44 +00:00
Peter Wemm
8bc3cd6211 Zap what appears to be a relic of the older version of zlib. The other
maintained mbuf based ppp-deflate.c's have removed this.
1998-06-20 16:55:44 +00:00
Peter Wemm
aa8859a838 Missing splx(). 1998-06-20 16:39:35 +00:00
Peter Wemm
a97a7d9e61 Merge ppp changes from 2.3.3 -> 2.3.5. I have spotted some more
problems, which I'll have a go at shortly.
1998-06-20 16:28:04 +00:00
Julian Elischer
05b3ccef36 Oops
left a "break;" out of the last patch
it complains for every loopback packet..
1998-06-14 23:53:43 +00:00
Julian Elischer
201c2527a9 Try narrow down the culprit sending undefined packet types through the loopback 1998-06-14 20:58:17 +00:00
Julian Elischer
9d3f194df3 Allow a protocol to specify that it does NOT want to be looped back
even if it looks like it should (backwards compatibility with
old broken code) should get rid of some annoying messags.
1998-06-13 02:27:10 +00:00
Julian Elischer
6b1214b0fc Remove 3 occurances of __FUNCTION__ 1998-06-12 20:03:26 +00:00
Julian Elischer
ed7509ace4 Go through the loopback code with a broom..
Remove lots'o'hacks.
looutput is now static.

Other callers who want to use loopback to allow shortcutting
should call the special entrypoint for this, if_simloop(), which is
specifically designed for this purpose. Using looutput for this purpose
was problematic, particularly with bpf and trying to keep track
of whether one should be using the charateristics of the loopback interface
or the interface (e.g. if_ethersubr.c) that was requesting the loopback.
There was a whole class of errors due to this mis-use each of which had
hacks to cover them up.

Consists largly of hack removal :-)
1998-06-12 03:48:19 +00:00
Julian Elischer
01f0fef31b Don't let ifunit() modify the string passed as an argument.
it may be in the text segment and write protected.
1998-06-08 20:33:29 +00:00
Doug Rabson
ecbb00a262 This commit fixes various 64bit portability problems required for
FreeBSD/alpha.  The most significant item is to change the command
argument to ioctl functions from int to u_long.  This change brings us
inline with various other BSD versions.  Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.

The prototype FreeBSD/alpha machdep will follow in a couple of days
time.
1998-06-07 17:13:14 +00:00
Bruce Evans
871e837825 Added a used include (in ifdefed code). 1998-06-07 12:02:59 +00:00
Bruce Evans
35b88f573a Fixed pedantic syntax errors caused by a trailing semicolon in a macro
definition.
1998-06-07 11:52:17 +00:00
David Greenman
2b5c300924 Backed out last fix and fixed my typo:
ipflow(fastforward -> ipflow_fastforward
1998-05-21 00:33:16 +00:00
Peter Dufault
6d5a01beb3 Add missing close paren 1998-05-20 14:08:43 +00:00
David Greenman
1f91d8c563 Added fast IP forwarding code by Matt Thomas <matt@3am-software.com> via
NetBSD, ported to FreeBSD by Pierre Beyssac <pb@fasterix.freenix.org> and
minorly tweaked by me.
This is a standard part of FreeBSD, but must be enabled with:
"sysctl -w net.inet.ip.fastforwarding=1" ...and of course forwarding must
also be enabled. This should probably be modified to use the zone
allocator for speed and space efficiency. The current algorithm also
appears to lose if the number of active paths exceeds IPFLOW_MAX (256),
in which case it wastes lots of time trying to figure out which cache
entry to drop.
1998-05-19 14:04:36 +00:00
Poul-Henning Kamp
c21410e119 s/nanoruntime/nanouptime/g
s/microruntime/microuptime/g

Reviewed by:	bde
1998-05-17 11:53:46 +00:00
Garrett Wollman
eb92a34766 Fix an obvious parameter-order bogon. (Don't know what happened to
the warning message before.)
1998-05-15 20:02:47 +00:00
Bruce Evans
77849078bf Oops, the previous commit should have changed i386' to __i386__',
not `__i386'.
1998-05-01 16:40:21 +00:00
Poul-Henning Kamp
ce42f1fb17 Loopback network interface driver (net/if_loop.c) has no SIOCSIFFLAGS
ioctl handler.

PR:		6466
Reviewed by:	phk
Submitted by:	Ruslan Ermilov <ru@ucb.crimea.ua>
1998-04-30 19:37:00 +00:00
Brian Somers
5417a1a44a Support more than 256 tun devices:
$ ls -l /dev/tun25[4-7]
crw-------  1 fax  dialer   52, 254 Apr 27 02:27 /dev/tun254
crw-------  1 fax  dialer   52, 255 Apr 27 02:27 /dev/tun255
crw-------  1 fax  dialer   52, 0x00010000 Apr 27 02:31 /dev/tun256
crw-------  1 fax  dialer   52, 0x00010001 Apr 27 02:31 /dev/tun257
1998-04-27 01:44:22 +00:00
Dag-Erling Smørgrav
dc73342347 Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108. 1998-04-17 22:37:19 +00:00
Bruce Evans
c1087c1324 Support compiling with `gcc -ansi'. 1998-04-15 17:47:40 +00:00
Poul-Henning Kamp
98b9590ef3 Use getmicrotime() for if_lastchange, 10msec is plenty precision. 1998-04-06 11:43:12 +00:00
Poul-Henning Kamp
33b0bb6af7 Use random() for seq numbers and read_random for CHAP challenge. 1998-04-06 11:40:17 +00:00
Poul-Henning Kamp
2eeb0e2ea0 Make read_random() take a (void *) argument instead of (char *) 1998-04-06 09:30:42 +00:00
Poul-Henning Kamp
00af9731c9 Time changes mark 2:
* Figure out UTC relative to boottime.  Four new functions provide
      time relative to boottime.

    * move "runtime" into struct proc.  This helps fix the calcru()
      problem in SMP.

    * kill mono_time.

    * add timespec{add|sub|cmp} macros to time.h.  (XXX: These may change!)

    * nanosleep, select & poll takes long sleeps one day at a time

Reviewed by:    bde
Tested by:      ache and others
1998-04-04 13:26:20 +00:00
Poul-Henning Kamp
227ee8a188 Eradicate the variable "time" from the kernel, using various measures.
"time" wasn't a atomic variable, so splfoo() protection were needed
around any access to it, unless you just wanted the seconds part.

Most uses of time.tv_sec now uses the new variable time_second instead.

gettime() changed to getmicrotime(0.

Remove a couple of unneeded splfoo() protections, the new getmicrotime()
is atomic, (until Bruce sets a breakpoint in it).

A couple of places needed random data, so use read_random() instead
of mucking about with time which isn't random.

Add a new nfs_curusec() function.

Mark a couple of bogosities involving the now disappeard time variable.

Update ffs_update() to avoid the weird "== &time" checks, by fixing the
one remaining call that passwd &time as args.

Change profiling in ncr.c to use ticks instead of time.  Resolution is
the same.

Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call
hzto() which subtracts time" sequences.

Reviewed by:	bde
1998-03-30 09:56:58 +00:00
Bruce Evans
08637435f2 Moved some #includes from <sys/param.h> nearer to where they are actually
used.
1998-03-28 10:33:27 +00:00
Peter Wemm
8209dfe2f4 Quieten a debug message.. This happens under "normal" operation by 4 bytes
on a frequent enough rate to be annoying.  There is a real bug somewhere,
but it looks harmless enough.
1998-03-25 14:28:28 +00:00
Bruce Evans
bd7ac1b26b Added a forward struct declaration so that this file is less
self-insufficient.
1998-03-23 13:58:02 +00:00
Peter Wemm
880dcadfce ppp-2.3.x ships with a bad compression number for deflate. It uses number
24 (which is magnalink!) rather than the correct 26.

Initial attempt at a compatability kludge that will negotiate for either
but will prefer to use the correct deflate compression type.
1998-03-22 06:51:57 +00:00
Peter Wemm
52403fe6de Update kernel parts of ppp to ppp-2.3.3. Not much has changed except
that the deflate components use zlib 1.0.4 instead of zlib 0.95.
1998-03-21 20:56:16 +00:00
Peter Wemm
09410d0f8b On most other systems "out there", <net/if.h> does not require the caller
to #include <sys/time.h> first.  I've lost count of the number of times
I've had to patch this in porting code.  The problem is the
"struct timeval ifi_lastchange" in the mib stats.  (most other systems don't
have this, until 4.4bsd anyway).
1998-03-21 13:36:20 +00:00
Garrett Wollman
2cc2df490e Add preliminary support for IEEE 802.1Q VLAN tagging. It doesn't actually
work reliably yet (I've had panics), but it does seem to occasionally
be able to transmit and receive syntactically-correct packets.
Also fixes one of if_ethersubr.c's legion style bugs, and removes
the hostcache code from standard kernels---the code that depends on it
is not going to happen any time soon, I'm afraid.
1998-03-18 01:40:12 +00:00