Commit Graph

1857 Commits

Author SHA1 Message Date
dyoung a8ad22e5d9 Don't cast to void * unnecessarily. 2008-05-22 01:06:39 +00:00
dyoung 518ccec3d5 bzero -> memset, bcopy -> memcpy. 2008-05-13 18:24:01 +00:00
dyoung 0f58320be0 Cosmetic: use __arraycount(). s/0/NULL/ where appropriate. Pass
"null" instead of 0 to printf %s.  Remove superfluous parentheses
in return statements.  Compare pointers with NULL instead of "testing
truth."
2008-05-13 17:51:26 +00:00
dyoung 62c140415f Cosmetic: compare sa_family with AF_UNSPEC instead of testing truth.
Join a line.  Compare sa_len with 0 instead of testing truth.
2008-05-11 20:17:59 +00:00
dyoung df0b11bb4e Use memset() instead of Bzero().
In arplookup1(), put the static sockaddr_inarp onto the stack, and
zero it before use.
2008-05-11 20:16:12 +00:00
taca fd376618e5 Make sure to clear csum_flags before forward the packet.
This change should be fix DIAGNOSTIC kernel's panic when the machine act
as multicast router.

Advised from tls@ and approved by thorpej@.
2008-05-08 08:00:55 +00:00
ad e071d39c84 - Convert hashinit() to use kmem_alloc(). The hash tables can be large
and it's better to not have them in kmem_map.
- Convert a couple of minor items along the way to kmem_alloc().
- Fix some memory leaks.
2008-05-05 17:11:16 +00:00
thorpej b129a80c20 Simplify the interface to netstat_sysctl() and allocate space for
the collated counters using kmem_alloc().

PR kern/38577
2008-05-04 07:22:14 +00:00
ad 2830fe3488 PR kern/38497 Out of memory allocating ksiginfo
Work around: don't acquire softnet_lock in protocol drain routines.
2008-05-02 13:40:32 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
yamt 4f47226d42 udp_init: don't forget to allocate udp6stat_percpu. 2008-04-26 08:13:59 +00:00
yamt 167fe02fc8 tcp_init: don't forget to allocate tcpstat_percpu. 2008-04-26 08:13:35 +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 caf49ea572 Make IPSEC and FAST_IPSEC stats per-cpu. Use <net/net_stats.h> and
netstat_sysctl().
2008-04-23 06:09:04 +00:00
thorpej 33326077b1 Use <net/net_stats.h> / netstat_sysctl(). 2008-04-23 05:26:50 +00:00
dyoung 71455e2d0d C99 does not allow u_int8_t bitfields, so use unsigned int, instead. 2008-04-16 20:58:35 +00:00
thorpej 83dd106948 Make IGMP stats per-cpu. 2008-04-15 16:02:03 +00:00
thorpej 881a947288 Make ARP stats per-cpu. 2008-04-15 15:17:54 +00:00
thorpej 1121526b25 Make CARP status per-cpu. 2008-04-15 06:03:28 +00:00
thorpej c2da059bc6 Make udp6 stats per-cpu. 2008-04-15 04:43:25 +00:00
thorpej 0dd41b37de Make ip6 and icmp6 stats per-cpu. 2008-04-15 03:57:04 +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 2527883e86 s/8/NBBY/ 2008-04-10 18:09:14 +00:00
thorpej 04e54b2ef5 - ipflow is not used outside ip_flow.c; move its definition there.
- Make ipflow_reap() private to ip_flow.c, and introduce ipflow_prune()
  for external callers to use (avoids returning an ipflow * that is never
  actually used anyway).
2008-04-09 05:14:20 +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 aa8724ff7b Change ICMP6 stats from a structure to an array of uint64_t's.
Note: This is ABI-compatible with the old icmp6stat structure; old netstat
binaries will continue to work properly.
2008-04-08 15:04:35 +00:00
thorpej f5c68c0b9f Change TCP stats from a structure to an array of uint64_t's.
Note: This is ABI-compatible with the old tcpstat structure; old netstat
binaries will continue to work properly.
2008-04-08 01:03:58 +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
thorpej 738aabaf82 Change UDP stats from a structure to an array of uint64_t's.
Note: This is ABI-compatible with the old icmpstat structure; old netstat
binaries will continue to work properly.
2008-04-06 20:17:27 +00:00
thorpej 67b7abb1ce Change ICMP stats from a structure to an array of uint64_t's.
Note: This is ABI-compatible with the old icmpstat structure; old netstat
binaries will continue to work properly.
2008-04-06 19:04:48 +00:00
cube 564b60af35 - Make sure we send a reasonable fragment size when IPSEC is configured.
Otherwise we end up sending a dubious "0" whenever we cannot find a
  proper association for the packet.
