Commit Graph

942 Commits

Author SHA1 Message Date
cbiere 5e6609fb28 Commented out IPv6 socket options which are no longer supported. 2006-10-31 00:29:30 +00:00
mrg 4804ddb2d7 what was <crypto/sha2/sha2.h> and <crypto/ripemd160/rmd160.h> is now
<sys/sha2.h> and <sys/rmd160.h>.
2006-10-27 22:50:28 +00:00
christos 31a62606ea Merge kernel and userland rmd160 and sha2 implementation.
XXX: We still install rmd160.h and sha2.h in /usr/include/crypto, unlike
the other hash functions which get installed in /usr/include for compatibility.
2006-10-27 21:20:48 +00:00
christos 95809f6403 use portable bitfields. 2006-10-17 14:52:21 +00:00
dyoung a42ff4b405 Make SIOCALIFADDR work for adding IPv6 addresses: initialize the
lifetime of the addresses to infinity (ND6_INFINITE_LIFETIME).

Nobody squealed when I proposed this on tech-net.
2006-10-15 07:00:44 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
dogcow 55ddfc9aae change the MOWNER_INIT define to take two args; fix extant struct mowner
decls to use it. Makes options MBUFTRACE compile again and not whinge about
missing structure declarations. (Also makes initialization consistent.)
2006-10-10 21:49:14 +00:00
tls 8cc016b4bc Protect calls to pool_put/pool_get that may occur in interrupt context
with spl used to protect other allocations and frees, or datastructure
element insertion and removal, in adjacent code.

It is almost unquestionably the case that some of the spl()/splx() calls
added here are superfluous, but it really seems wrong to see:

	s=splfoo();
	/* frob data structure */
	splx(s);
	pool_put(x);

and if we think we need to protect the first operation, then it is hard
to see why we should not think we need to protect the next.  "Better
safe than sorry".

It is also almost unquestionably the case that I missed some pool
gets/puts from interrupt context with my strategy for finding these
calls; use of PR_NOWAIT is a strong hint that a pool may be used from
interrupt context but many callers in the kernel pass a "can wait/can't
wait" flag down such that my searches might not have found them.  One
notable area that needs to be looked at is pf.

See also:

http://mail-index.netbsd.org/tech-kern/2006/07/19/0003.html
http://mail-index.netbsd.org/tech-kern/2006/07/19/0009.html
2006-10-05 17:35:19 +00:00
is ed48e2c326 Fix typo in comment 2006-09-26 11:55:41 +00:00
dyoung 71522fb484 Simplify and repair icmp6_input() to stop the kernel from panicking
in m_copydata() when an ICMP6_ECHO_REQUEST is received, as reported
by Tatoku Ogaito on current-users@.
2006-09-05 16:11:26 +00:00
christos d13620d51a comment out impossible comparison. 2006-09-03 05:16:59 +00:00
christos 7ca3c62d31 - fix initializers
- add const
- remove dead code
2006-09-02 07:22:44 +00:00
dyoung 19ce2e4680 Vastly simplify the code that copies an ICMP6 packet to two data
paths: ICMP6 reply path, and socket path.
2006-09-01 02:44:46 +00:00
dyoung cb88bdd489 Re-use macro IN6_IS_SCOPE_EMBEDDABLE(). 2006-09-01 02:25:29 +00:00
dyoung f583dae6cb Restore historical kernel behavior: let an application bind(2) an
IPv6 interface address (e.g., sin6_addr fe80::200:24ff:fec3:4bac
sin6_scope_id 1), set a multicast interface with
setsockopt(,IPPROTO_IPV6,IPV6_MULTICAST_IF,), and sendto(2) multicast
destinations with "wildcard" scope ID, 0, without error EHOSTUNREACH.

Prior to this patch, sendto(2) would exit with EHOSTUNREACH, even
though the scope ID was unambiguously specified both by bind(2)
and setsockopt(2).  This was a bug because it broke old applications.

Thanks JINMEI Tatuya for the patch!
2006-09-01 01:59:56 +00:00
christos e07cc888fc remove empty code. 2006-08-30 19:15:05 +00:00
christos e8c80b0ceb remove impossible comparisons. 2006-08-30 17:15:22 +00:00
christos ff89ad5027 fix initializers 2006-08-30 17:13:45 +00:00
christos 966c4b104a Fix initializers. 2006-08-30 17:11:53 +00:00
christos ca0d162d55 add missing initializers 2006-08-30 17:05:30 +00:00
christos 86fad06b76 declare the type of code. 2006-08-30 15:25:08 +00:00
christos d65306455b comment out comparison always false 2006-08-30 01:23:35 +00:00
christos ef6c9d757e fix incomplete initializer 2006-08-30 01:17:09 +00:00
christos 588c80f975 remove extra members 2006-08-28 02:51:12 +00:00
christos 8f1ca4d223 gc unused member. 2006-08-27 23:55:16 +00:00
matt 6c8fa3224e One step closer to loadable domains. Store pointers to a domain's soft
interrupt queues so if_detach can remove packets to removed interfaces from
them.  This eliminates a lot of conditional ugly code in if.c
2006-08-25 19:33:50 +00:00
matt 1b21337267 Don't include <netccitt/x25.> and don't bother checking for SIOCSIFCONF_X25. 2006-08-25 18:29:17 +00:00
christos 35ca6c8b5b Fix all the -D*DEBUG* code that it was rotting away and did not even compile.
Mostly from Arnaud Lacombe, many thanks!
2006-08-17 17:11:27 +00:00
ad f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
tron 9563ec16dc Add diagnostic checks for hardware-assisted checksum related flags in
the mbuf which supposed to get sent out:
- Complain in ip_output() if any of the IPv6 related flags are set.
- Complain in ip6_output() if any of the IPv4 related flags are set.
- Complain in both functions if the flags indicate that both a TCP and
  UCP checksum should be calculated by the hardware.
