Commit Graph

116 Commits

Author SHA1 Message Date
darrenr fd7edad6c3 Change the use of pfil hooks. There is no longer a single list of all
pfil information, instead, struct protosw now contains a structure
which caontains list heads, etc.  The per-protosw pfil struct is passed
to pfil_hook_get(), along with an in/out flag to get the head of the
relevant filter list.  This has been done for only IPv4 and IPv6, at
present, with these patches only enabling filtering for IPPROTO_IP and
IPPROTO_IPV6, although it is possible to have tcp/udp, etc, dedicated
filters now also.  The ipfilter code has been updated to only filter
IPv4 packets - next major release of ipfilter is required for ipv6.
2000-02-17 10:59:32 +00:00
thorpej d2bccc29d8 Fix a couple of brainos in the last. 2000-02-15 00:31:08 +00:00
thorpej 144759ef2b Use ratecheck() for ICMP6 rate limiting. 2000-02-14 19:45:50 +00:00
itojun 19e9558eaf sync with extended scoped address syntax change. 2000-02-09 12:27:03 +00:00
itojun 53e333c935 honor ifa reference counting. 2000-02-09 03:34:01 +00:00
itojun 59d74f3d21 to improve RFC2553/2292 compliance, and promote use of
RFC2553/2292-compliant header file path, now the following headers are
forbidden:
	netinet6/ip6.h
	netinet6/icmp6.h
	netinet6/in6.h

if you want netinet6/{ip6,icmp6}.h, use netinet/{ip6,icmp6}.h.

