Commit Graph

1105 Commits

Author SHA1 Message Date
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
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
yamt
fb7535aecb udp6_init: fix a comment. 2008-04-28 15:01:39 +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
thorpej
0e499be12d Make pim6 stats per-cpu. 2008-04-15 05:40:15 +00:00
thorpej
27c227fe6e Explicitly include <sys/percpu.h>. 2008-04-15 05:23:33 +00:00
thorpej
16497cdf28 Make raw6 stats per-cpu. 2008-04-15 05:13:37 +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
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
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
xtraeme
cc926059e9 Make this build again after thorpej's changes to udpstat. 2008-04-06 23:36:43 +00:00
dyoung
4957795396 Use ip6_clearpktopts() to destroy the IPv6 PCB's in6p_outputopts,
so that there's no chance of either leaking memory, or leaving
dangling pointers to a route cache.
2008-03-20 20:32:00 +00:00
dyoung
ff82b311dd No code ever sets struct ip6_pktopts member ip6po_m, so get rid of
it.
2008-03-19 08:10:18 +00:00
yamt
b714b9dd42 in6_cksum: use IN6_IS_SCOPE_EMBEDDABLE. 2008-03-10 22:34:40 +00:00
yamt
15b5bc3e70 in6_cksum: avoid using -> operator and use (char *) arithmetics instead.
reviewed by Joerg Sonnenberger.  he pointed out that the original code
was written that way so that the compiler will explicitly not assume that
the alignment of the data is correct.  although i don't know if it really
matters or not, being safer is not a problem.
2008-03-10 22:29:13 +00:00
yamt
6ff0e4eec3 in6_cksum: constify 2008-03-09 22:05:50 +00:00
matt
58bb9f6508 Convert to ansi definitions from old-style definitons.
Remember that func() is not ansi, func(void) is.
2008-02-27 19:54:27 +00:00
matt
c939552209 Convert to ansi definitions from old-style definitons.
Remember that func() is not ansi, func(void) is.
2008-02-27 19:40:56 +00:00
joerg
862a285bde Explicitly predict panic conditions as false. 2008-02-12 13:05:55 +00:00
joerg
db0043926a Provide a simplified inplace version of in6_cksum.
Tested by is@ on amd64.
2008-02-12 13:02:24 +00:00
bjs
5fb9f423de ip_newid() -> ip_newid(NULL) due to Matt Thomas' commit some hours ago;
The function now requires a pointer (to struct in_ifaddr) as an argument,
i.e. it is no longer ip_newid(void).

Fixes ipsec+inet6 kernel builds.
2008-02-06 07:42:43 +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
dyoung
19dd9ed4a7 Use rtcache_validate() instead of rtcache_getrt(). Shorten staircase
in in6_losing().
2008-01-14 04:16:45 +00:00
dyoung
6a0b0c88d2 Use rtcache_lookup() instead of rtcache_lookup() + rtcache_getrt(). 2008-01-14 04:14:37 +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
dyoung
45485bd0b7 Save some rtcache_getrt() calls. 2008-01-10 08:06:11 +00:00
dyoung
1c6cf449e1 Constify. 2008-01-04 23:35:00 +00:00
dyoung
a4455600d4 Replace rtcache_down() with rtcache_validate() and update rtcache_down()
uses.
2008-01-04 23:26:44 +00:00
perry
b6a2ef7569 Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
2007-12-25 18:33:32 +00:00
dyoung
72fa642a86 Poison struct route->ro_rt uses in the kernel by changing the name
to _ro_rt.  Use rtcache_getrt() to access a route cache's struct
rtentry *.

Introduce struct ifnet->if_dl that always points at the interface
identifier/link-layer address.  Make code that treated the first
ifaddr on struct ifnet->if_addrlist as the interface address use
if_dl, instead.

Remove stale debugging code from net/route.c.  Move the rtflush()
code into rtcache_clear() and delete rtflush().  Delete rtalloc(),
because nothing uses it any more.

Make ND6_HINT an inline, lowercase subroutine, nd6_hint.

I've done my best to convert IP Filter, the ISO stack, and the
AppleTalk stack to rtcache_getrt().  They compile, but I have not
tested them.  I have given the changes to PF, GRE, IPv4 and IPv6
stacks a lot of exercise.
2007-12-20 19:53:29 +00:00
lukem
456279df8f use __KERNEL_RCSID() 2007-12-11 12:29:11 +00:00
degroote
939a0dbd0a Kill _IP_VHL ifdef (from netinet/ip.h history, it has never been used in NetBSD so ...) 2007-12-09 18:27:39 +00:00
dyoung
b579a81e92 Use ifa_insert(), ifa_remove(). 2007-12-06 00:28:36 +00:00
dyoung
b8f324fabd Extract common code, creating a subroutine if_purgeaddrs(ifp,
family, purgeaddr) which applies function `purgeaddr' to each
address on `ifp' belonging to `family'.
2007-12-05 23:47:17 +00:00
dyoung
b039c2dbef Use IFADDR_FIRST(), IFADDR_NEXT(). 2007-12-05 23:00:58 +00:00
dyoung
8e3ac3ec9f Use IFADDR_FOREACH(). 2007-12-05 01:17:16 +00:00
dyoung
5bbde3d775 Use IFNET_FOREACH() and IFADDR_FOREACH(). 2007-12-04 10:27:33 +00:00
christos
a9c710744b require that the options argument is the right size, not that it is greater
or equal to the requested size. Suggested by Matt Thomas.
2007-11-27 22:45:29 +00:00
yamt
5e36d79445 in6_pcbsetport: add missing htons. (fixes ephemeral port allocation.) 2007-11-26 08:12:33 +00:00
drochner
e3e9b75351 Fix in6_pcbrtentry() for the case of IPv6-mapped IPv4 addresses:
don't assume that the cached route is a sockaddr_in6, and do the
right comparisions so that no out-of-bounds memory is accessed.

btw, the use of "#ifdef INET" throughout the source doesn't look clean
to me: There are 2 cases -- whether AF_INET is usable by userland
programs, and whether IPv4 is supported as on-wire protocol.
2007-11-21 21:18:25 +00:00
dyoung
777dd06a99 We might leave nd6_ns_output() really early. Postpone memset()
until after we decide to stay.
2007-11-16 17:51:51 +00:00
dyoung
9044dcac49 Note danger of dangling pointers. 2007-11-16 17:50:07 +00:00
dyoung
c03a973fd0 KNF. Remove superfluous parentheses. In the switch-statement,
consolidate all of the 'error = EOPNOTSUPP;' cases.  No functional
change intended.
2007-11-14 22:58:27 +00:00
dyoung
5121052595 Use sockaddr_in6_init(). 2007-11-10 00:14:31 +00:00
dyoung
c44fbd164e Use sockaddr_in6_init(). Use a static initializer for all1_sa.
Constify a cast (may as well).  No functional change intended.
2007-11-10 00:07:57 +00:00