Commit Graph

1232 Commits

Author SHA1 Message Date
martin 392a465bb8 Tell copyinstr about the real buffer size (not one byte to few). Add more
error checking. Noticed by Quentin Garnier.
2003-09-16 20:59:04 +00:00
jdc 3fc943e207 Adapt to account for bridge_enqueue()'s extra parameter. 2003-09-16 17:39:12 +00:00
jdc 7454db32b4 Add filter/no filter flag parameter to bridge_enqueue(). 2003-09-16 17:38:24 +00:00
jdc 32263965e2 Add a flag parameter to bridge_enqueue() to tell it whether to run the
filter or not.  We only need to run the filter for bridge_forward() and
bridge_broadcast().  If we also run it for bridge_output(), we will run
the filter twice outbound per packet, so don't.

In bridge_ipf(), make sure we don't run m_cat() on a single mbuf chain
by checking to see (and remembering) if we need to m_split() the mbuf.
This fixes bridge + ipfilter on sparc.

Fixes PR kern/22063.
2003-09-16 17:37:27 +00:00
martin 9e7359685b Fix copy & pasto (luckily, for most archs the structs had the same size,
so this went unnoticed for quite some time now). Noticed by Thomas Bieg.
2003-09-11 18:04:51 +00:00
drochner 1face2cc7a Fix vlan tag sending in the ETHERCAP_VLAN_HWTAGGING case.
Makes my "txp" work and fixes "bge" -- PR kern/20363 by Scott Ellis.
2003-09-09 14:22:19 +00:00
martin 6dd20a92b2 Fix copy & pasto. 2003-09-05 23:13:15 +00:00
itojun 9636351c96 u_short -> u_int16_t 2003-09-05 23:02:40 +00:00
christos a0e952bddb bump the buffer size from 15 to 63 bytes. 2003-09-04 07:46:47 +00:00
martin 965fbb9f63 If the peer cares to send us error messages, actually display them. 2003-09-03 21:36:31 +00:00
martin 6f2d2eefc7 Rearange dead link detection slightly:
As long as we receive data from the peer, don't worry. When we have not
received anything within the "max_noreceive" period, we start sending LCP
echo requests and count them, until we receive an answer (or some data)
or the "maxalive" count of not answered echo requests is reached.
All this is checked at a global 10 seconds interval for all interfaces.
The "max_noreceive" period and the "maxalive" count are configurable per
interface.
2003-09-03 20:48:46 +00:00
christos ab661a6a58 Add a new ioctl PPPIOCGRAWIN to get the last characters we got from the
remote site.
2003-09-01 16:51:25 +00:00
martin f5a54fd742 When trying to (re-)establish a session cope with intermediate output
failures of the underlying ethernet interface - just keep trying.
2003-08-23 16:42:41 +00:00
itojun 82eb4ce914 change the additional arg to be passed to ip{,6}_output to struct socket *.
this fixes KAME policy lookup which was broken by the previous commit.
2003-08-22 21:53:01 +00:00
jonathan f4c2260f8a Make if_loop MTU settable via SIOCSFMTU/ifconfig. Useful for testing,
and for regression-testing performance at various MTUs.

NB: route MTU may not track MTU changes, which may cause problems for
AF_ISO if loopback MTU is decreased. I've never seen problems with IP,
in various tests going back to around NetBSD 1.3.
2003-08-15 19:22:08 +00:00
jonathan 28b5f5dfab (fast-ipsec): Add hooks to pass IPv4 IPsec traffic into fast-ipsec, if
configured with ``options FAST_IPSEC''.  Kernels with KAME IPsec or
with no IPsec should work as before.

All calls to ip_output() now always pass an additional compulsory
argument: the inpcb associated with the packet being sent,
or 0 if no inpcb is available.

Fast-ipsec tested with ICMP or UDP over ESP. TCP doesn't work, yet.
2003-08-15 03:42:00 +00:00
itojun 230da08946 correct number range handling. David Young 2003-08-14 07:39:22 +00:00
itojun 25e6c004c4 fix INT_MAX check in if_clone_lookup 2003-08-14 00:19:43 +00:00
itojun 326e7bdf59 correct if_clone_lookup(). based on diff from Quentin Garnier 2003-08-14 00:13:34 +00:00
wrstuden 2d11b64df0 Include correct file for defopt. 2003-08-13 19:44:12 +00:00
itojun 497e73e9cf rm extra blank line 2003-08-11 15:14:16 +00:00
itojun bdbf60398b minor knf 2003-08-11 15:13:59 +00:00
christos 27ffe34f72 Fix problem with OSIOCIFCONF where it tried to copyout addresses that
did not fit in struct osockaddr. Fixes linux emulation issue where bogus
addresses where returned for the interfaces [AF_LINK, AF_INET6]. While
I am here, change ioctl, so if the ifconf buffer passed is NULL, then it
computes how much space is needed and returns it in ifc_len.
2003-08-09 18:13:03 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
christos 9a1168a5bf Avoid DOS attack by setting ifm->ifm_media to a high number and running the
kernel out of memory. Thanks to Andreas Oman.
2003-07-25 19:35:57 +00:00
itojun 1270423572 add AH/ESP algorithms: hmac-ripemd160 (AH), AES XCBC MAC (AH),
AES counter mode (ESP)
2003-07-25 10:00:49 +00:00
itojun d64e1c8d6a add hmac-sha2 support. various cleanups (like avoid hardcoding '16').
from kame
2003-07-22 03:24:23 +00:00
itojun 7e053b8b90 decnetintrq is still in fddi/tokenring (is it needed?). 2003-07-15 06:24:38 +00:00
jdc e8e38ce54c Include opt_inet.h to get INET6 definition.
Now, bridged ipv6 packets are passed through ipfilter.
However, some v6 packets still do not get transmitted when ipf is enabled.
Partial fix for PR kern/22063.
2003-07-13 08:51:36 +00:00
martin 2951cb8e99 We should use IFQ_DEQUEUE to get packets from the send queue, not IF_DEQUEUE.
Hopefully this will fix ALTQ for ISDN and PPPoE interfaces.