if you want netinet6/in6.h, you just need to include netinet/in.h.
it pulls it in.
(we may need to integrate them into netinet/in.h, but for cross-BSD code
sharing i'd like to keep it like this for now)
2000-02-09 00:54:55 +00:00
itojun 2687887f38 s/DIAGNOSTIC/DEBUG/ 2000-02-07 06:15:16 +00:00
itojun 85cdd5f08e remove IPv6 router renumbering prefix information in the kernel
when all the interface addresses are gone.
this should remove dangling structure when:
# ifconfig lo0 inet6 3ffe::1 prefixlen 64 alias
# ifconfig lo0 inet6 3ffe::1 -alias
is performed.
2000-02-07 05:48:11 +00:00
itojun 1148e4715f correct SIOCAIFADDR_IN6 failure recovery in point-to-point case. 2000-02-07 05:42:59 +00:00
itojun 49bed394bd add more sanity check against mbuf length.
use log() for DAD related kernel message.
2000-02-07 05:42:28 +00:00
itojun 45b89333e4 close comment.
From: Kazuto Ushioda <x-y-z@3si.co.jp>
2000-02-07 03:51:59 +00:00
itojun 90736ab608 fix include pathname for better rfc2292 compliance. 2000-02-06 12:49:37 +00:00
itojun 51219dabc9 to be more rfc2292 complient, move ip6.h and icmp6.h into netinet.
(netinet6/{ip6,icmp6}.h is non-standard path - these files should go away)

it was not possible to use cvsmove in this case.
when you try to look at history, chase it toward netinet6/{ip6,icmp6}.h.
2000-02-06 11:11:29 +00:00
itojun 76064f5770 don't chase mbuf pointer when it is NULL. 2000-02-06 08:06:43 +00:00
itojun 9e9f3e15e4 need PRC_IF{UP,CHANGE}. 2000-02-05 18:11:41 +00:00
itojun 7604e315fb sync with reality.
- getipnodeby{name,addr} is now non-issue as RFC2553bis will be dropping it
- if_detach is mostly done
- add some items
2000-02-05 18:05:33 +00:00
itojun f91ee608a9 avoid calling in6_control(SIOCDIFADDR_IN6) from interrupt context.
it is not supposed to work.
logging fix: add "\n" to some of log() in in6_prefix.c.

improve in6_ifdetach().  now almost all structure depend on ifnet
will be cleared up.
possible loose ends:
- cached route_in6 in static varaiables needs to be cleared as well
- there are ifaddr manipulation without reference counting,
  which should be fixed
we still see panics after card removal, though...  not sure what is left.

(sync with kame)
2000-02-04 14:34:22 +00:00
itojun 10509171fb avoid some of typecasting from in6_ifaddr to ifaddr. 2000-02-04 08:54:04 +00:00
itojun ccba141601 add notice on site-locals. typo fix. (sync with kame) 2000-02-03 19:57:13 +00:00
itojun af14db5a91 - if_detach
- xx_control calls from interrupt thread should be removed
- LP64
2000-02-03 19:29:20 +00:00
itojun b89812ff7f - Don't reuse ip6 header portion as reassembly pointer, to be friendly
with LP64 arch.  (not tested on LP64, sorry)
- add comment on reass rule
- some other cleanups

NetBSD PR: 9340
From: iwamoto@sat.t.u-tokyo.ac.jp
(in sync with kame)
2000-02-03 18:13:01 +00:00
itojun 03993c84d3 use u_int16_t, not u_short, for port #. 2000-02-03 13:17:39 +00:00
itojun 54cb3be873 remove #if 0'ed code 2000-02-03 12:50:05 +00:00
itojun 8fdf90f0ff remove old #if 0'ed portion 2000-02-03 12:49:15 +00:00
itojun 323f8904e5 s/splnet/splsoftnet/ 2000-02-03 12:13:50 +00:00
thorpej c1185c1020 PRU_PURGEADDR -> PRU_PURGEIF, per a discussion w/ itojun. In the IPv4
and IPv6 code, also use this to traverse PCB tables, looking for cached
routes referencing the dying ifnet, forcing them to be refreshed.
2000-02-02 23:28:08 +00:00
itojun 8a6ced5516 make sure to nuke kludge entries, regardless from refcnt. 2000-02-02 17:54:07 +00:00
itojun f5fba17f1b implement in6_purgemkludge(). in6_ifdetach() calls it to avoid dangling
kludge entries.  the situation would occur if you take the following steps:
- join multicast groups (default ones like linklocal all-node is fine)
- remove all IPv6 addresses manually
- remove pcmcia card

to thorpej: pls call in6_ifdetach() when PRU_PURGEIF is raised (just before
removing ifnet).  it should do the right thing (unable to perform real test
though)
2000-02-02 16:58:10 +00:00
itojun 6f13dac00f remove route to link-local allnodes multicast address (ff02:/32),
when the last IPv6 address on an interface is get removed.
in6_ifattach() configures it and in6_ifdetach() removes it.

XXX last part of in6_purgeaddr looks very ugly, but there's no event for
"interface detach" (events are for "address detach").
2000-02-02 13:44:05 +00:00
thorpej d844a3ac41 First-draft if_detach() implementation, originally from Bill Studnemund,
although this version has been changed somewhat:
- reference counting on ifaddrs isn't as complete as Bill's original
  work was.  This is hard to get right, and we should attack one
  protocol at a time.
- This doesn't do reference counting or dynamic allocation of ifnets yet.
- This version introduces a new PRU -- PRU_PURGEADDR, which is used to
  purge an ifaddr from a protocol.  The old method Bill used didn't work
  on all protocols, and it only worked on some because it was Very Lucky.

This mostly works ... i.e. works for my USB Ethernet, except for a dangling
ifaddr reference left by the IPv6 code; have not yet tracked this down.
2000-02-01 22:52:04 +00:00
thorpej 33e8c5b1df Improve the readability of one small piece of code. 2000-02-01 00:18:29 +00:00
itojun ae788a8a43 sync with current code. now IMPLEMENTATION doc is almost identical
to the latest KAME one.
2000-02-01 00:15:22 +00:00
itojun 1a2a1e2b1f bring in latest KAME ipsec tree.
- interop issues in ipcomp is fixed
- padding type (after ESP) is configurable
- key database memory management (need more fixes)
- policy specification is revisited

XXX m->m_pkthdr.rcvif is still overloaded - hope to fix it soon
2000-01-31 14:18:52 +00:00
itojun 63fd2c0262 destination port == 0 is illegal based on RFC768.
(NetBSD PR: 9137 - I thought I committed this already but I wasn't)
2000-01-31 10:39:26 +00:00
itojun 9b7c3e737a be proactive about malicious packet on the wire. we fear that v4 mapped
address to be used as a tool to hose security filters (like bypassing
"local host only" filter by using ::ffff:127.0.0.1).
2000-01-31 10:33:22 +00:00
itojun 591ffe9e30 wrap "DAD start" message into #ifdef DIAGNOSTIC.
From: thorpej, "Soren S. Jorvang" <soren@wheel.dk>
2000-01-28 07:21:29 +00:00
itojun 49227347dc don't attach Adler32 checksum to ipcomp payload. 2000-01-26 17:08:41 +00:00
itojun cd5093498d make setsockopt(IPV6_PORTRANGE) work. obeys IPNOPRIVPORTS. 2000-01-26 17:06:36 +00:00
itojun 1061ba6b37 another possible PR9189 issue (panic on sparc). 2000-01-19 15:59:14 +00:00
itojun c521cdaa75 temporary workaround for PR9189 (panic on sparc). 2000-01-18 05:36:19 +00:00
itojun 08e76e0086 add missing ipcomp cases. 2000-01-16 18:06:03 +00:00
itojun 358b6d44ac fix interop issue in ip compression. for inbound, we need to use
default window size, in case the peer uses large window size
2000-01-16 17:56:46 +00:00
itohy d154d07506 Rename variable "prep" for PReP port. 2000-01-07 06:44:30 +00:00
itojun b1913eaa52 update tcp/udp v4 mapped addr issues. 2000-01-06 15:48:07 +00:00
itojun b3761abef8 remove extra portability #ifdef (like #ifdef __FreeBSD__) in KAME IPv6/IPsec
code, from netbsd-current repository.
#ifdef'ed version is always available from ftp.kame.net.

XXX please do not make too many diff-unfriendly changes, we'll need to take
bunch of diffs on upgrade...
2000-01-06 15:46:07 +00:00
itojun ec63b40402 remove too much portability code in KAME, to improve readability. 2000-01-06 07:31:07 +00:00
itojun 2e904aec57 make IPV6_BINDV6ONLY setsockopt available. it controls behavior of
AF_INET6 wildcard listening socket.  heavily documented in ip6(4).
net.inet6.ip6.bindv6only defines default value.  default is 1.

"options INET6_BINDV6ONLY" removes any code fragment that supports
IPV6_BINDV6ONLY == 0 case (not defopt'ed as use of this is rare).
2000-01-06 06:41:18 +00:00
itojun 2db2cab310 add missing net.inet6.ip6.rr_prune case. 2000-01-06 02:52:29 +00:00
itojun 751017ffff avoid panic on getsockopt(ICMPV6_FILTER). 2000-01-05 16:46:18 +00:00
itojun a60e59b349 better sync with reality. 2000-01-05 13:19:36 +00:00