- Reset sack_newdata along with snd_nxt to avoid improper integer
  arithmetics that lead to sending data from an incorrect place in the
  stream, making it appear as corrupted.

Patch by Michael Van Elst, based on an analysis by Michael for the IPSEC
stuff and I for the SACK issue.
2008-03-27 00:18:56 +00:00
ws 8297b01db8 Set scope on IPv6 multicast address to give carp a chance to work for IPv6, too.
From FreeBSD.
2008-03-15 16:44:03 +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
matt a34217b8de Rework tcp congctl selection code so that the congctl entries can be const.
Don't access tcp_congctl stuff outside of tcp_congctl.c, use routines to
update t_congctl.  This code is slightly now more complicated.
2008-02-29 07:39:17 +00:00
matt a4a1e5ce55 Convert stragglers to ansi definitions from old-style definitons.
Remember that func() is not ansi, func(void) is.
2008-02-27 19:41:51 +00:00
yamt c3985cffec make TCP_SETUP_ACK, ICMP_CHECK, TCP_FIELDS_TO_HOST, and TCP_FIELDS_TO_NET
static functions.
2008-02-20 11:44:07 +00:00
joerg 862a285bde Explicitly predict panic conditions as false. 2008-02-12 13:05:55 +00:00
joerg 80b711a35e Reimplement in4_cksum to not copy data, but sum up directly.
Tested on sparc and m68k by martin@.
2008-02-07 22:45:20 +00:00
matt fb71901dbc Add a new ip_id generation scheme based on a Fisher-Yates shuffle over a
sliding window.  XXX replace use of arc4random RSN.
2008-02-06 03:20:50 +00:00
yamt f35baba8dd - start tcp timestamp from 1 instead of 0.
- add a comment to explain why:
+        * We start with 1, because 0 doesn't work with linux, which
+        * considers timestamp 0 in a SYN packet as a bug and disables
+        * timestamps.
2008-02-05 09:38:47 +00:00
yamt d5bac2f6b1 redo tcp_input.c rev.1.230 correctly.
revision 1.230
    date: 2005/06/30 02:58:28;  author: christos;  state: Exp;  lines: +20 -4
    Normalize our PAWS code with Free and Open, as mentioned in tech-security.

reviewed by christos@ and matt@.
2008-02-04 23:56:14 +00:00
yamt a944f4302a revert tcp_output.c 1.253 because it has an ill effect when sending
small (not full-sized) segments.
http://mail-index.NetBSD.org/tech-net/2008/01/27/0009.html
2008-01-29 12:34:47 +00:00
joerg 6e869e402d Refactor in_cksum/in4_cksum/in6_cksum implementations:
- All three functions are included in the kernel by default.
  They call a backend function cpu_in_cksum after possibly
  computing the checksum of the pseudo header.
- cpu_in_cksum is the core to implement the one-complement sum.
  The default implementation is moderate fast on most platforms
  and provides a 32bit accumulator with 16bit addends for L32 platforms
  and a 64bit accumulator with 32bit addends for L64 platforms.
  It handles edge cases like very large mbuf chains (could happen with
  native IPv6 in the future) and provides a good base for new native
  implementations.
- Modify i386 and amd64 assembly to use the new interface.

This disables the MD implementations on !x86 until the conversion is
done. For Alpha, the portable version is faster.
2008-01-25 21:12:10 +00:00
joerg 3615cf7715 Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
2008-01-20 18:09:03 +00:00
dyoung 2d4e7e5856 Use rtcache_validate() instead of rtcache_getrt(). Shorten staircase
in in_losing().
2008-01-14 04:19:09 +00:00
dyoung 1386ee4adf Good-bye, rtcache_check(). Call both rtcache_validate() and
rtcache_update(,1) instead of rtcache_check().
2008-01-12 02:58:58 +00:00
joerg 71c98bab0d When not compiling for the kernel, use stdio.h instead of sys/systm.h
(printf) and locally define the protoype. Makes it possible to use
in_cksum.c for regression testing.
2008-01-09 17:13:52 +00:00
joerg a7a33965fc Anyone seriously interested in implementing in_cksum on a new platform
should read RFC 1071, so point them to it.
2008-01-09 17:01:46 +00:00
dyoung f9c1ba02ee Constify a bit. 2008-01-04 23:28:07 +00:00
dyoung a4455600d4 Replace rtcache_down() with rtcache_validate() and update rtcache_down()
uses.
2008-01-04 23:26:44 +00:00