While there remove an unsued function which contained dubious code
(accessing interface queue internals w/o the proper macros).
2003-07-09 20:12:53 +00:00
itojun 91b11e1eba prototype must not have variable name 2003-07-08 07:13:50 +00:00
dyoung 4451fcd003 From Sam Leffler/FreeBSD: AP scanning code, for forthcoming ADM8211
driver (and for eventual synchronization w/ Sam's enhancements to
FreeBSD).

From dyoung@netbsd.org, factor ieee80211_create_ibss and
ieee80211_match_bss out of ieee80211_end_scan for re-use in the
forthcoming ADM8211 driver.
2003-07-06 20:54:24 +00:00
dyoung 07a1dea78b A straggler in the 802.11 media-handling consolidation. 2003-07-06 20:24:51 +00:00
dyoung 6e3daf0a07 Still more consolidation of 802.11 media-handling, moving moving
common code from awi and wi into the 802.11 framework. Inspired by
Sam Leffler's patches to FreeBSD.
2003-07-06 20:01:17 +00:00
dyoung 9311a1d632 Move the logic to find out what channel to transmit a packet on
into ieee80211_get_channel, rather than duplicate it in ieee80211_ioctl
and in the ADM8211 driver.
2003-07-06 08:39:59 +00:00
dyoung 868fc8b800 Bug fix: an ad-hoc node's SSID can change at any time, so record
a change of SSID (provided it changes to a non-empty SSID) regardless
of whether it comes in a probe response or a beacon.
2003-07-06 08:27:04 +00:00
dyoung 6f114d314a With the IEEE80211_HEADER_LEN macro, accomodate hardware whose
"native" 802.11 header is a 4-address header, not the 3-address
header.
2003-07-06 08:21:41 +00:00
dyoung 725bfbdab7 More 802.11 media-handling consolidation. ieee80211_media_status
and ieee80211_media_change are factorizations of the media
status/change functions for wi and awi. Inspired by Sam Leffler/FreeBSD.
2003-07-06 08:06:20 +00:00
dyoung 030634087a Prepare to consolidate 802.11 media handling (which is handled in
code duplicated by each driver, now) into the 802.11 framework.
2003-07-06 07:54:43 +00:00
dyoung 321cda0a59 In debug messages, tell on which channel we send a mgmt frame. 2003-07-06 07:33:57 +00:00
dyoung a068a2bdcd In debug messages, use the right MAC address to report which client
turned off power-saving mode.
2003-07-06 07:18:38 +00:00
ragge 3e74a824b6 Make IFQ_MAXLEN possible to set as an config-file option. 2003-07-03 09:24:19 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
ichiro 64c73d799a missing ')' 2003-06-29 10:13:11 +00:00
darrenr 42091f2362 From OpenBSD 1.33-1.34:
When using bpf(4) in immediate mode, and using kevent(2) to receive
notification of packet arrival, the usermode application isn't notified
until a second packet arrives.

This is because KNOTE() calls filt_bpfread() before bd_slen has been
updated with the newly arrived packet length, so it looks like there
is no data there.

Moving the bpf_wakeup() call for immediate mode to after bd_slen is set
fixes it.

From: wayne@epipe.com.au in pr 3175
2003-06-28 17:33:02 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
oki 955ac53d91 Put correct dest ether address on PPPoE server mode. 2003-06-27 16:24:32 +00:00
tron 706af04c5c Test for symbol "_KERNEL_OPT" instead of "_LKM" as suggested by
Matthew Green.
2003-06-26 08:22:06 +00:00
tron 88613ffb5e Don't include "opt_mbuftrace.h" if "_LKM" is defined. This fixes a build
problem in the "vmware-module3" package.
2003-06-26 06:52:55 +00:00
itojun df0f79e5b1 recover code that requires exact match on rtm_change/lock (lost in 1.16).
without it "route change X" would change less-specific route by mistake.
reported by jinmei@kame
2003-06-24 08:31:32 +00:00