Commit Graph

934 Commits

Author SHA1 Message Date
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
christos
0cc667d207 Coverity CID 856: m cannot be NULL here. Remove bogus test. 2006-04-15 00:13:23 +00:00
christos
826c34719e Coverity CID 857: Prevent NULL deref. 2006-04-15 00:09:29 +00:00
dyoung
505b26e976 Add predicate IN6_IS_SCOPE_EMBEDDABLE(__a), which is true if and
only if the address __a is the type in which the IPv6 stack embeds
scope information.
2006-03-29 21:29:59 +00:00
rpaulo
1acb7de56f From KAME via SUZUKI Shinsuke:
fixed a memory leak when net.inet6.icmp6.nd6_maxqueuelen is
	greater than 1.
2006-03-24 19:24:38 +00:00
rpaulo
4532d44c4d RFC 4191 changed the meaning of the "Reserved" Router Preference
value. Previously the router should treat the recieved router
advertisement as having a 0 router lifetime. The RFC now says that the
router should treat the "Reserved" field the same way as if it was the
medium (default) preference.

From the KAME project via SUZUKI Shinsuke.
2006-03-20 12:13:05 +00:00
rpaulo
7122043ef9 0 > len ==> len < 0 2006-03-17 23:29:20 +00:00
rpaulo
86cd5b8af4 0 > len ==> len < 0 2006-03-17 23:26:06 +00:00
rpaulo
941ce91614 Rename local variables called delay that shadow the delay() decl.
Pointed out by Robert Swindells.
2006-03-06 20:33:52 +00:00