Commit Graph

943 Commits

Author SHA1 Message Date
Brian Somers
e20e9426e1 It's no longer necessary to ensure that ``gate'' is set when RTF_GATEWAY
is passed, as subsequent code does that check now anyway.

Submitted by:	ru
2001-12-19 16:05:27 +00:00
Brian Somers
02a5d63eff Only call rt_getifa() if we've either been passed a gateway or
if we've been given an RTA_IFP or changed RTA_IFA sockaddr.

This fixes the following bug:
  >/dev/tun100
  >/dev/tun101
  ifconfig tun100 1.2.3.4 5.6.7.8
  ifconfig tun101 1.2.3.4 6.7.8.9
  route change 6.7.8.9 -ifa 1.2.3.4 -iface -mtu 500
which erroneously changed tun101's host route to have an ifp of tun100
(rt_getifa() sets the ifp after calling ifa_ifwithnet(1.2.3.4))

This incarnation submitted by:	ru
2001-12-19 16:03:27 +00:00
Brooks Davis
29410449c1 Initalize ifq_maxlen to prevent a harmless warning message.
MFC After:	1 day
Pointed out by:	jacks@sage-american.com, bmah
2001-12-17 07:49:34 +00:00
John Polstra
81bda851db Make bpf's read timeout feature work more correctly with
select/poll, and therefore with pthreads.  I doubt there is any way
to make this 100% semantically identical to the way it behaves in
unthreaded programs with blocking reads, but the solution here
should do the right thing for all reasonable usage patterns.

The basic idea is to schedule a callout for the read timeout when a
select/poll is done.  When the callout fires, it ends the select if
it is still in progress, or marks the state as "timed out" if the
select has already ended for some other reason.  Additional logic in
bpfread then does the right thing in the case where the timeout has
fired.

Note, I co-opted the bd_state member of the bpf_d structure.  It has
been present in the structure since the initial import of 4.4-lite,
but as far as I can tell it has never been used.

PR:		kern/22063 and bin/31649
MFC after:	3 days
2001-12-14 22:17:54 +00:00
Jonathan Lemon
effa274e9e whitespace fixes. 2001-12-14 19:32:47 +00:00
Jonathan Lemon
64b15424e4 minor style fix. 2001-12-14 19:28:06 +00:00
Luigi Rizzo
e4fc250c15 Device Polling code for -current.
Non-SMP, i386-only, no polling in the idle loop at the moment.

To use this code you must compile a kernel with

        options DEVICE_POLLING

and at runtime enable polling with

        sysctl kern.polling.enable=1

The percentage of CPU reserved to userland can be set with

        sysctl kern.polling.user_frac=NN (default is 50)

while the remainder is used by polling device drivers and netisr's.
These are the only two variables that you should need to touch. There
are a few more parameters in kern.polling but the default values
are adequate for all purposes. See the code in kern_poll.c for
more details on them.

Polling in the idle loop will be implemented shortly by introducing
a kernel thread which does the job. Until then, the amount of CPU
dedicated to polling will never exceed (100-user_frac).
The equivalent (actually, better) code for -stable is at

	http://info.iet.unipi.it/~luigi/polling/

and also supports polling in the idle loop.

NOTE to Alpha developers:
There is really nothing in this code that is i386-specific.
If you move the 2 lines supporting the new option from
sys/conf/{files,options}.i386 to sys/conf/{files,options} I am
pretty sure that this should work on the Alpha as well, just that
I do not have a suitable test box to try it. If someone feels like
trying it, I would appreciate it.

NOTE to other developers:
sure some things could be done better, and as always I am open to
constructive criticism, which a few of you have already given and
I greatly appreciated.
However, before proposing radical architectural changes, please
take some time to possibly try out this code, or at the very least
read the comments in kern_poll.c, especially re. the reason why I
am using a soft netisr and cannot (I believe) replace it with a
simple timeout.

Quick description of files touched by this commit:

sys/conf/files.i386
        new file kern/kern_poll.c
