Commit Graph

142 Commits

Author SHA1 Message Date
atatat 4de3747b89 Sysctl descriptions under net subtree (net.key not done) 2004-05-25 04:33:59 +00:00
matt e50668c7fa Constify protosw arrays. This can reduce the kernel .data section by
over 4K (if all the network protocols) are loaded.
2004-04-22 01:01:40 +00:00
matt e3b919c754 Constify if.c radix.c and route.c (and fix related fallout). 2004-04-21 04:17:28 +00:00
atatat 19af35fd0d Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.
2004-03-24 15:34:46 +00:00
drochner ce20d083dc make it compile with !(INET || INET6) 2004-01-29 16:33:14 +00:00
itojun aa8a6718f0 use if_indexlim (instead of if_index) and ifindex2ifnet[x] != NULL
to check if interface exists, as (1) if_index has different meaning
(2) ifindex2ifnet could become NULL when interface gets destroyed,
since when we have introduced dynamically-created interfaces.  from kame
2003-12-10 11:46:33 +00:00
atatat 13f8d2ce5f Dynamic sysctl.
Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al.  Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded.  Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment.  I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.
2003-12-04 19:38:21 +00:00
keihan 6979203302 s/netbsd.org/NetBSD.org/g 2003-11-28 08:56:48 +00:00
drochner 14332cf998 fix interface address list traversal in if_detach():
The code was assuming that interface addresses are removed one-by-one.
With IPv6 and multicasts, removal of one address can remove other
addresses as side effect, which caused accesses of free()d memory.
2003-11-11 20:33:46 +00:00
jonathan 88ba77e705 Make per-protocol network input queue stats visible to userland via
sysctl. Add a protocol-independent sysctl handler to show the per-protocol
"struct ifq' statistics. Add IP(v4) specific call to the handler.
Other protocols can show their per-protocol input statistics by
allocating a sysclt node and calling sysctl_ifq() with their own struct ifq *.

As posted to tech-kern plus improvements/cleanup suggested by Andrew Brown.
2003-11-10 20:03:29 +00:00
dyoung 690ab87058 Use new 802.11 header files. 2003-10-13 08:02:02 +00:00
itojun ae7fc0a7d4 fix out-of-bounds access to ifindex2ifnet[]. found by iij seil team. 2003-10-01 04:22:33 +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
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
itojun 7e053b8b90 decnetintrq is still in fddi/tokenring (is it needed?). 2003-07-15 06:24:38 +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
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 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
martin d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
christos 0b736391e8 add COMPAT_ULTRIX where necessary. Thanks gimpy! 2003-05-19 22:17:24 +00:00
itojun abf7c0c6f1 AF_LINK sockaddr has to be attached to ifp->if_addrlist until the end,
as many of the code assumes that TAILQ_FIRST(ifp->if_addrlist) is non-null.
2003-05-16 16:57:09 +00:00
thorpej b193480908 Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant.  Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.
2003-02-01 06:23:35 +00:00
perry 6858187df6 /*CONTCOND*/ while (0)'ed macros 2002-11-02 07:20:42 +00:00
provos 0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
onoe f529393822 Add check suser() for SIOCS80211BSSID, SIOCS80211CHANNEL. 2002-09-27 04:08:40 +00:00
thorpej 2371f92317 Fix signed/unsigned comparison warnings from GCC 3.3. 2002-08-26 01:36:37 +00:00
wiz 645df36eff Spell '[Rr]ight' correctly. From Jim Bernard. 2002-07-26 14:11:34 +00:00
itojun 425b0d2350 typo 2002-06-13 05:12:12 +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
itojun 87fc46bce9 improve nd6_setmtu(), to warn too-small MTU on SIOCSIFMTU. sync w/kame 2002-05-30 05:06:28 +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
matt 2d83d27dfa Eliminate more commons. 2002-05-12 20:40:11 +00:00
simonb dbafd8c6a6 Make the 'ifnet' variable an extern and declare it in if.c. 2002-03-17 10:21:42 +00:00
atatat 9dd8465963 (1) Make if_index "wrap" at USHRT_MAX instead of going above it so
that other parts of the kernel won't lose gratuitously.  There are
places where it's assumed that it won't grow that large.

(2) Avoid accidental reuse of occupied slots in the ifindex2ifnet[]
table.
2002-02-09 05:56:34 +00:00
abs 42ceb2f007 Add an #if defined(INET) ... around if_detach_queues's declaration to match the
one around its definition.
2001-12-02 19:44:25 +00:00
augustss 113024244c Make it compile in the absence of networks. Closes PR 14274 (mine). 2001-11-27 17:32:57 +00:00
lukem 34d65a3414 add RCSIDs 2001-11-12 23:49:33 +00:00
matt b5e785f38d Switch to using queue access macros instead of refering to the member
fields explicitly.
2001-11-05 18:02:15 +00:00
thorpej d679590033 Split the pre-computed ifnet checksum flags into Tx and Rx directions.
Add capabilities bits that indicate an interface can only perform
in-bound TCPv4 or UDPv4 checksums.  There is at least one Gig-E chip
for which this is true (Level One LXT-1001), and this is also the
case for the Intel i82559 10/100 Ethernet chips.
2001-09-17 17:26:59 +00:00
itojun 32c36b5e14 fix logic to free up ifqueue on if_detach(). prev pointer was incorrectly set. 2001-08-02 01:42:38 +00:00
itojun c4a687384b make sure to cleanup software interrupt queues (like ipintrq)
on interface detach, otherwise we will have a dangling pointer
from m->m_pkthdr.rcvif.
2001-07-29 03:28:30 +00:00
itojun 888b31fb38 indent fix 2001-07-28 01:13:56 +00:00
itojun cf7ae5ac15 clear ifindex2ifnet[] on if_detach. 2001-07-24 16:35:29 +00:00