2006-07-12 13:11:27 +00:00
tron 8fe4e4040d Clear mbuf checksum flags before passing it to ip6_output(). We might
recycle a mbuf which contained a hardware provided checksum. This
fixes "traceroute6" to a machine which is using a wm(4) interface
that has UDP or TCP checksum offload enabled.
2006-07-11 22:13:56 +00:00
rpaulo 4e0b046439 Add a missing piece from RFC 3542. KAME-NetBSD-current branch
revision 1.1.1.2.2.5:
	do not call pfctlinput2(PRC_MSGSIZE) on fragmentation to avoid
	notification storm

From Keiichi SHIMA:
  "In the current NetBSD code, the PRC_MSGSIZE message will be generated
   for every fragmented packets when a node is trying to send a big
   packet. That was the intermediate behavior while RFC3542 was under
   discussion."

By (obviously) the KAME project.
2006-07-08 19:58:40 +00:00
liamjfoy 56054d1bbb Fix a minor printf found while reading the code 2006-06-29 16:56:31 +00:00
drochner 7d0c55ee34 fix the dad_count logic: if we send a packet successfully, reset the counter
for sent tries -- otherwise it gets confused if dad_count is set to >15
by the sysctl, and addresses get stuck in "tentative" state forever
2006-06-28 16:43:43 +00:00
kardel de4337ab21 merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
2006-06-07 22:33:33 +00:00
dogcow 5e988d30ba include <netccitt/x25.h> for the SIOCSIFCONF_X25 case in in6_control. 2006-06-03 06:56:43 +00:00
christos 26deb5021a Fix typo. 2006-06-03 01:43:47 +00:00
christos 7353ed65a9 add 2 more ioctls that use struct ifaddr *, and remove debugging printfs
I accidentally committed.
2006-06-03 01:32:52 +00:00
christos 404d15411e This is ugly, but it is the simplest fix to avoid calling in the default
case:

    <driver>_ioctl(ifp, SIOCSIFADDR, struct ifreq *)

where it should be calling:

    <driver>_ioctl(ifp, SIOCSIFADDR, struct ifaddr *)

and "Bad Things Happen (TM)"

Returning an error is good enough because none of the drivers handle INET6.

The problem here is that handling SIOCSIFADDR is a kludge. The ioctl gets
passed a struct ifreq * from userland, but then in the control routines
SIOCSIFADDR is handled "specially", and we call:

	ifp->if_ioctl(ifp, SIOCSIFADDR, struct ifaddr *)

directly with the ifaddr we computed for that interface. It would be nice
if we called the ioctl routine if the original struct ifreq, and computed
the ifaddr, or passed it directly. This way all the ioctls would be treated
the same way, and we would not have the problem of pointer overloading.
2006-06-03 01:04:29 +00:00
bouyer ad55d247de Make the mbuf writable before calling in6_clearscope(). Based on patch sent
by David Young on tech-kern.
2006-05-25 21:32:47 +00:00
rpaulo ff3f0e34cc In ip6_savecontrol(), ignore IPv4 packets.
From JINMEI Tatuya (KAME). Should fix PR 33269.
2006-05-23 14:20:56 +00:00
liamjfoy 4876c304b1 Integrate Common Address Redundancy Procotol (CARP) from OpenBSD
'pseudo-device	carp'

Thanks to: joerg@ christos@ riz@ and others who tested
Ok: core@
2006-05-18 09:05:49 +00:00
elad 874fef3711 integrate kauth. 2006-05-14 21:19:33 +00:00
christos 103d2f520c XXX: GCC uninitialized. 2006-05-14 05:30:31 +00:00
rpaulo 42a3b0025e Use C99 uintXX_t types so that applications don't need to include
sys/types.h directly (as in the past).
2006-05-07 23:41:17 +00:00
rpaulo c27ebb0e79 while (1) -> for (;;) 2006-05-07 16:02:40 +00:00
rpaulo de8db47547 Add support for RFC 3542 Adv. Socket API for IPv6 (which obsoletes 2292).
* RFC 3542 isn't binary compatible with RFC 2292.
* RFC 2292 support is on by default but can be disabled.
* update ping6, telnet and traceroute6 to the new API.

From the KAME project (www.kame.net).
Reviewed by core.
2006-05-05 00:03:21 +00:00
christos 55f3f4d6c8 Coverity CID 607: Remove bogus test. 2006-04-15 00:30:48 +00:00
christos 1eb02d66d2 Coverity CID 608: #ifdef out dead code. 2006-04-15 00:28:16 +00:00
christos f1a8105e4c Coverity CID 740: Change constant comparisons to MCLBYTES to KASSERT and remove
extraneous tests.
2006-04-15 00:24:12 +00:00