Commit Graph

1856 Commits

Author SHA1 Message Date
martin 3028e483e4 Convert to new 2 clause license 2008-04-29 06:53:00 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
yamt ee319e086d netstat_sysctl: set sysctl_size correctly. (fix netstat -s garbage output) 2008-04-26 08:17:01 +00:00
ad 6d70f903e6 Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
  be sent from a hardware interrupt handler. Signal activity must be
  deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
  and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
2008-04-24 15:35:27 +00:00
martin f9b83801e8 Make it compile if !COMPAT_OSOCK 2008-04-24 13:30:52 +00:00
ad 15e29e981b Merge the socket locking patch:
- Socket layer becomes MP safe.
- Unix protocols become MP safe.
- Allows protocol processing interrupts to safely block on locks.
- Fixes a number of race conditions.

With much feedback from matt@ and plunky@.
2008-04-24 11:38:36 +00:00
thorpej 34908fe541 Add subroutines to support collating per-cpu-gathered network statistics. 2008-04-23 05:21:17 +00:00
scw 9d52faae48 Pull in a couple of fixes from FreeBSD, the first of which addresses a
failure of wpa_supplicant(8) to re-key promptly, as reported in
http://mail-index.netbsd.org/tech-net/2008/04/18/msg000459.html

- Make bpf's read timeout work more correctly with select/poll.

- A fix for catchpacket() which delays calling bpf_wakeup() until
  the state has been updated.
2008-04-20 15:27:10 +00:00
thorpej 881a947288 Make ARP stats per-cpu. 2008-04-15 15:17:54 +00:00
thorpej 0dd41b37de Make ip6 and icmp6 stats per-cpu. 2008-04-15 03:57:04 +00:00
cegger 856327cd56 make this build with BRIDGE_IPF and PFIL_HOOKS options 2008-04-12 09:26:45 +00:00
thorpej 7ff8d08aae Make IP, TCP, UDP, and ICMP statistics per-CPU. The stats are collated
when the user requests them via sysctl.
2008-04-12 05:58:22 +00:00
dyoung 18f5f53751 Add some assertions that will catch any exception to
ro->ro_sa == NULL implies ro->_ro_rt == NULL.
2008-04-10 18:12:02 +00:00
thorpej 3f466bce48 Change IPv6 stats from a structure to an array of uint64_t's.
Note: This is ABI-compatible with the old ip6stat structure; old netstat
binaries will continue to work properly.
2008-04-08 23:37:43 +00:00
thorpej 88d65e9212 Change IP stats from a structure to an array of uint64_t's.
Note: This is ABI-compatible with the old ipstat structure; old netstat
binaries will continue to work properly.
2008-04-07 06:31:27 +00:00
cegger cc658c528f use aprint_*_dev and device_xname 2008-04-05 13:49:36 +00:00
dyoung cdb2193bda Improve error handling. gre(4) is still broken, but it does not
any longer cause a page fault trap.
2008-04-03 21:40:59 +00:00
dyoung b674c86ad6 Fix one of two bugs introduced by the descriptor handling changes
(rev 1.125): correct the check for fd_getsock() failure in
gre_socreate().

The second bug is more complicated to fix.  Since rev 1.125,
gre_reconf() is using the file descriptor table of the current
process instead of the process 0's (the kernel's).
2008-04-03 07:19:32 +00:00
dyoung 0228252053 Cosmetic: use curlwp everywhere that it is appropriate, instead of
using a temporary variable.  Remove superflous curly braces.  Move
an assignment that shuts up a "variable may be used uninitialized"
warning.
2008-04-03 07:12:16 +00:00
yamt c585603ac5 route_intr: fill a correct member of sockproto. (sp_family -> sp_protocol) 2008-03-29 13:00:43 +00:00
ad be04ac4896 Make rusage collection per-LWP and collate in the appropriate places.
cloned threads need a little bit more work but the locking needs to
be fixed first.
2008-03-27 19:06:51 +00:00
ad 9591013005 Defer processing of routing messages to a soft interrupt. These can be
generated at IPL_VM and it's not safe to call directly into the socket
layer at that level. Reviewed by matt@.
2008-03-26 14:53:14 +00:00
christos f071da976a - put const back, no reason to modify the prototype.
1. Please don't cast function pointers to (void *), use the full function
   prototype cast; this is for archs where a function pointer is not a regular
   pointer.
