Commit Graph

1113 Commits

Author SHA1 Message Date
thorpej 2d655f566e In bpf_setdlt(), preserve the promiscuous mode setting of the
descriptor.

From David Young <dyoung@ojctech.com>, slight change by me.
2002-09-15 23:44:12 +00:00
thorpej 4c3ae4bbc8 Add new ioctls:
* SIOCS80211CHANNEL, SIOCG80211CHANNEL -- set/get the 802.11 channel.
* SIOCS80211BSSID, SIOCG80211BSSID -- set desired/get current BSSID.

From David Young <dyoung@ojctech.com>.
2002-09-15 23:27:08 +00:00
itojun 0319b78e54 copyright clarification. from openbsd
1.
Paul Mackerras and the Australian National University have worked things
out, and as a result, Paul now owns copyright on all these files, with the
proper terms.

2.
and... we managed to contact "Eric Rosenquist" <eric@rosenquist.com> through
the help of people who found him: first one was nick.stott@cogeco.ca
This now has a better license.  Two authors left to go.
2002-09-13 14:32:11 +00:00
itojun 822449ac65 KNF - return is not a function. 2002-09-11 05:36:26 +00:00
gehenna 77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00
onoe 26ebf5f371 Several fixes hostap for awi driver:
- aging ang clear inactivity stations
- DTIM field in beacon/probe response.
- ignore IFF_PROMISC for hostap mode, since 802.11 has 3 address fields,
  so that promisc mode is not required for AP function.
2002-09-03 14:54:00 +00:00
onoe efcfc3e1c8 Add experimental support of Host-AP mode for awi driver.
It works also with WEP enabled.
But aging the associated clients is not implemented yet, so that the number
of clients may increase unlimitedly..
2002-09-02 13:37:35 +00:00
martin 1caaa903fa If the peer did not answer LCP echo requests in-time, but we got user
data through within the last LCP keepalive interval, do not count this
as a keepalive failure.

Addresses parts of kern/17723.
2002-09-01 18:54:12 +00:00
martin adb5933cbb Apply patch from Todd Vierling in PR kern/17665:
remove a test that has been obsoleted by the authentication failure
counter - enter slow retry mode always, not only if we already transfered
data successfully (the test was designed to disable retries when the
initial authentication setting was not correct, the auth failure counter
does this job better).
2002-09-01 18:06:59 +00:00
martin ac83580ea9 Add an option PPPOE_TERM_UNKNOWN_SESSIONS to forcefully disconnect sessions
we don't know anything about with a PADT packet.

Use with care, this is pretty dangerous and will kill all userland PPPoE
implementations. Therefore it is not enabled by default nor added as
a commented out option to GENERIC kernels.

But it is highly usefull if you have a fixed IP, an ISP that does not use
LCP echo requests for link monitoring and you want to recover quickly after
a crash or otherwise ungracefull disconnect.
2002-09-01 17:21:40 +00:00
onoe fd9daca7ea Attach another DLTs for bpf: DLT_IEEE802_11 to capture raw 802.11 frame. 2002-08-28 09:38:08 +00:00
onoe 5d6bb1fbc3 Define new kernel interface bpfattach2() to register another data link
type for the driver, which will be used for 802.11 drivers.
Also add 2 APIs to get a list of available DLTs and use one for them.
	BIOCGDLTLIST (struct bpf_dltlist)
	BIOCSDLT (u_int)