sys/conf/options.i386
        new option
sys/i386/i386/trap.c
        poll in trap (disabled by default)
sys/kern/kern_clock.c
        initialization and hardclock hooks.
sys/kern/kern_intr.c
        minor swi_net changes
sys/kern/kern_poll.c
        the bulk of the code.
sys/net/if.h
        new flag
sys/net/if_var.h
        declaration for functions used in device drivers.
sys/net/netisr.h
        NETISR_POLL
sys/dev/fxp/if_fxp.c
sys/dev/fxp/if_fxpvar.h
sys/pci/if_dc.c
sys/pci/if_dcreg.h
sys/pci/if_sis.c
sys/pci/if_sisreg.h
        device driver modifications
2001-12-14 17:56:12 +00:00
David Greenman
05463bb58d Moved the updating of if_ibytes from ether_demux() to ether_input() to fix
a bug where the interface input bytes count wasn't updated when bridging
is enabled.

MFC after:	3 days
2001-12-14 04:41:07 +00:00
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
Andrew R. Reiter
1ed4b9feff - malloc should be passed M_WAITOK, not M_WAIT (a mbuf flag)
- make use of M_ZERO to remove a call to bzero()
2001-12-07 01:32:40 +00:00
Brooks Davis
437e48e931 Don't pass an interface pointer to VLAN_INPUT{,_TAG}. Get it from the
mbuf instead.

Suggested by:	fenner
2001-12-03 17:28:27 +00:00
Brian Somers
6f99b44c60 Fix a typo in a comment 2001-11-28 16:15:52 +00:00
Luigi Rizzo
31083dbb03 Whitespace change - replace leading spaces with tabs. 2001-11-24 01:47:50 +00:00
Luigi Rizzo
985fbf6b7b Expand the comment on the layout of softc, arpcom and ifnet structures,
and list the places where the assumption is used.
2001-11-22 23:59:56 +00:00
Jonathan Lemon
be2ac88c59 Introduce a syncache, which enables FreeBSD to withstand a SYN flood
DoS in an improved fashion over the existing code.

Reviewed by: silby  (in a previous iteration)
Sponsored by: DARPA, NAI Labs
2001-11-22 04:50:44 +00:00
Andrew R. Reiter
31689d25c8 - Utilize the great M_ZERO flag rather than allocating memory then do
a call to memset.
2001-11-21 20:29:08 +00:00
Andrew R. Reiter
0f6db47fb3 - M_ZERO already sets bif_dlist to zero; there is no need to
do it again.
2001-11-18 03:41:20 +00:00
Matthew Dillon
b1e4abd246 Give struct socket structures a ref counting interface similar to
vnodes.  This will hopefully serve as a base from which we can
expand the MP code.  We currently do not attempt to obtain any
mutex or SX locks, but the door is open to add them when we nail
down exactly how that part of it is going to work.
2001-11-17 03:07:11 +00:00
John Baldwin
99efe4f0f8 Remove ifnet.if_mpsafe for now. If this is needed, it won't be needed
until much later when the network stack locking is farther along.

Approved by:	jlemon
2001-11-14 18:36:37 +00:00
Poul-Henning Kamp
d3c64689d8 3.5 years ago Wollman wrote:
"[...] 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."
Time to clean up.
2001-11-05 21:25:02 +00:00
Luigi Rizzo
7b109fa404 MFS: sync the ipfw/dummynet/bridge code with the one recently merged
into stable (mostly , but not only, formatting and comments changes).
2001-11-04 22:56:25 +00:00
Luigi Rizzo
99e630c5c8 Remove an extra splimp() call.
Spotted-by: diff(1)
2001-11-01 08:30:38 +00:00
Matthew Dillon
1fc36ee6d4 sc_lasttime and sc_starttime are time_t's, not long's. 2001-10-27 20:31:24 +00:00
Ruslan Ermilov
f1eafd6db8 Remove extra memory region kept by "struct pfil_head pfil_head_t;".
Seems to be a typo for typedef, but we don't want this non-style(9)
typedef anyway.

