Commit Graph

914 Commits

Author SHA1 Message Date
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
rpaulo
8c2379fd97 NDP-related improvements:
RFC4191
	- supports host-side router-preference

	RFC3542
	- if DAD fails on a interface, disables IPv6 operation on the
          interface
	- don't advertise MLD report before DAD finishes

	Others
	- fixes integer overflow for valid and preferred lifetimes
	- improves timer granularity for MLD, using callout-timer.
	- reflects rtadvd's IPv6 host variable information into kernel
	  (router only)
	- adds a sysctl option to enable/disable pMTUd for multicast
          packets
	- performs NUD on PPP/GRE interface by default
	- Redirect works regardless of ip6_accept_rtadv
	- removes RFC1885-related code

From the KAME project via SUZUKI Shinsuke.
Reviewed by core.
2006-03-05 23:47:08 +00:00
rpaulo
0131d25777 bzero -> memset 2006-03-05 01:28:51 +00:00
rpaulo
eb35daf5b2 Fix typos in comments.
From: the KAME project via SUZUKI Shinsuke.
2006-03-03 14:07:06 +00:00
dyoung
8bc5b41214 In nd6_llinfo_timer, don't duplicate part of nd6_llinfo_settimer's
logic, and then call nd6_llinfo_settimer.   Instead, call
nd6_llinfo_settimer immediately.

This should cause no functional change.  I've been running this
patch for months.
2006-03-02 05:11:31 +00:00
wiz
5d1e8b2745 Fix some typos. 2006-02-25 02:28:55 +00:00
wiz
1ad8067cb3 Fix typos, reported by Alexey Dobriyan ("Gathered from Linux"),
forwarded by jmc@openbsd.
2006-02-25 00:58:34 +00:00
perry
fbae48b901 Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
2006-02-16 20:17:12 +00:00
rpaulo
1152ca51d5 From FreeBSD:
In ipcomp6_input(), check 'md' not 'm' after a call to m_pulldown(): 'm'
    may be a stale pointer at this point, and we're interested in whether or
    not m_pulldown() failed.

    Noticed by:     Coverity Prevent analysis tool
2006-02-14 21:43:02 +00:00
rpaulo
96aa0d0f54 Fix copy&paste problem found by James Juran
<James.Juran@baesystems.com> in freebsd-net mailing list.
bzero'ing the wrong var with a wrong sizeof is clearly not ok..
2006-02-08 13:35:48 +00:00
rpaulo
0c00fd29c5 PR 32653: mrt@notwork.org: remove 'sum += w[0]' left in previous revision. 2006-01-27 20:08:11 +00:00
rpaulo
035f84616e <netinet6/in6_pcb.h> is not needed. 2006-01-26 20:29:33 +00:00
rpaulo
7df4d41aef de-__P() 2006-01-26 18:59:18 +00:00
yamt
9178119484 ip6_input: don't embed scope id before running packet filters. 2006-01-23 23:01:40 +00:00
rpaulo
78678b130a Better support of IPv6 scoped addresses.
- most of the kernel code will not care about the actual encoding of
  scope zone IDs and won't touch "s6_addr16[1]" directly.
- similarly, most of the kernel code will not care about link-local
  scoped addresses as a special case.
- scope boundary check will be stricter.  For example, the current
  *BSD code allows a packet with src=::1 and dst=(some global IPv6
  address) to be sent outside of the node, if the application do:
    s = socket(AF_INET6);
    bind(s, "::1");
    sendto(s, some_global_IPv6_addr);
  This is clearly wrong, since ::1 is only meaningful within a single
  node, but the current implementation of the *BSD kernel cannot
  reject this attempt.
- and, while there, don't try to remove the ff02::/32 interface route
  entry in in6_ifdetach() as it's already gone.

This also includes some level of support for the standard source
address selection algorithm defined in RFC3484, which will be
completed on in the future.

From the KAME project via JINMEI Tatuya.
Approved by core@.
2006-01-21 00:15:35 +00:00
perry
0f0296d88a Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:45:08 +00:00
christos
7c77bfb8e4 Forward declarations for structs. 2005-12-20 19:32:58 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
elad
9702e98730 Multiple inclusion protection, as suggested by christos@ on tech-kern@
few days ago.
2005-12-10 23:31:41 +00:00
dsl
c24781af04 Pass the current process structure to in_pcbconnect() so that it can
pass it to in_pcbbind() so that can allocate a low numbered port
if setsockopt() has been used to set IP_PORTRANGE to IP_PORTRANGE_LOW.
While there, fail in_pcbconnect() if the in_pcbbind() fails - rather
than sending the request out from a port of zero.
This has been largely broken since the socket option was added in 1998.
2005-11-15 18:39:46 +00:00
bouyer
e148e671d8 mif6table is used by netstat, so don't declare it static. Fix netstat -g
on Xen, whose ELF loader doesn't load local symbols in the symbol table.
2005-10-21 18:00:45 +00:00