2002-08-28 09:34:57 +00:00
onoe b4c41e0480 Define new DLT: DLT_IEEE802_11, DLT_PRISM_HEADER, and DLT_AIRONET_HEADER
from tcpdump.org
2002-08-28 09:31:20 +00:00
thorpej 83b3b86fd6 Fix a signed/unsigned comparison warning from GCC 3.3. 2002-08-26 01:42:28 +00:00
thorpej f3420f21a5 Fix some signed/unsigned comparison warnings from GCC 3.3. 2002-08-26 01:39:39 +00:00
thorpej 2371f92317 Fix signed/unsigned comparison warnings from GCC 3.3. 2002-08-26 01:36:37 +00:00
tron 56999645f0 Fix typo in a comment. 2002-08-25 19:21:47 +00:00
martin f54ddc3c17 Add a function to lookup bridge members by struct ifnet * and use
it at all call sites that have such a pointer readily available.
This avoids unnecessary strcmp()s in critical paths, and removes
some XXX comments.
2002-08-24 19:00:31 +00:00
onoe 63a1f2ed02 Delete IFM_IEEE80211_IBSS [ibss] and IFM_IEEE80211_IBSSMASTER [ibss-master]
from media options, since IEEE80211_ADHOC [adhoc] is already defined for
IBSS.  Instead, [ibss] is assigned as an alias for IEEE80211_ADHOC.
2002-08-21 03:22:04 +00:00
kristerw 6cf8d48ed9 #if 0 a couple of unused functions. 2002-08-20 03:52:26 +00:00
kristerw 81244d0b17 Make it compile for the __NO_STRICT_ALIGNMENT case. 2002-08-20 03:32:08 +00:00
thorpej c59bd1a572 In ether_output(), don't bother calling memcpy() to plop the ethertype
into the packet: On system with no strict alignment constraints, just
assign the value, and on others, do an inline 2 byte copy.
2002-08-19 18:58:50 +00:00
itojun c00fa8dfd9 avoid swapping endian of ip_len and ip_off on mbuf, to meet with M_LEADINGSPACE
optimization made last year.  should solve PR 17867 and 10195.

IP_HDRINCL behavior of raw ip socket is kept unchanged.  we may want to
provide IP_HDRINCL variant that does not swap endian.
2002-08-14 00:23:27 +00:00
itojun dddc4be003 to be consistent with other sources, use "struct ip *ip", not inp.
(inp is usually used for pointing struct inpcb)
2002-08-12 05:22:57 +00:00
drochner 5f33ace021 rename WI_ ioctl to make it compile again 2002-08-11 12:08:55 +00:00
thorpej 2faddb9f3d * Additional frame control types.
* BEACON and AUTH management packet info.
* Add ioctl for configuring 802.11 auth mode.

From OpenBSD.
2002-08-11 03:39:21 +00:00
thorpej 0eee4f1a69 Add "hostap", "ibss", and "ibss-master" 802.11 media options.
From OpenBSD.
2002-08-10 23:21:58 +00:00
soren f969160bd2 <net/if.h> needs <sys/socket.h> for struct sockaddr.
PR kern/3377 from der Mouse.
2002-08-09 22:43:15 +00:00
itojun cf8807954f backout previous. i was looking at the wrong RFC. 2002-08-06 04:58:57 +00:00
itojun fa5ffb82e4 based on RFC2529, stf(4) should have 1480 as MTU, not 1280.
tron found it, sync w/kame
2002-08-05 23:37:48 +00:00
onoe 248c861292 Fix IBSS for awi driver. 2002-08-05 06:55:05 +00:00
christos d64bbf607d Fix async map handling. Many thanks to Joerg Wunsch for the explanation. 2002-07-30 13:16:35 +00:00
atatat 6675196afb Make tun interfaces perform auto-creation. This means that if a
program opens /dev/tun# and tun# has not been SIOCIFCREATE'd already,
it will be SIOCIFCREATE'd automatically.  FreeBSD's tun interfaces
behave in a somewhat similar fashion.
2002-07-29 16:53:30 +00:00
christos 42f6b6f836 Patches from Frank Kardel:
- length was one off in names and secrets.
- add win 98 kludge but we keep it disabled for now.
- setup the authorization bit early so that we don't end up doing ppp
  negotiations without authorization.