PR:		kern/31356
2001-10-22 08:46:23 +00:00
Matt Jacob
e58c2b8381 Fix this so it compiles cleanly for alpha. Tried to do some minimal testing.
Reviewed by:	freebsd-net
2001-10-19 18:29:57 +00:00
Jonathan Lemon
de5934508a Add a SIOCGIFINDEX ioctl, which returns the index of a named interface.
This will be used to more efficiently support if_nametoindex(3).
2001-10-17 19:40:44 +00:00
Jonathan Lemon
10930aad3f Cleanup ifunit(), so it uses the dev_named() function to map an interface
name into a device.
2001-10-17 18:58:14 +00:00
Ruslan Ermilov
8071913df2 Pull post-4.4BSD change to sys/net/route.c from BSD/OS 4.2.
Have sys/net/route.c:rtrequest1(), which takes ``rt_addrinfo *''
as the argument.  Pass rt_addrinfo all the way down to rtrequest1
and ifa->ifa_rtrequest.  3rd argument of ifa->ifa_rtrequest is now
``rt_addrinfo *'' instead of ``sockaddr *'' (almost noone is
using it anyways).

Benefit: the following command now works.  Previously we needed
two route(8) invocations, "add" then "change".
# route add -inet6 default ::1 -ifp gif0

Remove unsafe typecast in rtrequest(), from ``rtentry *'' to
``sockaddr *''.  It was introduced by 4.3BSD-Reno and never
corrected.

Obtained from:	BSD/OS, NetBSD
MFC after:	1 month
PR:		kern/28360
2001-10-17 18:07:05 +00:00
Ruslan Ermilov
28070a0efe Bring in latest CSRG revisions to this file:
- Report destination address of a P2P link when servicing
  routing socket messages.

- Report interface name, address, and destination address
  of a P2P link when servicing NET_RT_{DUMP,FLAGS} sysctls.