2. Compare pointers to NULL not 0.
2008-03-26 02:21:52 +00:00
yamt 9a4b7dd279 merge yamt-lazymbuf branch. 2008-03-24 12:24:37 +00:00
yamt 9f194df082 agrport_monitor: map IFM_NONE to IFM_NONE|IFM_ETHER and add a comment. 2008-03-24 09:14:52 +00:00
ad a9ca7a3734 Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
2008-03-21 21:54:58 +00:00
rtr 6797804c6b whitespace '\t' -> ' ' 2008-03-15 11:45:18 +00:00
matt 45e0220f34 Make sure M_PROMISC isn't already set, before we need to see if we are going
to see if we need to set M_PROMISC.
Assume the interface is not CARP'ed.
2008-03-15 05:07:34 +00:00
dyoung 84f6ead420 Make some cosmetic changes:
Use fewer 'error = ...; break;' statements and more 'return
        ...;'

        Make the SIOCSIFFLAGS case more clear by using a switch
        statement instead of an if-else if-else chain.

        Shorten a staircase, and remove two unnecessary curly
        braces.
2008-03-12 18:22:24 +00:00
cube 44f2cef6db Split device_t/softc, and other related cosmetic changes. 2008-03-04 13:25:05 +00:00
rmind c6186face4 Welcome to 4.99.55:
- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call.  It will
  indicate which event (POLL_IN, POLL_OUT, etc) happen.  If unknown,
  zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
2008-03-01 14:16:49 +00:00
dyoung 8a7761f76c Cosmetic: shorten staircases. Join some lines. 2008-02-29 21:23:55 +00:00
matt eefce21cf2 Revert change of char to int8_t. 2008-02-20 17:18:11 +00:00
matt 2b028087f5 s/u_\(int[0-9]*_t\)/u\1/g
(change u_int*_t to uint*_t)
2008-02-20 17:05:52 +00:00
skrll 5bdccff36c CARP is Common *Address* Redundancy Protocol 2008-02-13 09:25:24 +00:00
dyoung df7679436b #include <sys/evcnt.h> for event counters. 2008-02-12 00:53:06 +00:00
dyoung b1480edbc5 Do not needlessly #include <sys/device.h>. 2008-02-11 22:32:48 +00:00
simonb 93469128b0 Don't look for <stdbool.h> if compiling _STANDALONE as well. 2008-02-11 04:47:21 +00:00
martin 035ac59527 Make it compile w/o INET6 2008-02-07 08:48:16 +00:00
xtraeme 4f2a32a138 Remove neticp (network info commpage) stuff that dyoung added
accidentally to make this build again.
2008-02-07 04:44:21 +00:00
dyoung 2ccede0a9c Start patching up the kernel so that a network driver always has
the opportunity to handle an ioctl before generic ifioctl handling
occurs.  This will ease extending the kernel and sharing of code
between drivers.

First steps:  Make the signature of ifioctl_common() match struct
ifinet->if_ioctl.  Convert SIOCSIFCAP and SIOCSIFMTU to the new
ifioctl() regime, throughout the kernel.
2008-02-07 01:21:52 +00:00
dyoung d8e12ce795 Fix more fall-out from extracting ifioctl_common(): don't return
ENETRESET from ifioctl().
2008-01-23 16:51:19 +00:00
dyoung aa385448f5 Functional: return ENTRESET from ifioctl_common(), if SIOCSIFCAP
changed anything.

Cosmetic: shorten staircase.
2008-01-22 22:26:30 +00:00
dyoung 94e4ecb4ba Add missing break statement. 2008-01-22 22:09:59 +00:00
dyoung 81e0f3dc3d Take two steps toward adding and deleting link-layer addresses.
1 Extract subroutine if_dl_create() from if_alloc_sadl().
  if_dl_create() allocates a link-layer ifaddr.

2 Extract subroutine ifioctl_common() from ifioctl().  ifioctl_common()
  will be the basis for an ifnet "superclass" whose functions
  drivers may inherit.  Very simple drivers may set ifnet->if_ioctl
  = ifioctl_common.  More sophisticated drivers will set ifnet->if_ioctl
  = driver_ioctl.  driver_ioctl() will call ifioctl_common() to
  re-use the common code.
2008-01-22 16:25:15 +00:00
dyoung af289dd714 struct route is part of the kernel ABI (!!!), so move it back
outside of #ifdef _KERNEL.  #include stdbool.h if !_KERNEL.
2008-01-21 20:25:33 +00:00
dyoung 58eb3d1bbb Move struct route inside of #ifdef _KERNEL to protect userland from
it.
2008-01-21 20:04:37 +00:00
dyoung 14e6ca4ee4 In rtflushall(), do not clear a route cache by removing its rtentry
reference, but mark the cache 'invalid'.  Let the next user of the
route cache check to whether or not the cache is valid, and update
the rtentry reference if necessary.  In this way, avoid hairy
splnet()/splx() protection of route caches, which I never did trust.
2008-01-21 09:11:24 +00:00
dyoung ebc5b3612c Use C99 array initializers for bridge_control_table[]. 2008-01-19 23:17:47 +00:00
dyoung d338f6b0ba Add default handling of SIOCSIFMEDIA/SIOCGIFMEDIA. 2008-01-19 20:11:52 +00:00