2002-07-28 22:16:47 +00:00
christos 59d3d6c274 Don't throw away the name and the secret lengths. This eliminates all the
strlen() calls, and there was a whole bunch of them.
2002-07-28 19:54:47 +00:00
christos 450091b937 avoid modifying the buffers, by checking for matching lengths first. From
Frank Kardel.
2002-07-28 15:12:29 +00:00
christos ca989d9a38 Use strcmp() instead of memcmp() because if we get passed a 0 length name
and secret, we'll authenticate successfully! While there, rename passwd to
secret so that code looks nicer.
2002-07-27 19:09:07 +00:00
wiz 645df36eff Spell '[Rr]ight' correctly. From Jim Bernard. 2002-07-26 14:11:34 +00:00
tron e5e66e171b Increase interface output error count in case of a failure. 2002-07-23 06:59:51 +00:00
tron 5126e6107d Increase interface output counter for every encapsulated packet sent to IP. 2002-07-23 06:44:53 +00:00
martin 5d9a5f68c8 Use "mono_time" instead of "time" for timeout calculations. 2002-07-13 11:08:03 +00:00
yamt 43b3a8007f don't access freed memory. 2002-07-11 21:37:51 +00:00
yamt c56faa76d8 don't access freed memory. 2002-07-11 21:21:53 +00:00
itojun db705b375f use iana-assigned value for IFT_STF. sync w/kame 2002-07-10 21:01:06 +00:00
itojun c6f53f281c correct tcp header chasing in pp_fastq processing. should fix kern/17491. 2002-07-06 18:33:45 +00:00
itojun fb05cd3dd3 new copyright boilerplate from CMU. from openbsd 2002-07-01 22:09:31 +00:00
onoe b00ef6acdd Fill ar_hrd for AF_ARP. 2002-06-25 03:42:28 +00:00
enami 92912a1744 Actually inject the arp packet into softintr queue. 2002-06-24 12:00:49 +00:00
itojun 0143dfc42f integrate IEEE1394 ARP into generic ARP logic.
XXX there's no check at all in ar_hrd, and we don't set ar_hrd on outgoing.
it seems like a bad thing.
2002-06-24 08:06:20 +00:00
itojun 39cf9ef1f5 g/c last bit of old ipv6 prefix management. 2002-06-23 23:34:08 +00:00
yamt a113bc6fa4 - free buf when unneeded.
- pass a consistent type to free(9).
2002-06-22 17:41:23 +00:00
yamt f6849cb26f fix loop condition.
(don't skip last tag)
2002-06-22 16:56:11 +00:00
itojun f16149934e avoid unneeded call to m_pullup 2002-06-22 11:46:16 +00:00
itojun 9f260b4865 do not require PPPoE control packet to be put into a single mbuf.
reviewed/tested by ymmt
2002-06-22 11:37:48 +00:00
itojun 32e2727406 more style 2002-06-22 05:59:27 +00:00
itojun 98171fbccc style 2002-06-22 05:54:14 +00:00
itojun a028d35cfd more KNF. warn about mbuf misuse (passing pointer outside of mbuf is dangerous) 2002-06-22 05:52:00 +00:00
itojun e94ae067d1 tabify. minor KNF 2002-06-22 05:33:42 +00:00
itojun a10b39ecad reject packets with IPv4 private address range. sync w/kame 2002-06-20 07:43:39 +00:00
itojun 425b0d2350 typo 2002-06-13 05:12:12 +00:00
itojun 00f97b0202 drop too short IPv6 frame 2002-06-13 05:10:34 +00:00
itojun bc880e4114 correect AF_INET6 handling 2002-06-13 05:09:52 +00:00
pooka fef2794715 s/splimp/splnet/ in comment 2002-06-11 11:03:55 +00:00
pooka dc325578c7 fix a few typos in comments 2002-06-11 06:00:57 +00:00
itojun c9faadc40f return EPROTONOSUPPORT if unsupported protocol is specified 2002-06-10 17:40:26 +00:00
itojun 53b229d4cb don't abuse IFF_UP 2002-06-10 17:38:31 +00:00
itojun c0a05a111d raise output errcnt 2002-06-10 17:30:16 +00:00
itojun 2d509e83c4 ENETDOWN if outer ip address is not configured.
plug mbuf leak while here.
2002-06-10 17:12:22 +00:00
itojun ccdab26a23 don't use inner address configured by SIOCSIFADDR/DSTADDR
as outer addresses; now you need to configure outer address by
SIOCS*PHYADDR ("ifconfig tunnel").  as discussed on tech-net
2002-06-10 17:07:51 +00:00
itojun 7864ca478f deprecate IFF_LINK2, !IFF_LINK0 is enough.
no need to manipulate IFF_LINK1 with IFF_LINK0.
remove reference to greconfig(8).
2002-06-09 19:17:43 +00:00
itojun 4c4b38eb0b no need for if_addrlen be 4. From: Martin Husemann <martin@duskware.de> 2002-06-09 17:59:45 +00:00
itojun c284599930 make sure to bzero sockaddr_in 2002-06-09 17:32:54 +00:00
itojun 9c95390f4a style 2002-06-09 17:22:41 +00:00
itojun a8b0c39863 don't forget splx 2002-06-09 17:18:32 +00:00
itojun 04aa2a1c65 avoid code duplicate (route lookup) 2002-06-09 17:17:15 +00:00
itojun 1a5eede494 style 2002-06-09 17:13:31 +00:00
itojun 6f21655564 support SIOCSLIFPHYADDR, SIOCDIFPHYADDR and SIOCGLIFPHYADDR, so that
we can manipulate tunnel endpoint by ifconfig(8).
2002-06-09 17:10:09 +00:00
martin aed31ed511 Change default MTU to 1476 (same value that Cisco uses).
Do not limit the MTU when set by the admin with ifconfig, per discussion
on tech-net.

This fixes PR 16761 from Jasper Wallace.
2002-06-09 09:45:39 +00:00
itojun a636441cdc reject "add" request if if_mtu is different. 2002-06-08 23:17:01 +00:00
itojun f64f00cc3f need to protect if_attachdomain() too 2002-06-08 11:58:50 +00:00
itojun ad2c23cb75 protect dom_ifattach by splnet 2002-06-08 11:54:24 +00:00
wrstuden 9e2b945a7b defparam BPF_BUFSIZE 2002-06-06 23:54:47 +00:00
itojun fc6382d167 no need to set rmx_send/recvpipe. 2002-06-04 22:11:15 +00:00
itojun b1654995d0 add a blank line 2002-06-04 10:00:24 +00:00
itojun 87fc46bce9 improve nd6_setmtu(), to warn too-small MTU on SIOCSIFMTU. sync w/kame 2002-05-30 05:06:28 +00:00
christos ab57e25224 add 2 more CCP defines. 2002-05-29 19:11:05 +00:00
itojun eee0912fd7 don't panic on invalid CONF_ACK from remote (in general, issueing panic
on remote input is bad practice)
2002-05-29 01:38:46 +00:00
itojun ae5a9e211d re-scan all ifnet after domaininit() for if_afdata initialization. 2002-05-27 13:46:45 +00:00
itojun e5aa199677 framework to add af-dependent data structure to struct ifnet.
as discussed at bsd-api-discuss.  sync w/kame
2002-05-27 02:53:49 +00:00
matt 486c7ce727 Add SIOCGIFDATA and SIOCZIFDATA ioctl's to get interface data. (the Z
variant also zeroes the counters after copying them).  In ifunit, add
support for dealing all numeric ifname by treating them as an ifindex
which is used to look up the interface.
2002-05-23 21:34:39 +00:00
itojun d64426f359 use IFT_BRIDGE 2002-05-23 06:19:39 +00:00
itojun 754f309c32 add recently-added IANA values from http://www.iana.org/assignments/smi-numbers 2002-05-23 06:18:44 +00:00
itojun 1d8b891867 sync with KAME.
- make altq_etherclassify() able to handle packets whose ethernet header
  is in a separate mbuf.  closes netbsd PR 16559
2002-05-18 22:52:44 +00:00
haya 1ce4bf6bec Bugfix: s/__NetBSD_Version/__NetBSD_Version__/. IPv4 over IEEE 1394
will work with this change.
2002-05-16 09:08:33 +00:00
matt aefe6a5034 Eliminate common. 2002-05-13 23:50:32 +00:00
matt 2d83d27dfa Eliminate more commons. 2002-05-12 20:40:11 +00:00
matt 17b32e3800 Make ppp_softc[] extern and declare in if_ppp.c 2002-05-12 20:38:15 +00:00
tron 953a52bd9e Fix memory leak which occurs after an allocation failure. 2002-05-07 09:14:20 +00:00
martin 75a925b327 "if (debug)" some log messages not signaling real errors but happening
in normal operation.
2002-04-29 16:29:29 +00:00
enami 064142edd8 Use ETHER_HDR_LEN instead of 14. 2002-04-27 02:38:47 +00:00