Part of CSRG revision 8.6 coresponds to revision 1.12.
CSRG revision 8.7 corresponds to revision 1.15.
2001-10-17 11:23:59 +00:00
Ruslan Ermilov
4862bf8c0d 64-bit fixes from CSRG. 2001-10-17 11:10:55 +00:00
Ruslan Ermilov
fe6db7c77e Revision 1.32 corresponded to CSRG revision 8.2. 2001-10-17 10:44:39 +00:00
Ruslan Ermilov
66afbd6890 Revision 1.13 corresponded to CSRG revision 8.4.
Revision 1.59 corresponded to CSRG revision 8.5.
2001-10-17 10:41:00 +00:00
Ruslan Ermilov
4f252c4dd5 Record the fact that revision 1.39 corresponded to CSRG revision 8.4,
and first hunk of revision 1.76 corresponded to CSRG revision 8.3.
2001-10-17 10:18:42 +00:00
Bill Fenner
05153c617d if_index is the highest interface index in the system, not the next
available index.
2001-10-17 04:23:14 +00:00
Bill Fenner
b9d45cebf4 The interface index space may be sparsely populated (e.g. when an
interface in the middle is if_detach()'d).  Return (and handle)
 ENOENT when the ifmib(4) is accessed for a nonexistent interface.

MFC after: 14 days
2001-10-17 04:12:29 +00:00
Bill Fenner
211f625a91 Set the interface speed back to zero, after ether_ifattach() set it
to 10Mbps.  RFC 2863 says: "For a sub-layer which has no concept
of bandwidth, [ifSpeed] should be zero."
2001-10-15 19:21:01 +00:00
Ruslan Ermilov
6695313820 Don't even attempt to clone host routes.
MFC after:	1 week
2001-10-15 09:46:48 +00:00
Max Khon
322dcb8d3d bring in ARP support for variable length link level addresses
Reviewed by:	jdp
Approved by:	jdp
Obtained from:	NetBSD
MFC after:	6 weeks
2001-10-14 20:17:53 +00:00
Matt Jacob
b03c6ed6e5 Traverse the list of network interfaces rather than use if_index- if_index is
not guaranteed to be dense with respect to the actual list of interfaces.
2001-10-12 18:04:44 +00:00
Jonathan Lemon
d2b4566aa6 Fix the ``WARNING: Driver mistake: repeat make_dev'', caused by using
the wrong index variable within a loop.  I have no idea how this managed
to work on my test box.

Spotted by: fenner
2001-10-11 18:39:05 +00:00
Jonathan Lemon
ffb5a10458 Move device nodes into a /dev/net/ directory, to avoid conflict with
existing devices (e.g.: tunX).  This may need a little more thought.

Create a /dev/netX alias for devices.  net0 is reserved.

Allow wiring of net aliases in /boot/device.hints of the form:
	hint.net.1.dev="lo0"
	hint.net.12.ether="00:a0:c9:c9:9d:63"
2001-10-11 05:54:39 +00:00
Jonathan Lemon
cfeff1b693 Set if_type and if_addrlen before calling if_attach(), so the values are
available for the routine to use.
2001-10-11 05:37:59 +00:00
John Baldwin
6a40eccec3 Malloc mutexes pre-zero'd as random garbage (including 0xdeadcode) my
trigget the check to make sure we don't initalize a mutex twice.
2001-10-10 20:43:50 +00:00
Bill Fenner
242c766b79 - Fix typo in "didn't find tag in list" code -- != should have been ==.
This fixes the panic when receiving a packet with an unknown tag, and
  also allows reception of packets with known tags.
- Allow overlapping tag number spaces when using multiple hardware-assisted
  VLAN parent devices (by comparing the parent interface in
  vlan_input_tag() just as in vlan_input() ).
- fix typo in comment

MFC after:	1 week
2001-10-06 05:02:11 +00:00
Doug Rabson
23620bde07 Add ia64 to the list of machines which don't do unaligned reads. 2001-10-05 19:04:23 +00:00
Paul Saab
db69a05dce Make it so dummynet and bridge can be loaded as modules.
Submitted by:	billf
2001-10-05 05:45:27 +00:00
Matt Jacob
8ec410b54a Documentation comment: note that the each NIC's softc is assumed to start
with an ifnet structure.

MFC after:	1 week
2001-10-02 18:08:34 +00:00
Jonathan Lemon
25871c13b8 Update the hash table when sppp mucks directly with the interface address. 2001-10-01 18:14:49 +00:00
Jonathan Lemon
9a2a57a1de Add ability to attach knotes to network devices.
Introduce EVFILT_NETDEV to report network device changes.
2001-09-29 18:32:35 +00:00
Jonathan Lemon
f13ad20660 Introduce network device nodes. Network devices will now automatically
appear in /dev.  Interface hardware ioctls (not protocol or routing) can
be performed on the descriptor.  The SIOCGIFCONF ioctl may be performed
on the special /dev/network node.
2001-09-29 05:55:04 +00:00
Jonathan Lemon
a35b06c555 Change sysctl_iflist() so it has a single point of return. This will
assist any future locking efforts.
2001-09-29 05:08:04 +00:00
Jonathan Lemon
cf912c8943 Use in_ifaddrhashtbl instead of in_ifaddrhead to look up IP address. 2001-09-29 05:02:36 +00:00
Luigi Rizzo
830cc17841 Two main changes here:
+ implement "limit" rules, which permit to limit the number of sessions
   between certain host pairs (according to masks). These are a special
   type of stateful rules, which might be of interest in some cases.
   See the ipfw manpage for details.

 + merge the list pointers and ipfw rule descriptors in the kernel, so
   the code is smaller, faster and more readable. This patch basically
   consists in replacing "foo->rule->bar" with "rule->bar" all over
   the place.
   I have been willing to do this for ages!

MFC after: 1 week
2001-09-27 23:44:27 +00:00
Brooks Davis
94408d94c3 /home/brooks/ng_gif.message 2001-09-26 23:50:17 +00:00
Brooks Davis
20af0ffaa1 Use LIST_ macros instead of TAILQ_ macros to be more like NetBSD.
Obtained from:	NetBSD
2001-09-26 23:37:15 +00:00
Brooks Davis
9494d5968f Make faith loadable, unloadable, and clonable. 2001-09-25 18:40:52 +00:00
John Baldwin
ed01445d8f Use the passed in thread to selrecord() instead of curthread. 2001-09-21 22:46:54 +00:00
Ruslan Ermilov
dadb6c3bb0 Use the current process's credentials rather than socket's cached.
If the process drops its super-user privileges, we certainly don't
want to allow it to modify routing tables.

Discussed with:	rwatson
2001-09-20 08:25:25 +00:00
Brooks Davis
abb6470625 Make stf a clonable device.
Yes this really is rather silly and the implementation is overkill given
that you are only allowed one of them, but NetBSD implements cloning on
this device and it's a less cluttered example of cloning then most.
2001-09-19 00:13:00 +00:00
Jonathan Lemon
f7d866924c Split HWCSUM into two components: RX and TX, for the benefit of drivers
which can only do checksum offloading in one direction.
2001-09-18 20:13:03 +00:00
Jonathan Lemon
016da741b2 Add two fields to the ifnet structure indicating what extra capabilities
a network device has, and which ones are enabled.
2001-09-18 17:41:42 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Kris Kennaway
bf61e26696 Fix some signed/unsigned integer confusion, and add bounds checking of
arguments to some functions.

Obtained from:	NetBSD
Reviewed by:	peter
MFC after:	2 weeks
2001-09-10 11:28:07 +00:00
Peter Wemm
8cdfefbd0c Remove/comment tokens after #endif (#endif NETATALK) 2001-09-10 01:33:03 +00:00
Julian Elischer
ff265614c1 Patches from KAME to remove usage of Varargs in existing
IPV4 code. For now they will still have some in the developing stuff (IPv6)

Submitted by:	Keiichi SHIMA / <keiichi@iij.ad.jp>
Obtained from:	KAME
2001-09-07 07:19:12 +00:00
Jonathan Lemon
a8637146f1 Fix another shortcircuit return() statement that I missed. 2001-09-07 05:39:47 +00:00
Jonathan Lemon
2defe5cdd7 Fix sense of comparison in space test. Also eliminate a compile
warning and remove a previously existing off-by-one error.
2001-09-07 05:32:54 +00:00
Jonathan Lemon
f9132cebdc Wrap array accesses in macros, which also happen to be lvalues:
ifnet_addrs[i - 1]  -> ifaddr_byindex(i)
        ifindex2ifnet[i]    -> ifnet_byindex(i)

This is intended to ease the conversion to SMPng.
2001-09-06 02:40:43 +00:00
Jonathan Lemon
0b59d917d8 Cosmetic cleanups and rearrangement for code to come. There should be
no functional change in this commit.
2001-09-06 00:44:45 +00:00
Brooks Davis
9d4fe4b2b0 Make vlan(4) loadable, unloadable, and clonable. As a side effect,
interfaces must now always enable VLAN support.

Reviewed by:	jlemon
MFC after:	3 weeks
2001-09-05 21:10:28 +00:00
Brooks Davis
dc9b30fcc2 Add cloning support for the tap(4) device similar to that in the tun(4)
device.

Submitted by:   Maksim Yevmenkin <myevmenk@digisle.net>
2001-09-05 01:06:21 +00:00
Julian Elischer
f0ffb944d2 Patches from Keiichi SHIMA <keiichi@iij.ad.jp>
to make ip use the standard protosw structure again.

Obtained from: Well, KAME I guess.
2001-09-03 20:03:55 +00:00
Ruslan Ermilov
162c0b2eff Synch with NetBSD and OpenBSD.
Allow non-superuser to open, listen to, and send safe commands on the
routing socket.  Superuser priviledge is required for all commands
but RTM_GET.

Lose `setuid root' bit of route(8).

Reviewed by:	wollman, dd
2001-08-31 12:31:09 +00:00
Brian Somers
86b2fc4de5 TUNSIFINFO now expects IFF_MULTICAST to be OR'd with either IFF_POINTOPOINT
or IFF_BROADCAST.  If it's not, the IFF_MULTICAST is removed.

This is in line with how NetBSD & OpenBSD do it.
2001-08-25 09:12:57 +00:00
Dima Dorfman
98ec4706ee Correct the comment about bpfattach() to match reality.
PR:		29967
Submitted by:	Joseph Mallett <jmallett@xMach.org>
2001-08-23 22:38:08 +00:00
Julian Elischer
6221ffb389 Fix typo
Submitted by:	 BDE
MFC after:	2 weeks
2001-08-16 17:17:54 +00:00
Julian Elischer
50624012be Only allocate teh 1540 byte buffer if we need it..
(lazy allocation)

MFC after:	13 days
2001-08-16 17:16:31 +00:00
Julian Elischer
51b5ed79de Don't allocate an entire 1500 byte buffer on the stack.
May need more review in light of SMP.

MFC after:	2 weeks
2001-08-15 23:59:00 +00:00
Hajimu UMEMOTO
232bdaf61f printed current sequence number of the SA. accordingly, changed
into sadb_x_sa2_sequence from sadb_x_sa2_reserved3 in the sadb_x_sa2
structure.  Also the output of setkey is changed.  sequence number
of the sadb is replaced to the end of the output.

Obtained from:	KAME
2001-08-06 19:40:01 +00:00
Bill Fenner
02e3112ae7 Don't terminate the uiomove() loop on a zero-length mbuf. It's not
particularly nice that IPSEC inserts a zero-length mbuf into the
 chain, and that bug should be fixed too, but interfaces should be
 robust to bad input.
Print the interface name when TUNDEBUG()ing about dropping an mbuf.
2001-08-03 16:51:53 +00:00
Jonathan Chen
7ba271ae0b fix memory leak when error during opening of routing socket
PR:		kern/29336
Submitted by:	Richard Andrades <richard@xebeo.com>
MFC after:	1 month
2001-08-02 19:56:29 +00:00
Bill Fenner
46da4bc6fc Update our bpf.h with tcpdump.org's new DLT_ types.
Use our bpf.h instead of tcpdump.org's to build libpcap.
2001-07-31 23:27:06 +00:00
Hajimu UMEMOTO
79e15ef30c If LCP proto-rej is received, drop the protocol mentioned by the message.
This is to be friendly with non-IPv6 peer (If the peer complains due to
lack of IPv6CP, drop IPv6CP).  This basically implements "RXJ+" state
transition in the RFC.

Obtained from:	NetBSD
2001-07-31 07:27:01 +00:00
Jun-ichiro itojun Hagino
b954a75e3c incorrect bounds-check on snprintf.
Submitted by:	fenner
2001-07-26 19:14:52 +00:00
Bill Fenner
c3cb7e5d7a Don't bother passing p to rtioctl just so it can fail to pass it to mrt_ioctl 2001-07-25 20:15:28 +00:00
Hajimu UMEMOTO
9a70151652 As commented in defined in sys/net/route.c, rt_fixchange() has a bad
effect, which would cause unnecessary route deletion:

 * Unfortunately, this has the obnoxious
 * property of also triggering for insertion /above/ a pre-existing network
 * route and clones.  Sigh.  This may be fixed some day.

The effect has been even worse, because recent versions of route.c set
the parent rtentry for cloned routes from an interface-direct route.
For example, suppose that we have an interface "ne0" that has an IPv4
subnet "10.0.0.0/24".  Then we may have a cloned route like 10.0.0.1
on the interface, whose parent route is 10.0.0.0/24 (to the interface
ne0).  Now, when we add the default route (i.e. 0.0.0.0/0),
rt_fixchange() will remove the cloned route 10.0.0.1.  The (bad) effect
also prevents rt_setgate from configuring rt_gwroute, which would not
be an intended behavior.

As suggested in the comments to rt_fixchange(), we need stricter check
in the function, to prevent unintentional route deletion.

This fix also solve the "IPV6 panic?" problem in nd6_timer().

Submitted by:	JINMEI Tatuya <jinmei@isl.rdc.toshiba.co.jp>
MFC after:	4 days
2001-07-25 19:31:43 +00:00
Bill Fenner
1b2a4f7a3c Eliminate the panic, reported by Daniel Sobral, which occurs when
vlan_unconfig()-ing an interface on which multicast groups have been
joined.  Instead, keep the list of groups around (and, in fact, allow
changing of the membership list) and re-join them when the vlan interface
is reassociated with a lower level interface.
2001-07-24 17:14:37 +00:00
Bill Fenner
d2a75853a2 Use the IANA assignment IFT_L2VLAN directly instead of indirecting through
a privately #defined IFT_8021_VLAN.

MFC after:	3 days
2001-07-24 00:03:51 +00:00
Hajimu UMEMOTO
4d303ab842 unbreak building kernel without option INET6
Reported by:	markp
2001-07-05 14:42:54 +00:00
Hajimu UMEMOTO
033110569e adjust mbuf length right in route_output().
Obtained from:	KAME
MFC after:	1 week
2001-07-04 11:29:55 +00:00
Brooks Davis
53dab5fe7b gif(4) and stf(4) modernization:
- Remove gif dependencies from stf.
 - Make gif and stf into modules
 - Make gif cloneable.

PR:		kern/27983
Reviewed by:	ru, ume
Obtained from:	NetBSD
MFC after:	1 week
2001-07-02 21:02:09 +00:00
Brooks Davis
30aad87d72 Add kernel infrastructure for network device cloning.
Reviewed by:	ru, ume
Obtained from:	NetBSD
MFC after:	1 week
2001-07-02 20:49:25 +00:00
Hajimu UMEMOTO
8acb22906f inject outbound packet to BPF.
Submitted by:	itojun
Obtained from:	KAME
MFC after:	10 days
2001-06-24 14:52:55 +00:00
Brian Somers
a48de39daf Close a race where we were releasing the unit resource at the start
of tunclose() rather than the end, and tunopen() grabbed that unit
before tunclose() finished (one process is allocating it while another
is freeing it!).

It may be worth hanging some sort of rw mutex around all specinfo
calls where d_close and the detach handler get a write lock and all
other functions get a read lock.  This would guarantee certain levels
of ``atomicity'' (is that a word?) that people may expect (I believe
Solaris does something like this).
2001-06-20 10:06:28 +00:00
Munechika SUMIKAWA
64fbad5899 Suppress update ifnet.iflastchange when processing packets for SNMP
requirements(RFC1573, interface MIB). This change for 4.4BSD was
first introduced in if_ethersubr.c:1.17->1.18.

BTW, iflastchange on all of IFs are inconsistent. e.g.
     ether, tun: update
     fddi, tokenring, ppp: not update
I'll make patch later.

Obtained from:	KAME
MFC after:	2 weeks
2001-06-19 15:53:51 +00:00
Brian Somers
2deed49982 Remove the SI_CHEAPCLONE flag when hanging resources off the dev_t 2001-06-18 09:21:59 +00:00
Mark Murray
eb6bd5940f This file was a horrible mixture of styles old and new.
Apply style(9).
2001-06-16 10:47:34 +00:00
Jonathan Lemon
08aadfbb98 Do not perform arp send/resolve on an interface marked NOARP.
PR: 25006
MFC after: 2 weeks
2001-06-15 21:00:32 +00:00
Peter Wemm
65f1bb65fe Fix warning. s/char/unsigned char/ in "(char *)eth"
294: warning: ethernet address is not type unsigned char *
2001-06-15 07:34:29 +00:00
Peter Wemm
6cac567e1b Fix warning: 848: warning: label `nosupport' defined but not used 2001-06-15 07:33:09 +00:00