The NetBSD Project

CVS log for src/sys/netinet6/ip6_output.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / netinet6

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.231.2.4: download - view: text, markup, annotated - select for diffs
Wed Sep 11 16:15:07 2024 UTC (2 months, 4 weeks ago) by martin
Branches: netbsd-10
Diff to: previous 1.231.2.3: preferred, colored; branchpoint 1.231: preferred, colored; next MAIN 1.232: preferred, colored
Changes since revision 1.231.2.3: +3 -3 lines
Pull up following revision(s) (requested by rin in ticket #826):

	sys/netinet6/ip6_output.c: revision 1.235

ip6_output: Initialize plen for ip6_hopopts_input.

This funny little block in ip6_process_hopopts assumes it is
initialized as and behaves differently depending on whether it's zero
or not:
https://nxr.netbsd.org/xref/src/sys/netinet6/ip6_input.c?r=1.227#976

In the other call site, it is initialized to ip6->ip6_plen:
https://nxr.netbsd.org/xref/src/sys/netinet6/ip6_input.c?r=1.227#561

Revision 1.231.2.3: download - view: text, markup, annotated - select for diffs
Sat Jul 20 14:34:24 2024 UTC (4 months, 3 weeks ago) by martin
Branches: netbsd-10
Diff to: previous 1.231.2.2: preferred, colored; branchpoint 1.231: preferred, colored
Changes since revision 1.231.2.2: +2 -4 lines
Pull up following revision(s) (requested by rin in ticket #740):

	sys/netipsec/ipsec_input.c: revision 1.79
	sys/netipsec/ipsec_output.c: revision 1.86
	sys/netipsec/ipsec.c: revision 1.178
	sys/netinet6/ip6_output.c: revision 1.232

ipsec: remove unnecessary splsoftnet

Because the code of IPsec itself is already MP-safe.

Revision 1.235: download - view: text, markup, annotated - select for diffs
Fri Apr 19 00:55:35 2024 UTC (7 months, 3 weeks ago) by riastradh
Branches: MAIN
CVS tags: perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs, HEAD
Diff to: previous 1.234: preferred, colored
Changes since revision 1.234: +3 -3 lines
ip6_output: Initialize plen for ip6_hopopts_input.

This funny little block in ip6_process_hopopts assumes it is
initialized as and behaves differently depending on whether it's zero
or not:

https://nxr.netbsd.org/xref/src/sys/netinet6/ip6_input.c?r=1.227#976

In the other call site, it is initialized to ip6->ip6_plen:

https://nxr.netbsd.org/xref/src/sys/netinet6/ip6_input.c?r=1.227#561

Reported-by: syzbot+587e3b707bdfe533283f@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?extid=587e3b707bdfe533283f

Revision 1.191.6.6: download - view: text, markup, annotated - select for diffs
Fri Aug 4 14:38:09 2023 UTC (16 months, 1 week ago) by martin
Branches: netbsd-8
CVS tags: netbsd-8-3-RELEASE
Diff to: previous 1.191.6.5: preferred, colored; branchpoint 1.191: preferred, colored; next MAIN 1.192: preferred, colored
Changes since revision 1.191.6.5: +8 -2 lines
Pull up following revision(s) (requested by ozaki-r in ticket #1884):

	sys/netinet6/in6.c: revision 1.289
	sys/netinet6/ip6_output.c: revision 1.234

in6: clear ND6_IFF_IFDISABLED to allow DAD again on link-up

in6: don't send any IPv6 packets over a disabled interface

Revision 1.220.2.2: download - view: text, markup, annotated - select for diffs
Fri Aug 4 14:29:44 2023 UTC (16 months, 1 week ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-4-RELEASE
Diff to: previous 1.220.2.1: preferred, colored; branchpoint 1.220: preferred, colored; next MAIN 1.221: preferred, colored
Changes since revision 1.220.2.1: +8 -2 lines
Pull up following revision(s) (requested by ozaki-r in ticket #1707):

	sys/netinet6/in6.c: revision 1.289
	sys/netinet6/ip6_output.c: revision 1.234

in6: clear ND6_IFF_IFDISABLED to allow DAD again on link-up

in6: don't send any IPv6 packets over a disabled interface

Revision 1.231.2.2: download - view: text, markup, annotated - select for diffs
Fri Aug 4 14:28:01 2023 UTC (16 months, 1 week ago) by martin
Branches: netbsd-10
CVS tags: netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1
Diff to: previous 1.231.2.1: preferred, colored; branchpoint 1.231: preferred, colored
Changes since revision 1.231.2.1: +8 -2 lines
Pull up following revision(s) (requested by ozaki-r in ticket #310):

	sys/netinet6/in6.c: revision 1.289
	sys/netinet6/ip6_output.c: revision 1.234

in6: clear ND6_IFF_IFDISABLED to allow DAD again on link-up

in6: don't send any IPv6 packets over a disabled interface

Revision 1.234: download - view: text, markup, annotated - select for diffs
Thu Aug 3 05:45:36 2023 UTC (16 months, 1 week ago) by ozaki-r
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation
Diff to: previous 1.233: preferred, colored
Changes since revision 1.233: +8 -2 lines
in6: don't send any IPv6 packets over a disabled interface

Revision 1.191.6.5: download - view: text, markup, annotated - select for diffs
Thu Mar 23 12:08:39 2023 UTC (20 months, 2 weeks ago) by martin
Branches: netbsd-8
Diff to: previous 1.191.6.4: preferred, colored; branchpoint 1.191: preferred, colored
Changes since revision 1.191.6.4: +8 -4 lines
Pull up following revision(s) (requested by ozaki-r in ticket #1808):

	sys/netinet6/raw_ip6.c: revision 1.183 (via patch)
	sys/netinet6/ip6_output.c: revision 1.233

in6: reject setting negative values but -1 via setsockopt(IPV6_CHECKSUM)
Same as OpenBSD.

in6: make sure a user-specified checksum field is within a packet
From OpenBSD

Revision 1.220.2.1: download - view: text, markup, annotated - select for diffs
Thu Mar 23 12:06:49 2023 UTC (20 months, 2 weeks ago) by martin
Branches: netbsd-9
Diff to: previous 1.220: preferred, colored
Changes since revision 1.220: +8 -4 lines
Pull up following revision(s) (requested by ozaki-r in ticket #1615):

	sys/netinet6/raw_ip6.c: revision 1.183 (via patch)
	sys/netinet6/ip6_output.c: revision 1.233

in6: reject setting negative values but -1 via setsockopt(IPV6_CHECKSUM)
Same as OpenBSD.

in6: make sure a user-specified checksum field is within a packet
From OpenBSD

Revision 1.231.2.1: download - view: text, markup, annotated - select for diffs
Thu Mar 23 12:03:04 2023 UTC (20 months, 2 weeks ago) by martin
Branches: netbsd-10
Diff to: previous 1.231: preferred, colored
Changes since revision 1.231: +8 -4 lines
Pull up following revision(s) (requested by ozaki-r in ticket #125):

	sys/netinet6/raw_ip6.c: revision 1.183
	sys/netinet6/ip6_output.c: revision 1.233

in6: reject setting negative values but -1 via setsockopt(IPV6_CHECKSUM)
Same as OpenBSD.

in6: make sure a user-specified checksum field is within a packet
From OpenBSD

Revision 1.233: download - view: text, markup, annotated - select for diffs
Mon Mar 20 09:15:52 2023 UTC (20 months, 3 weeks ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.232: preferred, colored
Changes since revision 1.232: +8 -4 lines
in6: reject setting negative values but -1 via setsockopt(IPV6_CHECKSUM)

Same as OpenBSD.

Revision 1.232: download - view: text, markup, annotated - select for diffs
Fri Jan 27 09:33:43 2023 UTC (22 months, 2 weeks ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.231: preferred, colored
Changes since revision 1.231: +2 -4 lines
ipsec: remove unnecessary splsoftnet

Because the code of IPsec itself is already MP-safe.

Revision 1.231: download - view: text, markup, annotated - select for diffs
Fri Oct 28 05:25:36 2022 UTC (2 years, 1 month ago) by ozaki-r
Branches: MAIN
CVS tags: netbsd-10-base
Branch point for: netbsd-10
Diff to: previous 1.230: preferred, colored
Changes since revision 1.230: +24 -24 lines
inpcb: separate inpcb again to reduce the size of PCB for IPv4

The data size of PCB for IPv4 increased because of the merge of
struct in6pcb.  The change decreases the size to the original size by
separating struct inpcb (again).  struct in4pcb and in6pcb that embed
struct inpcb are introduced.

Even after the separation, users don't need to realize the separation
and only have to use some macros to access dedicated data.  For example,
inp->inp_laddr is now accessed through in4p_laddr(inp).

Revision 1.230: download - view: text, markup, annotated - select for diffs
Fri Oct 28 05:18:39 2022 UTC (2 years, 1 month ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.229: preferred, colored
Changes since revision 1.229: +60 -61 lines
inpcb: integrate data structures of PCB into one

Data structures of network protocol control blocks (PCBs), i.e.,
struct inpcb, in6pcb and inpcb_hdr, are not organized well.  Users of
the data structures have to handle them separately and thus the code
is cluttered and duplicated.

The commit integrates the data structures into one, struct inpcb.  As a
result, users of PCBs only have to handle just one data structure, so
the code becomes simple.

One drawback is that the data size of PCB for IPv4 increases by 40 bytes
(from 248 bytes to 288 bytes).

Revision 1.229: download - view: text, markup, annotated - select for diffs
Tue Sep 21 15:07:43 2021 UTC (3 years, 2 months ago) by christos
Branches: MAIN
CVS tags: bouyer-sunxi-drm-base, bouyer-sunxi-drm
Diff to: previous 1.228: preferred, colored
Changes since revision 1.228: +16 -11 lines
don't opencode kauth_cred_get()

Revision 1.228: download - view: text, markup, annotated - select for diffs
Tue Aug 17 22:00:32 2021 UTC (3 years, 3 months ago) by andvar
Branches: MAIN
Diff to: previous 1.227: preferred, colored
Changes since revision 1.227: +3 -3 lines
fix multiplei repetitive typos in comments, messages and documentation. mainly because copy paste code big amount of files are affected.

Revision 1.226.2.1: download - view: text, markup, annotated - select for diffs
Sat Apr 3 22:29:02 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-futex
Diff to: previous 1.226: preferred, colored; next MAIN 1.227: preferred, colored
Changes since revision 1.226: +3 -3 lines
Sync with HEAD.

Revision 1.227: download - view: text, markup, annotated - select for diffs
Wed Mar 10 22:28:26 2021 UTC (3 years, 9 months ago) by christos
Branches: MAIN
CVS tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Diff to: previous 1.226: preferred, colored
Changes since revision 1.226: +3 -3 lines
byte-flipping a random number is not very useful.

Revision 1.226: download - view: text, markup, annotated - select for diffs
Tue Sep 8 14:12:57 2020 UTC (4 years, 3 months ago) by christos
Branches: MAIN
Branch point for: thorpej-futex
Diff to: previous 1.225: preferred, colored
Changes since revision 1.225: +18 -2 lines
Add IP_BINDANY, IPV6_BINDANY which can be used to bind to any address in
order to implement transparent proxies.

Revision 1.225: download - view: text, markup, annotated - select for diffs
Fri Aug 28 06:32:24 2020 UTC (4 years, 3 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.224: preferred, colored
Changes since revision 1.224: +22 -7 lines
inet6: reduce silent packet discards

Revision 1.224: download - view: text, markup, annotated - select for diffs
Fri Aug 28 06:19:13 2020 UTC (4 years, 3 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.223: preferred, colored
Changes since revision 1.223: +3 -2 lines
inet, inet6: count packets dropped by IPsec

The counters count packets dropped due to security policy checks.

Revision 1.223: download - view: text, markup, annotated - select for diffs
Fri Jun 12 11:04:45 2020 UTC (4 years, 6 months ago) by roy
Branches: MAIN
Diff to: previous 1.222: preferred, colored
Changes since revision 1.222: +7 -10 lines
Remove in-kernel handling of Router Advertisements

This is much better handled by a user-land tool.
Proposed on tech-net here:
https://mail-index.netbsd.org/tech-net/2020/04/22/msg007766.html

Note that the ioctl SIOCGIFINFO_IN6 no longer sets flags. That now
needs to be done using the pre-existing SIOCSIFINFO_FLAGS ioctl.

Compat is fully provided where it makes sense, but trying to turn on
RA handling will obviously throw an error as it no longer exists.

Note that if you use IPv6 temporary addresses, this now needs to be
turned on in dhcpcd.conf(5) rather than in sysctl.conf(5).

Revision 1.211.2.2: download - view: text, markup, annotated - select for diffs
Mon Apr 13 08:05:17 2020 UTC (4 years, 7 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.211.2.1: preferred, colored; branchpoint 1.211: preferred, colored; next MAIN 1.212: preferred, colored
Changes since revision 1.211.2.1: +4 -4 lines
Mostly merge changes from HEAD upto 20200411

Revision 1.222: download - view: text, markup, annotated - select for diffs
Wed Nov 13 02:51:22 2019 UTC (5 years ago) by ozaki-r
Branches: MAIN
CVS tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Diff to: previous 1.221: preferred, colored
Changes since revision 1.221: +3 -3 lines
Get rid of unnecessary NULL checks for rt_ifa and ifa_ifp

They are always non-NULL nowadays.

Revision 1.221: download - view: text, markup, annotated - select for diffs
Fri Nov 1 04:23:21 2019 UTC (5 years, 1 month ago) by knakahara
Branches: MAIN
Diff to: previous 1.220: preferred, colored
Changes since revision 1.220: +3 -3 lines
Fix ipsecif(4) IPV6_MINMTU does not work correctly.

Revision 1.211.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 10 22:09:48 2019 UTC (5 years, 6 months ago) by christos
Branches: phil-wifi
Diff to: previous 1.211: preferred, colored
Changes since revision 1.211: +26 -62 lines
Sync with HEAD

Revision 1.220: download - view: text, markup, annotated - select for diffs
Wed May 15 02:59:18 2019 UTC (5 years, 6 months ago) by ozaki-r
Branches: MAIN
CVS tags: phil-wifi-20190609, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Branch point for: netbsd-9
Diff to: previous 1.219: preferred, colored
Changes since revision 1.219: +2 -15 lines
Get rid of IFNET_LOCK for if_mcast_op to avoid a deadlock

The IFNET_LOCK was added to avoid data races on if_flags for IFF_ALLMULTI.
Unfortunatetly it caused a deadlock instead.  A known scenario causing a
deadlock is to occur the following two operations concurrently: (a) a removal of
an IP adddres assigned to an interface and (b) a manipulation of multicast
groups to the interface.  The resource dependency graph is like this:
  softnet_lock => IFNET_LOCK => psref_target_destroy => softint => softnet_lock

Thanks to the previous commit that avoids data races on if_flags for
IFF_ALLMULTI by another approach, we can remove IFNET_LOCK and defuse the
deadlock.

PR kern/54189

Revision 1.219: download - view: text, markup, annotated - select for diffs
Mon May 13 07:47:59 2019 UTC (5 years, 7 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.218: preferred, colored
Changes since revision 1.218: +6 -5 lines
Count packets dropped by pfil

Revision 1.218: download - view: text, markup, annotated - select for diffs
Wed Apr 3 19:23:38 2019 UTC (5 years, 8 months ago) by maxv
Branches: MAIN
CVS tags: isaki-audio2-base, isaki-audio2
Diff to: previous 1.217: preferred, colored
Changes since revision 1.217: +3 -3 lines
Fix small read overflow; harmless, because since I removed RH0, the memory
access on IPV6_RTHDR that would normally be illegal is not needed, and GCC
automatically removes it.

Revision 1.217: download - view: text, markup, annotated - select for diffs
Mon Feb 4 10:48:46 2019 UTC (5 years, 10 months ago) by mrg
Branches: MAIN
Diff to: previous 1.216: preferred, colored
Changes since revision 1.216: +8 -8 lines
rework the #ifdef IPSEC code to not use fallthru.
same number of lines with more local context.

Revision 1.203.2.6: download - view: text, markup, annotated - select for diffs
Wed Dec 26 14:02:05 2018 UTC (5 years, 11 months ago) by pgoyette
Branches: pgoyette-compat
CVS tags: pgoyette-compat-merge-20190127
Diff to: previous 1.203.2.5: preferred, colored; branchpoint 1.203: preferred, colored; next MAIN 1.204: preferred, colored
Changes since revision 1.203.2.5: +12 -9 lines
Sync with HEAD, resolve a few conflicts

Revision 1.216: download - view: text, markup, annotated - select for diffs
Sat Dec 22 14:28:57 2018 UTC (5 years, 11 months ago) by maxv
Branches: MAIN
CVS tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226
Diff to: previous 1.215: preferred, colored
Changes since revision 1.215: +3 -3 lines
Replace M_ALIGN and MH_ALIGN by m_align.

Revision 1.215: download - view: text, markup, annotated - select for diffs
Sat Dec 22 13:11:38 2018 UTC (5 years, 11 months ago) by maxv
Branches: MAIN
Diff to: previous 1.214: preferred, colored
Changes since revision 1.214: +3 -3 lines
Replace: M_MOVE_PKTHDR -> m_move_pkthdr. No functional change, since the
former is a macro to the latter.

Revision 1.214: download - view: text, markup, annotated - select for diffs
Wed Dec 12 01:53:52 2018 UTC (6 years ago) by rin
Branches: MAIN
Diff to: previous 1.213: preferred, colored
Changes since revision 1.213: +9 -7 lines
Simplify logic in ip{,6}_output().

Now, we have M_CSUM_TSOv[46] bit in ifp->if_csum_flags_tx when
TSO[46] is enabled for the interface. So we can simply check
whether TSO[46] is required in a packet but missing in the
interface by (sw_csum & M_CSUM_TSOv[46]).

Note that this is a very rare case where TSO[46] is suddenly
turned off during a packet passing b/w TCP and IP.

part of PR kern/53562
OK msaitoh

Revision 1.213: download - view: text, markup, annotated - select for diffs
Thu Nov 29 10:02:52 2018 UTC (6 years ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.212: preferred, colored
Changes since revision 1.212: +3 -2 lines
Don't validate the source address of forwarding IPv6 packets (same as IPv4)

Revision 1.203.2.5: download - view: text, markup, annotated - select for diffs
Thu Sep 6 06:56:45 2018 UTC (6 years, 3 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.203.2.4: preferred, colored; branchpoint 1.203: preferred, colored
Changes since revision 1.203.2.4: +5 -32 lines
Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

Revision 1.212: download - view: text, markup, annotated - select for diffs
Fri Aug 10 06:46:09 2018 UTC (6 years, 4 months ago) by maxv
Branches: MAIN
CVS tags: pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906
Diff to: previous 1.211: preferred, colored
Changes since revision 1.211: +5 -32 lines
Rename

	ip6_undefer_csum  -> in6_undefer_cksum
	in6_delayed_cksum -> in6_undefer_cksum_tcpudp

The two previous names were inconsistent and misleading.

Put the two functions into in6_offload.c. Add comments to explain what
we're doing.

Same as IPv4.

Revision 1.203.2.4: download - view: text, markup, annotated - select for diffs
Mon Jun 25 07:26:07 2018 UTC (6 years, 5 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.203.2.3: preferred, colored; branchpoint 1.203: preferred, colored
Changes since revision 1.203.2.3: +5 -28 lines
Sync with HEAD

Revision 1.211: download - view: text, markup, annotated - select for diffs
Fri Jun 1 08:56:00 2018 UTC (6 years, 6 months ago) by maxv
Branches: MAIN
CVS tags: phil-wifi-base, pgoyette-compat-0728, pgoyette-compat-0625
Branch point for: phil-wifi
Diff to: previous 1.210: preferred, colored
Changes since revision 1.210: +5 -5 lines
Rename

	M_CSUM_DATA_IPv6_HL -> M_CSUM_DATA_IPv6_IPHL
	M_CSUM_DATA_IPv6_HL_SET -> M_CSUM_DATA_IPv6_SET

Reduces the diff against IPv4. Also, clarify the definitions.

Revision 1.210: download - view: text, markup, annotated - select for diffs
Tue May 29 16:21:30 2018 UTC (6 years, 6 months ago) by maxv
Branches: MAIN
Diff to: previous 1.209: preferred, colored
Changes since revision 1.209: +2 -25 lines
Remove dead code, we don't care.

Revision 1.203.2.3: download - view: text, markup, annotated - select for diffs
Mon May 21 04:36:16 2018 UTC (6 years, 6 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.203.2.2: preferred, colored; branchpoint 1.203: preferred, colored
Changes since revision 1.203.2.2: +3 -3 lines
Sync with HEAD

Revision 1.209: download - view: text, markup, annotated - select for diffs
Wed May 9 06:35:10 2018 UTC (6 years, 7 months ago) by maxv
Branches: MAIN
CVS tags: pgoyette-compat-0521
Diff to: previous 1.208: preferred, colored
Changes since revision 1.208: +3 -3 lines
Replace
	m_copym(m, 0, M_COPYALL, M_DONTWAIT)
by
	m_copypacket(m, M_DONTWAIT)
when it is clear that we are copying a packet (that has M_PKTHDR) and not
a raw mbuf chain.

Revision 1.203.2.2: download - view: text, markup, annotated - select for diffs
Wed May 2 07:20:23 2018 UTC (6 years, 7 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.203.2.1: preferred, colored; branchpoint 1.203: preferred, colored
Changes since revision 1.203.2.1: +7 -39 lines
Synch with HEAD

Revision 1.208: download - view: text, markup, annotated - select for diffs
Tue May 1 07:21:39 2018 UTC (6 years, 7 months ago) by maxv
Branches: MAIN
CVS tags: pgoyette-compat-0502
Diff to: previous 1.207: preferred, colored
Changes since revision 1.207: +2 -5 lines
Remove now unused net_osdep.h includes, the other BSDs did the same.

Revision 1.207: download - view: text, markup, annotated - select for diffs
Sun Apr 29 11:51:08 2018 UTC (6 years, 7 months ago) by maxv
Branches: MAIN
Diff to: previous 1.206: preferred, colored
Changes since revision 1.206: +3 -3 lines
Remove unused and misleading argument from ipsec_set_policy.

Revision 1.206: download - view: text, markup, annotated - select for diffs
Thu Apr 26 19:50:09 2018 UTC (6 years, 7 months ago) by maxv
Branches: MAIN
Diff to: previous 1.205: preferred, colored
Changes since revision 1.205: +4 -4 lines
Stop using m_copy(), use m_copym() directly. m_copy is useless,
undocumented and confusing.

Revision 1.205: download - view: text, markup, annotated - select for diffs
Mon Apr 23 07:22:54 2018 UTC (6 years, 7 months ago) by maxv
Branches: MAIN
Diff to: previous 1.204: preferred, colored
Changes since revision 1.204: +4 -33 lines
Remove the kernel RH0 code. RH0 is deprecated by RFC5095, for security
reasons. RH0 was already removed in the kernel's input path, but some
parts were still present in the output path: they are now removed.

Sent on tech-net@ a few days ago.

Revision 1.203.2.1: download - view: text, markup, annotated - select for diffs
Sun Apr 22 07:20:28 2018 UTC (6 years, 7 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.203: preferred, colored
Changes since revision 1.203: +2 -3 lines
Sync with HEAD

Revision 1.204: download - view: text, markup, annotated - select for diffs
Wed Apr 18 07:17:49 2018 UTC (6 years, 7 months ago) by maxv
Branches: MAIN
CVS tags: pgoyette-compat-0422
Diff to: previous 1.203: preferred, colored
Changes since revision 1.203: +2 -3 lines
Remove unused netipsec/xform.h includes.

Revision 1.203: download - view: text, markup, annotated - select for diffs
Tue Feb 27 15:01:30 2018 UTC (6 years, 9 months ago) by maxv
Branches: MAIN
CVS tags: pgoyette-compat-base, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Diff to: previous 1.202: preferred, colored
Changes since revision 1.202: +3 -3 lines
Dedup: merge ipsec4_set_policy and ipsec6_set_policy. The content of the
original ipsec_set_policy function is inlined into the new one.

Revision 1.202: download - view: text, markup, annotated - select for diffs
Tue Feb 27 14:44:10 2018 UTC (6 years, 9 months ago) by maxv
Branches: MAIN
Diff to: previous 1.201: preferred, colored
Changes since revision 1.201: +3 -3 lines
Dedup: merge

	ipsec4_get_policy and ipsec6_get_policy
	ipsec4_delete_pcbpolicy and ipsec6_delete_pcbpolicy

The already-existing ipsec_get_policy() function is inlined in the new
one.

Revision 1.201: download - view: text, markup, annotated - select for diffs
Mon Feb 12 12:52:12 2018 UTC (6 years, 9 months ago) by maxv
Branches: MAIN
Diff to: previous 1.200: preferred, colored
Changes since revision 1.200: +8 -8 lines
Replace bcopy -> memcpy when it is obvious that the areas don't overlap.
Rearrange ip6_splithdr() for clarity.

Revision 1.200: download - view: text, markup, annotated - select for diffs
Wed Jan 31 15:23:08 2018 UTC (6 years, 10 months ago) by maxv
Branches: MAIN
Diff to: previous 1.199: preferred, colored
Changes since revision 1.199: +5 -3 lines
Correct the check; we want to find IPPROTO_HOPOPTS, not IPV6_HOPOPTS. This
just couldn't work.

By the way, I'm wondering what is the point of this block. Calling
ip6_hopopts_input() won't achieve anything useful, and it could actually
be a problem, because there are several paths in it that call icmp6_error,
which calls ip6_output, and then we're back in the same function. Besides
it is possible to reach icmp6_error with a packet we emitted (as opposed
to a packet we are forwarding), and in that case we are sending an ICMP
error back to ourselves.

Revision 1.199: download - view: text, markup, annotated - select for diffs
Wed Jan 31 14:16:28 2018 UTC (6 years, 10 months ago) by maxv
Branches: MAIN
Diff to: previous 1.198: preferred, colored
Changes since revision 1.198: +2 -3 lines
Remove a misleading instruction. We don't care about increasing
m_pkthdr.len in ip6_insertfraghdr(), it gets recomputed after calling
this function.

If we cared there would be a bug, since we don't increase it in the
other branches.

Revision 1.198: download - view: text, markup, annotated - select for diffs
Wed Jan 31 14:10:11 2018 UTC (6 years, 10 months ago) by maxv
Branches: MAIN
Diff to: previous 1.197: preferred, colored
Changes since revision 1.197: +15 -13 lines
Try to sound a little less pessimistic, there is nothing wrong here.

Revision 1.197: download - view: text, markup, annotated - select for diffs
Wed Jan 31 13:57:08 2018 UTC (6 years, 10 months ago) by maxv
Branches: MAIN
Diff to: previous 1.196: preferred, colored
Changes since revision 1.196: +88 -89 lines
Style, localify, constify, and reorder a bit. No real functional change.

Revision 1.191.6.4: download - view: text, markup, annotated - select for diffs
Tue Jan 2 10:20:34 2018 UTC (6 years, 11 months ago) by snj
Branches: netbsd-8
CVS tags: netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1
Diff to: previous 1.191.6.3: preferred, colored; branchpoint 1.191: preferred, colored
Changes since revision 1.191.6.3: +18 -3 lines
Pull up following revision(s) (requested by ozaki-r in ticket #456):
	sys/arch/arm/sunxi/sunxi_emac.c: 1.9
	sys/dev/ic/dwc_gmac.c: 1.43-1.44
	sys/dev/pci/if_iwm.c: 1.75
	sys/dev/pci/if_wm.c: 1.543
	sys/dev/pci/ixgbe/ixgbe.c: 1.112
	sys/dev/pci/ixgbe/ixv.c: 1.74
	sys/kern/sys_socket.c: 1.75
	sys/net/agr/if_agr.c: 1.43
	sys/net/bpf.c: 1.219
	sys/net/if.c: 1.397, 1.399, 1.401-1.403, 1.406-1.410, 1.412-1.416
	sys/net/if.h: 1.242-1.247, 1.250, 1.252-1.257
	sys/net/if_bridge.c: 1.140 via patch, 1.142-1.146
	sys/net/if_etherip.c: 1.40
	sys/net/if_ethersubr.c: 1.243, 1.246
	sys/net/if_faith.c: 1.57
	sys/net/if_gif.c: 1.132
	sys/net/if_l2tp.c: 1.15, 1.17
	sys/net/if_loop.c: 1.98-1.101
	sys/net/if_media.c: 1.35
	sys/net/if_pppoe.c: 1.131-1.132
	sys/net/if_spppsubr.c: 1.176-1.177
	sys/net/if_tun.c: 1.142
	sys/net/if_vlan.c: 1.107, 1.109, 1.114-1.121
	sys/net/npf/npf_ifaddr.c: 1.3
	sys/net/npf/npf_os.c: 1.8-1.9
	sys/net/rtsock.c: 1.230
	sys/netcan/if_canloop.c: 1.3-1.5
	sys/netinet/if_arp.c: 1.255
	sys/netinet/igmp.c: 1.65
	sys/netinet/in.c: 1.210-1.211
	sys/netinet/in_pcb.c: 1.180
	sys/netinet/ip_carp.c: 1.92, 1.94
	sys/netinet/ip_flow.c: 1.81
	sys/netinet/ip_input.c: 1.362
	sys/netinet/ip_mroute.c: 1.147
	sys/netinet/ip_output.c: 1.283, 1.285, 1.287
	sys/netinet6/frag6.c: 1.61
	sys/netinet6/in6.c: 1.251, 1.255
	sys/netinet6/in6_pcb.c: 1.162
	sys/netinet6/ip6_flow.c: 1.35
	sys/netinet6/ip6_input.c: 1.183
	sys/netinet6/ip6_output.c: 1.196
	sys/netinet6/mld6.c: 1.90
	sys/netinet6/nd6.c: 1.239-1.240
	sys/netinet6/nd6_nbr.c: 1.139
	sys/netinet6/nd6_rtr.c: 1.136
	sys/netipsec/ipsec_output.c: 1.65
	sys/rump/net/lib/libnetinet/netinet_component.c: 1.9-1.10
kmem_intr_free kmem_intr_[z]alloced memory
the underlying pools are the same but api-wise those should match
Unify IFEF_*_MPSAFE into IFEF_MPSAFE
There are already two flags for if_output and if_start, however, it seems such
MPSAFE flags are eventually needed for all if_XXX operations. Having discrete
flags for each operation is wasteful of if_extflags bits. So let's unify
the flags into one: IFEF_MPSAFE.
Fortunately IFEF_*_MPSAFE flags have never been included in any releases, so
we can change them without breaking backward compatibility of the releases
(though the kernel version of -current should be bumped).
Note that if an interface have both MP-safe and non-MP-safe operations at a
time, we have to set the IFEF_MPSAFE flag and let callees of non-MP-safe
opeartions take the kernel lock.
Proposed on tech-kern@ and tech-net@
Provide macros for softnet_lock and KERNEL_LOCK hiding NET_MPSAFE switch
It reduces C&P codes such as "#ifndef NET_MPSAFE KERNEL_LOCK(1, NULL); ..."
scattered all over the source code and makes it easy to identify remaining
KERNEL_LOCK and/or softnet_lock that are held even if NET_MPSAFE.
No functional change
Hold KERNEL_LOCK on if_ioctl selectively based on IFEF_MPSAFE
If IFEF_MPSAFE is set, hold the lock and otherwise don't hold.
This change requires additions of KERNEL_LOCK to subsequence functions from
if_ioctl such as ifmedia_ioctl and ifioctl_common to protect non-MP-safe
components.
Proposed on tech-kern@ and tech-net@
Ensure to hold if_ioctl_lock when calling if_flags_set
Fix locking against myself on ifpromisc
vlan_unconfig_locked could be called with holding if_ioctl_lock.
Ensure to not turn on IFF_RUNNING of an interface until its initialization completes
And ensure to turn off it before destruction as per IFF_RUNNING's description
"resource allocated". (The description is a bit doubtful though, I believe the
change is still proper.)
Ensure to hold if_ioctl_lock on if_up and if_down
One exception for if_down is if_detach; in the case the lock isn't needed
because it's guaranteed that no other one can access ifp at that point.
Make if_link_queue MP-safe if IFEF_MPSAFE
if_link_queue is a queue to store events of link state changes, which is
used to pass events from (typically) an interrupt handler to
if_link_state_change softint. The queue was protected by KERNEL_LOCK so far,
but if IFEF_MPSAFE is enabled, it becomes unsafe because (perhaps) an interrupt
handler of an interface with IFEF_MPSAFE doesn't take KERNEL_LOCK. Protect it
by a spin mutex.
Additionally with this change KERNEL_LOCK of if_link_state_change softint is
omitted if NET_MPSAFE is enabled.
Note that the spin mutex is now ifp->if_snd.ifq_lock as well as the case of
if_timer (see the comment).
Use IFADDR_WRITER_FOREACH instead of IFADDR_READER_FOREACH
At that point no other one modifies the list so IFADDR_READER_FOREACH
is unnecessary. Use of IFADDR_READER_FOREACH is harmless in general though,
if we try to detect contract violations of pserialize, using it violates
the contract. So avoid using it makes life easy.
Ensure to call if_addr_init with holding if_ioctl_lock
Get rid of outdated comments
Fix build of kernels without ether
By throwing out if_enable_vlan_mtu and if_disable_vlan_mtu that
created a unnecessary dependency from if.c to if_ethersubr.c.
PR kern/52790
Rename IFNET_LOCK to IFNET_GLOBAL_LOCK
IFNET_LOCK will be used in another lock, if_ioctl_lock (might be renamed then).
Wrap if_ioctl_lock with IFNET_* macros (NFC)
Also if_ioctl_lock perhaps needs to be renamed to something because it's now
not just for ioctl...
Reorder some destruction routines in if_detach
- Destroy if_ioctl_lock at the end of the if_detach because it's used in various
  destruction routines
- Move psref_target_destroy after pr_purgeif because we want to use psref in
  pr_purgeif (otherwise destruction procedures can be tricky)
Ensure to call if_mcast_op with holding IFNET_LOCK
Note that CARP doesn't deal with IFNET_LOCK yet.
Remove IFNET_GLOBAL_LOCK where it's unnecessary because IFNET_LOCK is held
Describe which lock is used to protect each member variable of struct ifnet
Requested by skrll@
Write a guideline for converting an interface to IFEF_MPSAFE
Requested by skrll@
Note that IFNET_LOCK must not be held in softint
Don't set IFEF_MPSAFE unless NET_MPSAFE at this point
Because recent investigations show that interfaces with IFEF_MPSAFE need to
follow additional restrictions to work with the flag safely. We should enable it
on an interface by default only if the interface surely satisfies the
restrictions, which are described in if.h.
Note that enabling IFEF_MPSAFE solely gains a few benefit on performance because
the network stack is still serialized by the big kernel locks by default.

Revision 1.196: download - view: text, markup, annotated - select for diffs
Fri Dec 15 04:03:46 2017 UTC (6 years, 11 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.195: preferred, colored
Changes since revision 1.195: +18 -3 lines
Ensure to call if_mcast_op with holding IFNET_LOCK

Note that CARP doesn't deal with IFNET_LOCK yet.

Revision 1.191.6.3: download - view: text, markup, annotated - select for diffs
Sun Dec 10 09:24:30 2017 UTC (7 years ago) by snj
Branches: netbsd-8
Diff to: previous 1.191.6.2: preferred, colored; branchpoint 1.191: preferred, colored
Changes since revision 1.191.6.2: +14 -8 lines
Pull up following revision(s) (requested by roy in ticket #390):
	sys/netinet/ip_input.c: 1.363
	sys/netinet6/ip6_input.c: 1.184-1.185
	sys/netinet6/ip6_output.c: 1.194-1.195
	sys/netinet6/in6_src.c: 1.83-1.84
Allow local communication over DETACHED addresses.
Allow binding to DETACHED or TENTATIVE addresses as we deny
sending upstream from them anyway.
Prefer non DETACHED or TENTATIVE addresses.
--
Attempt to restore v6 networking.   Not 100% certain that these
changes are all that is needed, but they're certainly a big part of it
(especially the ip6_input.c change.)
--
Treat unvalidated addresses as deprecated in rule 3.

Revision 1.150.2.4: download - view: text, markup, annotated - select for diffs
Sun Dec 3 11:39:04 2017 UTC (7 years ago) by jdolecek
Branches: tls-maxphys
Diff to: previous 1.150.2.3: preferred, colored; branchpoint 1.150: preferred, colored; next MAIN 1.151: preferred, colored
Changes since revision 1.150.2.3: +441 -184 lines
update from HEAD

Revision 1.195: download - view: text, markup, annotated - select for diffs
Sat Nov 25 13:18:02 2017 UTC (7 years ago) by kre
Branches: MAIN
CVS tags: tls-maxphys-base-20171202
Diff to: previous 1.194: preferred, colored
Changes since revision 1.194: +3 -3 lines

Attempt to restore v6 networking.   Not 100% certain that these
changes are all that is needed, but they're certainly a big part of it
(especially the ip6_input.c change.)

Revision 1.194: download - view: text, markup, annotated - select for diffs
Fri Nov 24 14:03:25 2017 UTC (7 years ago) by roy
Branches: MAIN
Diff to: previous 1.193: preferred, colored
Changes since revision 1.193: +14 -8 lines
Allow local communication over DETACHED addresses.
Allow binding to DETACHED or TENTATIVE addresses as we deny
sending upstream from them anyway.
Prefer non DETACHED or TENTATIVE addresses.

Revision 1.191.6.2: download - view: text, markup, annotated - select for diffs
Sat Oct 21 19:43:54 2017 UTC (7 years, 1 month ago) by snj
Branches: netbsd-8
CVS tags: matt-nb8-mediatek-base, matt-nb8-mediatek
Diff to: previous 1.191.6.1: preferred, colored; branchpoint 1.191: preferred, colored
Changes since revision 1.191.6.1: +3 -3 lines
Pull up following revision(s) (requested by ozaki-r in ticket #300):
	crypto/dist/ipsec-tools/src/setkey/parse.y: 1.19
	crypto/dist/ipsec-tools/src/setkey/token.l: 1.20
	distrib/sets/lists/tests/mi: 1.754, 1.757, 1.759
	doc/TODO.smpnet: 1.12-1.13
	sys/net/pfkeyv2.h: 1.32
	sys/net/raw_cb.c: 1.23-1.24, 1.28
	sys/net/raw_cb.h: 1.28
	sys/net/raw_usrreq.c: 1.57-1.58
	sys/net/rtsock.c: 1.228-1.229
	sys/netinet/in_proto.c: 1.125
	sys/netinet/ip_input.c: 1.359-1.361
	sys/netinet/tcp_input.c: 1.359-1.360
	sys/netinet/tcp_output.c: 1.197
	sys/netinet/tcp_var.h: 1.178
	sys/netinet6/icmp6.c: 1.213
	sys/netinet6/in6_proto.c: 1.119
	sys/netinet6/ip6_forward.c: 1.88
	sys/netinet6/ip6_input.c: 1.181-1.182
	sys/netinet6/ip6_output.c: 1.193
	sys/netinet6/ip6protosw.h: 1.26
	sys/netipsec/ipsec.c: 1.100-1.122
	sys/netipsec/ipsec.h: 1.51-1.61
	sys/netipsec/ipsec6.h: 1.18-1.20
	sys/netipsec/ipsec_input.c: 1.44-1.51
	sys/netipsec/ipsec_netbsd.c: 1.41-1.45
	sys/netipsec/ipsec_output.c: 1.49-1.64
	sys/netipsec/ipsec_private.h: 1.5
	sys/netipsec/key.c: 1.164-1.234
	sys/netipsec/key.h: 1.20-1.32
	sys/netipsec/key_debug.c: 1.18-1.21
	sys/netipsec/key_debug.h: 1.9
	sys/netipsec/keydb.h: 1.16-1.20
	sys/netipsec/keysock.c: 1.59-1.62
	sys/netipsec/keysock.h: 1.10
	sys/netipsec/xform.h: 1.9-1.12
	sys/netipsec/xform_ah.c: 1.55-1.74
	sys/netipsec/xform_esp.c: 1.56-1.72
	sys/netipsec/xform_ipcomp.c: 1.39-1.53
	sys/netipsec/xform_ipip.c: 1.50-1.54
	sys/netipsec/xform_tcp.c: 1.12-1.16
	sys/rump/librump/rumpkern/Makefile.rumpkern: 1.170
	sys/rump/librump/rumpnet/net_stub.c: 1.27
	sys/sys/protosw.h: 1.67-1.68
	tests/net/carp/t_basic.sh: 1.7
	tests/net/if_gif/t_gif.sh: 1.11
	tests/net/if_l2tp/t_l2tp.sh: 1.3
	tests/net/ipsec/Makefile: 1.7-1.9
	tests/net/ipsec/algorithms.sh: 1.5
	tests/net/ipsec/common.sh: 1.4-1.6
	tests/net/ipsec/t_ipsec_ah_keys.sh: 1.2
	tests/net/ipsec/t_ipsec_esp_keys.sh: 1.2
	tests/net/ipsec/t_ipsec_gif.sh: 1.6-1.7
	tests/net/ipsec/t_ipsec_l2tp.sh: 1.6-1.7
	tests/net/ipsec/t_ipsec_misc.sh: 1.8-1.18
	tests/net/ipsec/t_ipsec_sockopt.sh: 1.1-1.2
	tests/net/ipsec/t_ipsec_tcp.sh: 1.1-1.2
	tests/net/ipsec/t_ipsec_transport.sh: 1.5-1.6
	tests/net/ipsec/t_ipsec_tunnel.sh: 1.9
	tests/net/ipsec/t_ipsec_tunnel_ipcomp.sh: 1.1-1.2
	tests/net/ipsec/t_ipsec_tunnel_odd.sh: 1.3
	tests/net/mcast/t_mcast.sh: 1.6
	tests/net/net/t_ipaddress.sh: 1.11
	tests/net/net_common.sh: 1.20
	tests/net/npf/t_npf.sh: 1.3
	tests/net/route/t_flags.sh: 1.20
	tests/net/route/t_flags6.sh: 1.16
	usr.bin/netstat/fast_ipsec.c: 1.22
Do m_pullup before mtod

It may fix panicks of some tests on anita/sparc and anita/GuruPlug.
---
KNF
---
Enable DEBUG for babylon5
---
Apply C99-style struct initialization to xformsw
---
Tweak outputs of netstat -s for IPsec

- Get rid of "Fast"
- Use ipsec and ipsec6 for titles to clarify protocol
- Indent outputs of sub protocols

Original outputs were organized like this:

(Fast) IPsec:
IPsec ah:
IPsec esp:
IPsec ipip:
IPsec ipcomp:
(Fast) IPsec:
IPsec ah:
IPsec esp:
IPsec ipip:
IPsec ipcomp:

New outputs are organized like this:

ipsec:
	ah:
	esp:
	ipip:
	ipcomp:
ipsec6:
	ah:
	esp:
	ipip:
	ipcomp:
---
Add test cases for IPComp
---
Simplify IPSEC_OSTAT macro (NFC)
---
KNF; replace leading whitespaces with hard tabs
---
Introduce and use SADB_SASTATE_USABLE_P
---
KNF
---
Add update command for testing

Updating an SA (SADB_UPDATE) requires that a process issuing
SADB_UPDATE is the same as a process issued SADB_ADD (or SADB_GETSPI).
This means that update command must be used with add command in a
configuration of setkey. This usage is normally meaningless but
useful for testing (and debugging) purposes.
---
Add test cases for updating SA/SP

The tests require newly-added udpate command of setkey.
---
PR/52346: Frank Kardel: Fix checksumming for NAT-T
See XXX for improvements.
---
Remove codes for PACKET_TAG_IPSEC_IN_CRYPTO_DONE

It seems that PACKET_TAG_IPSEC_IN_CRYPTO_DONE is for network adapters
that have IPsec accelerators; a driver sets the mtag to a packet
when its device has already encrypted the packet.

Unfortunately no driver implements such offload features for long
years and seems unlikely to implement them soon. (Note that neither
FreeBSD nor Linux doesn't have such drivers.) Let's remove related
(unused) codes and simplify the IPsec code.
---
Fix usages of sadb_msg_errno
---
Avoid updating sav directly

On SADB_UPDATE a target sav was updated directly, which was unsafe.
Instead allocate another sav, copy variables of the old sav to
the new one and replace the old one with the new one.
---
Simplify; we can assume sav->tdb_xform cannot be NULL while it's valid
---
Rename key_alloc* functions (NFC)

We shouldn't use the term "alloc" for functions that just look up
data and actually don't allocate memory.
---
Use explicit_memset to surely zero-clear key_auth and key_enc
---
Make sure to clear keys on error paths of key_setsaval
---
Add missing KEY_FREESAV
---
Make sure a sav is inserted to a sah list after its initialization completes
---
Remove unnecessary zero-clearing codes from key_setsaval

key_setsaval is now used only for a newly-allocated sav. (It was
used to reset variables of an existing sav.)
---
Correct wrong assumption of sav->refcnt in key_delsah

A sav in a list is basically not to be sav->refcnt == 0. And also
KEY_FREESAV assumes sav->refcnt > 0.
---
Let key_getsavbyspi take a reference of a returning sav
---
Use time_mono_to_wall (NFC)
---
Separate sending message routine (NFC)
---
Simplify; remove unnecessary zero-clears

key_freesaval is used only when a target sav is being destroyed.
---
Omit NULL checks for sav->lft_c

sav->lft_c can be NULL only when initializing or destroying sav.
---
Omit unnecessary NULL checks for sav->sah
---
Omit unnecessary check of sav->state

key_allocsa_policy picks a sav of either MATURE or DYING so we
don't need to check its state again.
---
Simplify; omit unnecessary saidx passing

- ipsec_nextisr returns a saidx but no caller uses it
- key_checkrequest is passed a saidx but it can be gotton by
  another argument (isr)
---
Fix splx isn't called on some error paths
---
Fix header size calculation of esp where sav is NULL
---
Fix header size calculation of ah in the case sav is NULL

This fix was also needed for esp.
---
Pass sav directly to opencrypto callback

In a callback, use a passed sav as-is by default and look up a sav
only if the passed sav is dead.
---
Avoid examining freshness of sav on packet processing

If a sav list is sorted (by lft_c->sadb_lifetime_addtime) in advance,
we don't need to examine each sav and also don't need to delete one
on the fly and send up a message. Fortunately every sav lists are sorted
as we need.

Added key_validate_savlist validates that each sav list is surely sorted
(run only if DEBUG because it's not cheap).
---
Add test cases for SAs with different SPIs
---
Prepare to stop using isr->sav

isr is a shared resource and using isr->sav as a temporal storage
for each packet processing is racy. And also having a reference from
isr to sav makes the lifetime of sav non-deterministic; such a reference
is removed when a packet is processed and isr->sav is overwritten by
new one. Let's have a sav locally for each packet processing instead of
using shared isr->sav.

However this change doesn't stop using isr->sav yet because there are
some users of isr->sav. isr->sav will be removed after the users find
a way to not use isr->sav.
---
Fix wrong argument handling
---
fix printf format.
---
Don't validate sav lists of LARVAL or DEAD states

We don't sort the lists so the validation will always fail.

Fix PR kern/52405
---
Make sure to sort the list when changing the state by key_sa_chgstate
---
Rename key_allocsa_policy to key_lookup_sa_bysaidx
---
Separate test files
---
Calculate ah_max_authsize on initialization as well as esp_max_ivlen
---
Remove m_tag_find(PACKET_TAG_IPSEC_PENDING_TDB) because nobody sets the tag
---
Restore a comment removed in previous

The comment is valid for the below code.
---
Make tests more stable

sleep command seems to wait longer than expected on anita so
use polling to wait for a state change.
---
Add tests that explicitly delete SAs instead of waiting for expirations
---
Remove invalid M_AUTHIPDGM check on ESP isr->sav

M_AUTHIPDGM flag is set to a mbuf in ah_input_cb. An sav of ESP can
have AH authentication as sav->tdb_authalgxform. However, in that
case esp_input and esp_input_cb are used to do ESP decryption and
AH authentication and M_AUTHIPDGM never be set to a mbuf. So
checking M_AUTHIPDGM of a mbuf on isr->sav of ESP is meaningless.
---
Look up sav instead of relying on unstable sp->req->sav

This code is executed only in an error path so an additional lookup
doesn't matter.
---
Correct a comment
---
Don't release sav if calling crypto_dispatch again
---
Remove extra KEY_FREESAV from ipsec_process_done

It should be done by the caller.
---
Don't bother the case of crp->crp_buf == NULL in callbacks
---
Hold a reference to an SP during opencrypto processing

An SP has a list of isr (ipsecrequest) that represents a sequence
of IPsec encryption/authentication processing. One isr corresponds
to one opencrypto processing. The lifetime of an isr follows its SP.

We pass an isr to a callback function of opencrypto to continue
to a next encryption/authentication processing. However nobody
guaranteed that the isr wasn't freed, i.e., its SP wasn't destroyed.

In order to avoid such unexpected destruction of isr, hold a reference
to its SP during opencrypto processing.
---
Don't make SAs expired on tests that delete SAs explicitly
---
Fix a debug message
---
Dedup error paths (NFC)
---
Use pool to allocate tdb_crypto

For ESP and AH, we need to allocate an extra variable space in addition
to struct tdb_crypto. The fixed size of pool items may be larger than
an actual requisite size of a buffer, but still the performance
improvement by replacing malloc with pool wins.
---
Don't use unstable isr->sav for header size calculations

We may need to optimize to not look up sav here for users that
don't need to know an exact size of headers (e.g., TCP segmemt size
caclulation).
---
Don't use sp->req->sav when handling NAT-T ESP fragmentation

In order to do this we need to look up a sav however an additional
look-up degrades performance. A sav is later looked up in
ipsec4_process_packet so delay the fragmentation check until then
to avoid an extra look-up.
---
Don't use key_lookup_sp that depends on unstable sp->req->sav

It provided a fast look-up of SP. We will provide an alternative
method in the future (after basic MP-ification finishes).
---
Stop setting isr->sav on looking up sav in key_checkrequest
---
Remove ipsecrequest#sav
---
Stop setting mtag of PACKET_TAG_IPSEC_IN_DONE because there is no users anymore
---
Skip ipsec_spi_*_*_preferred_new_timeout when running on qemu

Probably due to PR 43997
---
Add localcount to rump kernels
---
Remove unused macro
---
Fix key_getcomb_setlifetime

The fix adjusts a soft limit to be 80% of a corresponding hard limit.

I'm not sure the fix is really correct though, at least the original
code is wrong. A passed comb is zero-cleared before calling
key_getcomb_setlifetime, so
  comb->sadb_comb_soft_addtime = comb->sadb_comb_soft_addtime * 80 / 100;
is meaningless.
---
Provide and apply key_sp_refcnt (NFC)

It simplifies further changes.
---
Fix indentation

Pointed out by knakahara@
---
Use pslist(9) for sptree
---
Don't acquire global locks for IPsec if NET_MPSAFE

Note that the change is just to make testing easy and IPsec isn't MP-safe yet.
---
Let PF_KEY socks hold their own lock instead of softnet_lock

Operations on SAD and SPD are executed via PF_KEY socks. The operations
include deletions of SAs and SPs that will use synchronization mechanisms
such as pserialize_perform to wait for references to SAs and SPs to be
released. It is known that using such mechanisms with holding softnet_lock
causes a dead lock. We should avoid the situation.
---
Make IPsec SPD MP-safe

We use localcount(9), not psref(9), to make the sptree and secpolicy (SP)
entries MP-safe because SPs need to be referenced over opencrypto
processing that executes a callback in a different context.

SPs on sockets aren't managed by the sptree and can be destroyed in softint.
localcount_drain cannot be used in softint so we delay the destruction of
such SPs to a thread context. To do so, a list to manage such SPs is added
(key_socksplist) and key_timehandler_spd deletes dead SPs in the list.

For more details please read the locking notes in key.c.

Proposed on tech-kern@ and tech-net@
---
Fix updating ipsec_used

- key_update_used wasn't called in key_api_spddelete2 and key_api_spdflush
- key_update_used wasn't called if an SP had been added/deleted but
  a reply to userland failed
---
Fix updating ipsec_used; turn on when SPs on sockets are added
---
Add missing IPsec policy checks to icmp6_rip6_input

icmp6_rip6_input is quite similar to rip6_input and the same checks exist
in rip6_input.
---
Add test cases for setsockopt(IP_IPSEC_POLICY)
---
Don't use KEY_NEWSP for dummy SP entries

By the change KEY_NEWSP is now not called from softint anymore
and we can use kmem_zalloc with KM_SLEEP for KEY_NEWSP.
---
Comment out unused functions
---
Add test cases that there are SPs but no relevant SAs
---
Don't allow sav->lft_c to be NULL

lft_c of an sav that was created by SADB_GETSPI could be NULL.
---
Clean up clunky eval strings

- Remove unnecessary \ at EOL
  - This allows to omit ; too
- Remove unnecessary quotes for arguments of atf_set
- Don't expand $DEBUG in eval
  - We expect it's expanded on execution

Suggested by kre@
---
Remove unnecessary KEY_FREESAV in an error path

sav should be freed (unreferenced) by the caller.
---
Use pslist(9) for sahtree
---
Use pslist(9) for sah->savtree
---
Rename local variable newsah to sah

It may not be new.
---
MP-ify SAD slightly

- Introduce key_sa_mtx and use it for some list operations
- Use pserialize for some list iterations
---
Introduce KEY_SA_UNREF and replace KEY_FREESAV with it where sav will never be actually freed in the future

KEY_SA_UNREF is still key_freesav so no functional change for now.

This change reduces diff of further changes.
---
Remove out-of-date log output

Pointed out by riastradh@
---
Use KDASSERT instead of KASSERT for mutex_ownable

Because mutex_ownable is too heavy to run in a fast path
even for DIAGNOSTIC + LOCKDEBUG.

Suggested by riastradh@
---
Assemble global lists and related locks into cache lines (NFCI)

Also rename variable names from *tree to *list because they are
just lists, not trees.

Suggested by riastradh@
---
Move locking notes
---
Update the locking notes

- Add locking order
- Add locking notes for misc lists such as reglist
- Mention pserialize, key_sp_ref and key_sp_unref on SP operations

Requested by riastradh@
---
Describe constraints of key_sp_ref and key_sp_unref

Requested by riastradh@
---
Hold key_sad.lock on SAVLIST_WRITER_INSERT_TAIL
---
Add __read_mostly to key_psz

Suggested by riastradh@
---
Tweak wording (pserialize critical section => pserialize read section)

Suggested by riastradh@
---
Add missing mutex_exit
---
Fix setkey -D -P outputs

The outputs were tweaked (by me), but I forgot updating libipsec
in my local ATF environment...
---
MP-ify SAD (key_sad.sahlist and sah entries)

localcount(9) is used to protect key_sad.sahlist and sah entries
as well as SPD (and will be used for SAD sav).

Please read the locking notes of SAD for more details.
---
Introduce key_sa_refcnt and replace sav->refcnt with it (NFC)
---
Destroy sav only in the loop for DEAD sav
---
Fix KASSERT(solocked(sb->sb_so)) failure in sbappendaddr that is called eventually from key_sendup_mbuf

If key_sendup_mbuf isn't passed a socket, the assertion fails.
Originally in this case sb->sb_so was softnet_lock and callers
held softnet_lock so the assertion was magically satisfied.
Now sb->sb_so is key_so_mtx and also softnet_lock isn't always
held by callers so the assertion can fail.

Fix it by holding key_so_mtx if key_sendup_mbuf isn't passed a socket.

Reported by knakahara@
Tested by knakahara@ and ozaki-r@
---
Fix locking notes of SAD
---
Fix deadlock between key_sendup_mbuf called from key_acquire and localcount_drain

If we call key_sendup_mbuf from key_acquire that is called on packet
processing, a deadlock can happen like this:
- At key_acquire, a reference to an SP (and an SA) is held
- key_sendup_mbuf will try to take key_so_mtx
- Some other thread may try to localcount_drain to the SP with
  holding key_so_mtx in say key_api_spdflush
- In this case localcount_drain never return because key_sendup_mbuf
  that has stuck on key_so_mtx never release a reference to the SP

Fix the deadlock by deferring key_sendup_mbuf to the timer
(key_timehandler).
---
Fix that prev isn't cleared on retry
---
Limit the number of mbufs queued for deferred key_sendup_mbuf

It's easy to be queued hundreds of mbufs on the list under heavy
network load.
---
MP-ify SAD (savlist)

localcount(9) is used to protect savlist of sah. The basic design is
similar to MP-ifications of SPD and SAD sahlist. Please read the
locking notes of SAD for more details.
---
Simplify ipsec_reinject_ipstack (NFC)
---
Add per-CPU rtcache to ipsec_reinject_ipstack

It reduces route lookups and also reduces rtcache lock contentions
when NET_MPSAFE is enabled.
---
Use pool_cache(9) instead of pool(9) for tdb_crypto objects

The change improves network throughput especially on multi-core systems.
---
Update

ipsec(4), opencrypto(9) and vlan(4) are now MP-safe.
---
Write known issues on scalability
---
Share a global dummy SP between PCBs

It's never be changed so it can be pre-allocated and shared safely between PCBs.
---
Fix race condition on the rawcb list shared by rtsock and keysock

keysock now protects itself by its own mutex, which means that
the rawcb list is protected by two different mutexes (keysock's one
and softnet_lock for rtsock), of course it's useless.

Fix the situation by having a discrete rawcb list for each.
---
Use a dedicated mutex for rt_rawcb instead of softnet_lock if NET_MPSAFE
---
fix localcount leak in sav. fixed by ozaki-r@n.o.

I commit on behalf of him.
---
remove unnecessary comment.
---
Fix deadlock between pserialize_perform and localcount_drain

A typical ussage of localcount_drain looks like this:

  mutex_enter(&mtx);
  item = remove_from_list();
  pserialize_perform(psz);
  localcount_drain(&item->localcount, &cv, &mtx);
  mutex_exit(&mtx);

This sequence can cause a deadlock which happens for example on the following
situation:

- Thread A calls localcount_drain which calls xc_broadcast after releasing
  a specified mutex
- Thread B enters the sequence and calls pserialize_perform with holding
  the mutex while pserialize_perform also calls xc_broadcast
- Thread C (xc_thread) that calls an xcall callback of localcount_drain tries
  to hold the mutex

xc_broadcast of thread B doesn't start until xc_broadcast of thread A
finishes, which is a feature of xcall(9). This means that pserialize_perform
never complete until xc_broadcast of thread A finishes. On the other hand,
thread C that is a callee of xc_broadcast of thread A sticks on the mutex.
Finally the threads block each other (A blocks B, B blocks C and C blocks A).

A possible fix is to serialize executions of the above sequence by another
mutex, but adding another mutex makes the code complex, so fix the deadlock
by another way; the fix is to release the mutex before pserialize_perform
and instead use a condvar to prevent pserialize_perform from being called
simultaneously.

Note that the deadlock has happened only if NET_MPSAFE is enabled.
---
Add missing ifdef NET_MPSAFE
---
Take softnet_lock on pr_input properly if NET_MPSAFE

Currently softnet_lock is taken unnecessarily in some cases, e.g.,
icmp_input and encap4_input from ip_input, or not taken even if needed,
e.g., udp_input and tcp_input from ipsec4_common_input_cb. Fix them.

NFC if NET_MPSAFE is disabled (default).
---
- sanitize key debugging so that we don't print extra newlines or unassociated
  debugging messages.
- remove unused functions and make internal ones static
- print information in one line per message
---
humanize printing of ip addresses
---
cast reduction, NFC.
---
Fix typo in comment
---
Pull out ipsec_fill_saidx_bymbuf (NFC)
---
Don't abuse key_checkrequest just for looking up sav

It does more than expected for example key_acquire.
---
Fix SP is broken on transport mode

isr->saidx was modified accidentally in ipsec_nextisr.

Reported by christos@
Helped investigations by christos@ and knakahara@
---
Constify isr at many places (NFC)
---
Include socketvar.h for softnet_lock
---
Fix buffer length for ipsec_logsastr

Revision 1.160.2.8: download - view: text, markup, annotated - select for diffs
Mon Aug 28 17:53:12 2017 UTC (7 years, 3 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.160.2.7: preferred, colored; branchpoint 1.160: preferred, colored; next MAIN 1.161: preferred, colored
Changes since revision 1.160.2.7: +82 -33 lines
Sync with HEAD

Revision 1.193: download - view: text, markup, annotated - select for diffs
Wed Aug 2 01:28:03 2017 UTC (7 years, 4 months ago) by ozaki-r
Branches: MAIN
CVS tags: nick-nhusb-base-20170825
Diff to: previous 1.192: preferred, colored
Changes since revision 1.192: +3 -3 lines
Make IPsec SPD MP-safe

We use localcount(9), not psref(9), to make the sptree and secpolicy (SP)
entries MP-safe because SPs need to be referenced over opencrypto
processing that executes a callback in a different context.

SPs on sockets aren't managed by the sptree and can be destroyed in softint.
localcount_drain cannot be used in softint so we delay the destruction of
such SPs to a thread context. To do so, a list to manage such SPs is added
(key_socksplist) and key_timehandler_spd deletes dead SPs in the list.

For more details please read the locking notes in key.c.

Proposed on tech-kern@ and tech-net@

Revision 1.191.6.1: download - view: text, markup, annotated - select for diffs
Sat Jul 1 08:51:04 2017 UTC (7 years, 5 months ago) by snj
Branches: netbsd-8
Diff to: previous 1.191: preferred, colored
Changes since revision 1.191: +4 -2 lines
Pull up following revision(s) (requested by ozaki-r in ticket #73):
	sys/netinet6/ip6_output.c: revision 1.192
Fix usage of ip6_get_membership
It may set nothing to ifp even if returning 0. So we need to NULL-clear
ifp before calling it.
Fix PR kern/52324

Revision 1.192: download - view: text, markup, annotated - select for diffs
Mon Jun 26 08:01:53 2017 UTC (7 years, 5 months ago) by ozaki-r
Branches: MAIN
CVS tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646
Diff to: previous 1.191: preferred, colored
Changes since revision 1.191: +4 -2 lines
Fix usage of ip6_get_membership

It may set nothing to ifp even if returning 0. So we need to NULL-clear
ifp before calling it.

Fix PR kern/52324

Revision 1.180.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 21 16:54:06 2017 UTC (7 years, 7 months ago) by bouyer
Branches: bouyer-socketcan
Diff to: previous 1.180: preferred, colored; next MAIN 1.181: preferred, colored
Changes since revision 1.180: +81 -33 lines
Sync with HEAD

Revision 1.171.2.4: download - view: text, markup, annotated - select for diffs
Mon Mar 20 06:57:51 2017 UTC (7 years, 8 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.171.2.3: preferred, colored; branchpoint 1.171: preferred, colored; next MAIN 1.172: preferred, colored
Changes since revision 1.171.2.3: +81 -34 lines
Sync with HEAD

Revision 1.191: download - view: text, markup, annotated - select for diffs
Fri Mar 3 07:13:06 2017 UTC (7 years, 9 months ago) by ozaki-r
Branches: MAIN
CVS tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, netbsd-8-base, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Branch point for: netbsd-8
Diff to: previous 1.190: preferred, colored
Changes since revision 1.190: +4 -4 lines
Pass inpcb/in6pcb instead of socket to ip_output/ip6_output

- Passing a socket to Layer 3 is layer violation and even unnecessary
- The change makes codes of callers and IPsec a bit simple

Revision 1.190: download - view: text, markup, annotated - select for diffs
Thu Mar 2 05:26:24 2017 UTC (7 years, 9 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.189: preferred, colored
Changes since revision 1.189: +4 -3 lines
Make sure im6o_memberships is protected by in6p's lock (solock)

Revision 1.189: download - view: text, markup, annotated - select for diffs
Thu Mar 2 05:24:23 2017 UTC (7 years, 9 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.188: preferred, colored
Changes since revision 1.188: +34 -16 lines
Make usages of ifp MP-safe in some functions of IP multicast

Revision 1.188: download - view: text, markup, annotated - select for diffs
Thu Mar 2 01:05:02 2017 UTC (7 years, 9 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.187: preferred, colored
Changes since revision 1.187: +8 -9 lines
Use LIST_* macros

No functional change.

Revision 1.187: download - view: text, markup, annotated - select for diffs
Wed Mar 1 08:54:12 2017 UTC (7 years, 9 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +5 -6 lines
Provide in6_multi_group

Use it when checking if we belong to the group, instead of in6_lookup_multi.

No functional change.

Revision 1.186: download - view: text, markup, annotated - select for diffs
Wed Feb 22 07:46:00 2017 UTC (7 years, 9 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.185: preferred, colored
Changes since revision 1.185: +3 -3 lines
Stop using useless IN6_*_MULTI macros

Revision 1.185: download - view: text, markup, annotated - select for diffs
Wed Feb 22 07:05:04 2017 UTC (7 years, 9 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.184: preferred, colored
Changes since revision 1.184: +7 -2 lines
Add assertions and comments for lock states of socket and pcb

Revision 1.184: download - view: text, markup, annotated - select for diffs
Fri Feb 17 03:57:17 2017 UTC (7 years, 9 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.183: preferred, colored
Changes since revision 1.183: +3 -3 lines
Rename if_acquire_NOMPSAFE to if_acquire

It can be used in MP-safe ways. So let's remove the confusing postfix.
If it's used in a unsafe way, warn NOMPSAFE in a comment.

Revision 1.183: download - view: text, markup, annotated - select for diffs
Tue Feb 14 03:05:06 2017 UTC (7 years, 9 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.182: preferred, colored
Changes since revision 1.182: +29 -4 lines
Do ND in L2_output in the same manner as arpresolve

The benefits of this change are:
- The flow is consistent with IPv4 (and FreeBSD and OpenBSD)
  - old: ip6_output => nd6_output (do ND if needed) => L2_output (lookup a stored cache)
  - new: ip6_output => L2_output (lookup a cache. Do ND if cache not found)
- We can remove some workarounds in nd6_output
- We can move L2 specific operations to their own place
- The performance slightly improves because one cache lookup is reduced

Revision 1.160.2.7: download - view: text, markup, annotated - select for diffs
Sun Feb 5 13:40:59 2017 UTC (7 years, 10 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.160.2.6: preferred, colored; branchpoint 1.160: preferred, colored
Changes since revision 1.160.2.6: +13 -6 lines
Sync with HEAD

Revision 1.182: download - view: text, markup, annotated - select for diffs
Mon Jan 16 15:44:47 2017 UTC (7 years, 10 months ago) by christos
Branches: MAIN
CVS tags: nick-nhusb-base-20170204
Diff to: previous 1.181: preferred, colored
Changes since revision 1.181: +3 -3 lines
ip6_sprintf -> IN6_PRINT so that we pass the size.

Revision 1.181: download - view: text, markup, annotated - select for diffs
Mon Jan 16 07:33:36 2017 UTC (7 years, 10 months ago) by ryo
Branches: MAIN
Diff to: previous 1.180: preferred, colored
Changes since revision 1.180: +4 -3 lines
Make ip6_sprintf(), in_fmtaddr(), lla_snprintf() and icmp6_redirect_diag() mpsafe.

Reviewed by ozaki-r@

Revision 1.180: download - view: text, markup, annotated - select for diffs
Wed Jan 11 13:08:29 2017 UTC (7 years, 11 months ago) by ozaki-r
Branches: MAIN
CVS tags: bouyer-socketcan-base
Branch point for: bouyer-socketcan
Diff to: previous 1.179: preferred, colored
Changes since revision 1.179: +2 -3 lines
Get rid of unnecessary header inclusions

Revision 1.171.2.3: download - view: text, markup, annotated - select for diffs
Sat Jan 7 08:56:51 2017 UTC (7 years, 11 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.171.2.2: preferred, colored; branchpoint 1.171: preferred, colored
Changes since revision 1.171.2.2: +112 -76 lines
Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.179: download - view: text, markup, annotated - select for diffs
Thu Dec 8 05:16:34 2016 UTC (8 years ago) by ozaki-r
Branches: MAIN
CVS tags: pgoyette-localcount-20170107
Diff to: previous 1.178: preferred, colored
Changes since revision 1.178: +11 -4 lines
Add rtcache_unref to release points of rtentry stemming from rtcache

In the MP-safe world, a rtentry stemming from a rtcache can be freed at any
points. So we need to protect rtentries somehow say by reference couting or
passive references. Regardless of the method, we need to call some release
function of a rtentry after using it.

The change adds a new function rtcache_unref to release a rtentry. At this
point, this function does nothing because for now we don't add a reference
to a rtentry when we get one from a rtcache. We will add something useful
in a further commit.

This change is a part of changes for MP-safe routing table. It is separated
to avoid one big change that makes difficult to debug by bisecting.

Revision 1.160.2.6: download - view: text, markup, annotated - select for diffs
Mon Dec 5 10:55:28 2016 UTC (8 years ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.160.2.5: preferred, colored; branchpoint 1.160: preferred, colored
Changes since revision 1.160.2.5: +104 -75 lines
Sync with HEAD

Revision 1.178: download - view: text, markup, annotated - select for diffs
Thu Nov 10 04:13:53 2016 UTC (8 years, 1 month ago) by ozaki-r
Branches: MAIN
CVS tags: nick-nhusb-base-20161204
Diff to: previous 1.177: preferred, colored
Changes since revision 1.177: +32 -20 lines
Tidy up in6_select*

This change tidies up in6_select* functions, especially
selectroute.

selectroute is annoying because:
- It returns both/either of a rtentry and/or an ifp
  - Yes, it may return only an ifp!
    - It is valid but selectroute shouldn't handle the case
  - Such conditional behavior makes it difficult
    to apply locking/psref thingy
- It may return a rtentry even if error
- It may use opt->ip6po_nextroute rtcache implicitly
  - The caller can know if it is used
    by rtcache_validate(&opt->ip6po_nextroute)
    but it's racy in MP-safe world
  - Even if it uses opt->ip6po_nextroute, it may
    return a rtentry that isn't derived from the rtcache

The change includes:
- Rename selectroute to in6_selectroute
  - Let a remaining caller of selectroute, in6_selectif,
    use in6_selectroute instead
- Let in6_selectroute return only an rtentry
  - If error, it doesn't return an rtentry
  - A caller gets an ifp from a returned rtentry
- Allow in6_selectroute to modify a passed rtcache
  and a caller can know if opt->ip6po_nextroute is
  used via the rtcache
- Let callers (ip6_output and in6_selectif) handle
  the case that only an ifp is required

Inspired by OpenBSD
Proposed on tech-kern and tech-net
LGTM by roy@

Revision 1.177: download - view: text, markup, annotated - select for diffs
Mon Nov 7 01:55:17 2016 UTC (8 years, 1 month ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.176: preferred, colored
Changes since revision 1.176: +45 -37 lines
Pull routing header handling out of ip6_output

No functional change.

Revision 1.176: download - view: text, markup, annotated - select for diffs
Mon Nov 7 01:05:39 2016 UTC (8 years, 1 month ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +32 -23 lines
Tidy up ip6_getpmtu

Pull rtcache thing out of ip6_getpmtu; that isn't an essential
of the function. Add comments inspired by FreeBSD.

No functional change.

Revision 1.171.2.2: download - view: text, markup, annotated - select for diffs
Fri Nov 4 14:49:21 2016 UTC (8 years, 1 month ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.171.2.1: preferred, colored; branchpoint 1.171: preferred, colored
Changes since revision 1.171.2.1: +58 -2 lines
Sync with HEAD

Revision 1.160.2.5: download - view: text, markup, annotated - select for diffs
Wed Oct 5 20:56:09 2016 UTC (8 years, 2 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.160.2.4: preferred, colored; branchpoint 1.160: preferred, colored
Changes since revision 1.160.2.4: +69 -5 lines
Sync with HEAD

Revision 1.175: download - view: text, markup, annotated - select for diffs
Tue Sep 20 14:30:13 2016 UTC (8 years, 2 months ago) by roy
Branches: MAIN
CVS tags: pgoyette-localcount-20161104, nick-nhusb-base-20161004
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +10 -7 lines
Drop UDP packets as well as TCP without error when sending from detached or
tentative addresses.

Revision 1.174: download - view: text, markup, annotated - select for diffs
Thu Sep 15 18:25:45 2016 UTC (8 years, 2 months ago) by roy
Branches: MAIN
Diff to: previous 1.173: preferred, colored
Changes since revision 1.173: +55 -2 lines
Ensure that packets are sent from a valid address.
If the packet is TCP and the address is detached or tentative then
it's just dropped, otherwise an error is returned.

This is needed because you can bind to a valid address and it can then
become invalid.

This satisfies RFC 4862 section 5.5.4.

Revision 1.171.2.1: download - view: text, markup, annotated - select for diffs
Sat Aug 6 00:19:10 2016 UTC (8 years, 4 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.171: preferred, colored
Changes since revision 1.171: +13 -5 lines
Sync with HEAD

Revision 1.173: download - view: text, markup, annotated - select for diffs
Mon Aug 1 03:15:31 2016 UTC (8 years, 4 months ago) by ozaki-r
Branches: MAIN
CVS tags: pgoyette-localcount-20160806, localcount-20160914
Diff to: previous 1.172: preferred, colored
Changes since revision 1.172: +10 -2 lines
Apply pserialize and psref to struct ifaddr and its variants

This change makes struct ifaddr and its variants (in_ifaddr and in6_ifaddr)
MP-safe by using pserialize and psref. At this moment, pserialize_perform
and psref_target_destroy are disabled because (1) we don't need them
because of softnet_lock (2) they cause a deadlock because of softnet_lock.
So we'll enable them when we remove softnet_lock in the future.

Revision 1.172: download - view: text, markup, annotated - select for diffs
Fri Jul 29 06:02:03 2016 UTC (8 years, 4 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.171: preferred, colored
Changes since revision 1.171: +5 -5 lines
Avoid memset and rtcache_free if unnecessary

It's the same as ip_output.

Revision 1.160.2.4: download - view: text, markup, annotated - select for diffs
Sat Jul 9 20:25:22 2016 UTC (8 years, 5 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.160.2.3: preferred, colored; branchpoint 1.160: preferred, colored
Changes since revision 1.160.2.3: +29 -16 lines
Sync with HEAD

Revision 1.171: download - view: text, markup, annotated - select for diffs
Mon Jun 27 18:35:54 2016 UTC (8 years, 5 months ago) by christos
Branches: MAIN
CVS tags: pgoyette-localcount-base, pgoyette-localcount-20160726, nick-nhusb-base-20160907
Branch point for: pgoyette-localcount
Diff to: previous 1.170: preferred, colored
Changes since revision 1.170: +3 -4 lines
CID 1362905: Initialize ifp early, so that we don't if_put garbage in the
IPSEC case.

Revision 1.170: download - view: text, markup, annotated - select for diffs
Tue Jun 21 10:25:27 2016 UTC (8 years, 5 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.169: preferred, colored
Changes since revision 1.169: +16 -6 lines
Make sure returning ifp from in6_select* functions psref-ed

To this end, callers need to pass struct psref to the functions
and the fuctions acquire a reference of ifp with it. In some cases,
we can simply use if_get_byindex, however, in other cases
(say rt->rt_ifp and ia->ifa_ifp), we have no MP-safe way for now.
In order to take a reference anyway we use non MP-safe function
if_acquire_NOMPSAFE for the latter cases. They should be fixed in
the future somehow.

Revision 1.169: download - view: text, markup, annotated - select for diffs
Tue Jun 21 10:21:04 2016 UTC (8 years, 5 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.168: preferred, colored
Changes since revision 1.168: +9 -5 lines
Protect if_byindex with pserialize

Revision 1.168: download - view: text, markup, annotated - select for diffs
Tue Jun 21 03:28:27 2016 UTC (8 years, 5 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.167: preferred, colored
Changes since revision 1.167: +7 -7 lines
Replace ifp of ip_moptions and ip6_moptions with if_index

The motivation is the same as the mbuf's rcvif case; avoid having a pointer
of an ifnet object in ip_moptions and ip6_moptions, which is not MP-safe.

ip_moptions and ip6_moptions can be stored in a PCB for inet or inet6
that's life time is different from ifnet one and so an ifnet object can be
disappeared anytime we get it via them. Thus we need to look up an ifnet
object by if_index every time for safe.

Revision 1.167: download - view: text, markup, annotated - select for diffs
Fri Jun 10 13:27:16 2016 UTC (8 years, 6 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.166: preferred, colored
Changes since revision 1.166: +4 -4 lines
Introduce m_set_rcvif and m_reset_rcvif

The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.

Revision 1.160.2.3: download - view: text, markup, annotated - select for diffs
Tue Sep 22 12:06:11 2015 UTC (9 years, 2 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.160.2.2: preferred, colored; branchpoint 1.160: preferred, colored
Changes since revision 1.160.2.2: +4 -2 lines
Sync with HEAD

Revision 1.166: download - view: text, markup, annotated - select for diffs
Mon Aug 24 22:21:27 2015 UTC (9 years, 3 months ago) by pooka
Branches: MAIN
CVS tags: nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921
Diff to: previous 1.165: preferred, colored
Changes since revision 1.165: +4 -2 lines
sprinkle _KERNEL_OPT

Revision 1.160.2.2: download - view: text, markup, annotated - select for diffs
Sat Jun 6 14:40:26 2015 UTC (9 years, 6 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.160.2.1: preferred, colored; branchpoint 1.160: preferred, colored
Changes since revision 1.160.2.1: +16 -15 lines
Sync with HEAD

Revision 1.165: download - view: text, markup, annotated - select for diffs
Mon Apr 27 10:14:44 2015 UTC (9 years, 7 months ago) by ozaki-r
Branches: MAIN
CVS tags: nick-nhusb-base-20150606
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +5 -3 lines
Add missing error checks on rtcache_setdst

It can fail with ENOMEM.

Revision 1.164: download - view: text, markup, annotated - select for diffs
Fri Apr 24 08:53:06 2015 UTC (9 years, 7 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +5 -6 lines
Avoid NULL checks for a variable that is definitely NULL

Revision 1.160.2.1: download - view: text, markup, annotated - select for diffs
Mon Apr 6 15:18:23 2015 UTC (9 years, 8 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +35 -2 lines
Sync with HEAD

Revision 1.157.2.3: download - view: text, markup, annotated - select for diffs
Sat Feb 14 07:14:23 2015 UTC (9 years, 9 months ago) by snj
Branches: netbsd-7
CVS tags: netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0
Diff to: previous 1.157.2.2: preferred, colored; branchpoint 1.157: preferred, colored; next MAIN 1.158: preferred, colored
Changes since revision 1.157.2.2: +3 -2 lines
Pull up following revision(s) (requested by roy in ticket #509):
	sys/netinet6/ip6_output.c: revision 1.163
CID/1267860: Missing break in switch

Revision 1.163: download - view: text, markup, annotated - select for diffs
Mon Feb 2 03:14:02 2015 UTC (9 years, 10 months ago) by christos
Branches: MAIN
CVS tags: nick-nhusb-base-20150406
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +3 -2 lines
CID/1267860: Missing break in switch

Revision 1.157.2.2: download - view: text, markup, annotated - select for diffs
Fri Jan 23 09:27:15 2015 UTC (9 years, 10 months ago) by martin
Branches: netbsd-7
Diff to: previous 1.157.2.1: preferred, colored; branchpoint 1.157: preferred, colored
Changes since revision 1.157.2.1: +33 -2 lines
Pull up following revision(s) (requested by pettai in ticket #441):
	sys/netinet6/ip6_var.h: revision 1.64
	sys/netinet6/in6.h: revision 1.82
	sys/netinet6/in6_src.c: revision 1.56
	sys/netinet6/mld6.c: revision 1.62
	sys/netinet6/ip6_input.c: revision 1.150
	sys/netinet6/ip6_output.c: revision 1.161
Add net.inet6.ip6.prefer_tempaddr sysctl knob so that we can prefer
IPv6 temporary addresses as the source address.
Fixes PR kern/47100 based on a patch by Dieter Roelants.

Revision 1.162: download - view: text, markup, annotated - select for diffs
Tue Jan 20 21:42:36 2015 UTC (9 years, 10 months ago) by roy
Branches: MAIN
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +3 -2 lines
Fix IPV6_USE_MIN_MTU set by setsockopt(2) being ignored when
IPV6_PKTINFO is set as a control with sendmsg(2).

Revision 1.161: download - view: text, markup, annotated - select for diffs
Tue Jan 20 21:27:36 2015 UTC (9 years, 10 months ago) by roy
Branches: MAIN
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +33 -2 lines
Add net.inet6.ip6.prefer_tempaddr sysctl knob so that we can prefer
IPv6 temporary addresses as the source address.

Fixes PR kern/47100 based on a patch by Dieter Roelants.

Revision 1.160: download - view: text, markup, annotated - select for diffs
Sun Oct 12 19:00:21 2014 UTC (10 years, 2 months ago) by christos
Branches: MAIN
CVS tags: nick-nhusb-base
Branch point for: nick-nhusb
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +96 -69 lines
Refactor the multicast membership code so that we can handle v4 mapped
addresses using the v6 membership ioctls.

Revision 1.159: download - view: text, markup, annotated - select for diffs
Sat Oct 11 20:53:16 2014 UTC (10 years, 2 months ago) by christos
Branches: MAIN
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +27 -3 lines
Make IPV4 mapped addresses able to do IPV4 multicast. Fixes needed:

	- allow binding to mapped v4 multicast addresses
	- define v4moptions, allow setting it via ioctl, pass it to ip_output,
	  free it when killing the pcb.

Ideally we would allow the IPV6 multicast setsockopts work on mapped addresses
too, but this is a lot more work and linux does not do it either.

Revision 1.135.2.1.10.1: download - view: text, markup, annotated - select for diffs
Wed Aug 27 17:06:10 2014 UTC (10 years, 3 months ago) by msaitoh
Branches: netbsd-5-2
CVS tags: netbsd-5-2-3-RELEASE
Diff to: previous 1.135.2.1: preferred, colored; next MAIN 1.135.2.2: preferred, colored
Changes since revision 1.135.2.1: +4 -2 lines
Pull up following revision(s) (requested by maxv in ticket #1920):
	sys/netinet6/ip6_output.c			1.158 via patch

Fix a memory leak in calling setsockopt() on an INET6 socket.

Revision 1.135.2.1.6.1: download - view: text, markup, annotated - select for diffs
Wed Aug 27 17:05:25 2014 UTC (10 years, 3 months ago) by msaitoh
Branches: netbsd-5-1
CVS tags: netbsd-5-1-5-RELEASE
Diff to: previous 1.135.2.1: preferred, colored; next MAIN 1.135.2.2: preferred, colored
Changes since revision 1.135.2.1: +4 -2 lines
Pull up following revision(s) (requested by maxv in ticket #1920):
	sys/netinet6/ip6_output.c			1.158 via patch

Fix a memory leak in calling setsockopt() on an INET6 socket.

Revision 1.145.6.1: download - view: text, markup, annotated - select for diffs
Wed Aug 27 14:45:59 2014 UTC (10 years, 3 months ago) by msaitoh
Branches: netbsd-6-0
CVS tags: netbsd-6-0-6-RELEASE
Diff to: previous 1.145: preferred, colored; next MAIN 1.146: preferred, colored
Changes since revision 1.145: +4 -2 lines
Pull up following revision(s) (requested by maxv in ticket #1114):
	sys/netinet6/ip6_output.c			1.158 via patch

Fix a memory leak in calling setsockopt() on an INET6 socket.

Revision 1.145.8.1: download - view: text, markup, annotated - select for diffs
Wed Aug 27 14:45:11 2014 UTC (10 years, 3 months ago) by msaitoh
Branches: netbsd-6-1
CVS tags: netbsd-6-1-5-RELEASE
Diff to: previous 1.145: preferred, colored; next MAIN 1.146: preferred, colored
Changes since revision 1.145: +4 -2 lines
Pull up following revision(s) (requested by maxv in ticket #1114):
	sys/netinet6/ip6_output.c			1.158 via patch

Fix a memory leak in calling setsockopt() on an INET6 socket.

Revision 1.145.2.1: download - view: text, markup, annotated - select for diffs
Wed Aug 27 14:44:42 2014 UTC (10 years, 3 months ago) by msaitoh
Branches: netbsd-6
Diff to: previous 1.145: preferred, colored; next MAIN 1.146: preferred, colored
Changes since revision 1.145: +4 -2 lines
Pull up following revision(s) (requested by maxv in ticket #1114):
	sys/netinet6/ip6_output.c			1.158 via patch

Fix a memory leak in calling setsockopt() on an INET6 socket.

Revision 1.135.2.2: download - view: text, markup, annotated - select for diffs
Wed Aug 27 13:44:34 2014 UTC (10 years, 3 months ago) by msaitoh
Branches: netbsd-5
Diff to: previous 1.135.2.1: preferred, colored; branchpoint 1.135: preferred, colored; next MAIN 1.136: preferred, colored
Changes since revision 1.135.2.1: +4 -2 lines
Pull up following revision(s) (requested by maxv in ticket #1920):
	sys/netinet6/ip6_output.c			1.158 via patch

Fix a memory leak in calling setsockopt() on an INET6 socket.

Revision 1.157.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 24 08:34:58 2014 UTC (10 years, 3 months ago) by martin
Branches: netbsd-7
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +4 -2 lines
Pull up following revision(s) (requested by maxv in ticket #51):
	sys/netinet6/ip6_output.c: revision 1.158
	sys/rump/librump/rumpvfs/rumpfs.c: revision 1.130
Fix memory leaks in error cases

Revision 1.150.2.3: download - view: text, markup, annotated - select for diffs
Wed Aug 20 00:04:36 2014 UTC (10 years, 3 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.150.2.2: preferred, colored; branchpoint 1.150: preferred, colored
Changes since revision 1.150.2.2: +51 -55 lines
Rebase to HEAD as of a few days ago.

Revision 1.158: download - view: text, markup, annotated - select for diffs
Sat Aug 16 17:27:09 2014 UTC (10 years, 3 months ago) by maxv
Branches: MAIN
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +4 -2 lines
	http://m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-2

#03-0x02: Memory leak

ok ozaki-r@

Revision 1.155.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 10 06:56:30 2014 UTC (10 years, 4 months ago) by tls
Branches: tls-earlyentropy
Diff to: previous 1.155: preferred, colored; next MAIN 1.156: preferred, colored
Changes since revision 1.155: +45 -47 lines
Rebase.

Revision 1.157: download - view: text, markup, annotated - select for diffs
Fri May 30 01:39:03 2014 UTC (10 years, 6 months ago) by christos
Branches: MAIN
CVS tags: tls-maxphys-base, tls-earlyentropy-base, netbsd-7-base
Branch point for: netbsd-7
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +40 -34 lines
Introduce 2 new variables: ipsec_enabled and ipsec_used.
Ipsec enabled is controlled by sysctl and determines if is allowed.
ipsec_used is set automatically based on ipsec being enabled, and
rules existing.

Revision 1.140.4.3: download - view: text, markup, annotated - select for diffs
Thu May 22 11:41:10 2014 UTC (10 years, 6 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.140.4.2: preferred, colored; branchpoint 1.140: preferred, colored; next MAIN 1.141: preferred, colored
Changes since revision 1.140.4.2: +26 -23 lines
sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.153.2.3: download - view: text, markup, annotated - select for diffs
Sun May 18 17:46:13 2014 UTC (10 years, 6 months ago) by rmind
Branches: rmind-smpnet
Diff to: previous 1.153.2.2: preferred, colored; next MAIN 1.154: preferred, colored
Changes since revision 1.153.2.2: +7 -3 lines
sync with head

Revision 1.156: download - view: text, markup, annotated - select for diffs
Sat May 17 21:26:20 2014 UTC (10 years, 6 months ago) by rmind
Branches: MAIN
CVS tags: rmind-smpnet-nbase, rmind-smpnet-base
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +7 -15 lines
Replace open-coded access (and boundary checking) of ifindex2ifnet with
if_byindex() function.

Revision 1.155: download - view: text, markup, annotated - select for diffs
Thu Oct 3 20:27:55 2013 UTC (11 years, 2 months ago) by christos
Branches: MAIN
CVS tags: yamt-pagecache-base9, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +7 -3 lines
check sockopt_get() error, from logan.

Revision 1.153.2.2: download - view: text, markup, annotated - select for diffs
Wed Aug 28 23:59:36 2013 UTC (11 years, 3 months ago) by rmind
Branches: rmind-smpnet
Diff to: previous 1.153.2.1: preferred, colored
Changes since revision 1.153.2.1: +5 -11 lines
sync with head

Revision 1.153.2.1: download - view: text, markup, annotated - select for diffs
Wed Jul 17 03:16:31 2013 UTC (11 years, 4 months ago) by rmind
Branches: rmind-smpnet
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +7 -15 lines
Checkpoint work in progress:
- Move PCB structures under __INPCB_PRIVATE, adjust most of the callers
  and thus make IPv4 PCB structures mostly opaque.  Any volunteers for
  merging in6pcb with inpcb (see rpaulo-netinet-merge-pcb branch)?
- Move various global vars to the modules where they belong, make them static.
- Some preliminary work for IPv4 PCB locking scheme.
- Make raw IP code mostly MP-safe.  Simplify some of it.
- Rework "fast" IP forwarding (ipflow) code to be mostly MP-safe.  It should
  run from a software interrupt, rather than hard.
- Rework tun(4) pseudo interface to be MP-safe.
- Work towards making some other interfaces more strict.

Revision 1.154: download - view: text, markup, annotated - select for diffs
Sat Jun 29 21:06:58 2013 UTC (11 years, 5 months ago) by rmind
Branches: MAIN
CVS tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +5 -11 lines
- Rewrite parts of pfil(9): use array to store hooks and thus be more cache
  friendly (there are only few hooks in the system).  Make the structures
  opaque and the interface more strict.
- Remove PFIL_HOOKS option by making pfil(9) mandatory.

Revision 1.150.2.2: download - view: text, markup, annotated - select for diffs
Sun Jun 23 06:20:26 2013 UTC (11 years, 5 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.150.2.1: preferred, colored; branchpoint 1.150: preferred, colored
Changes since revision 1.150.2.1: +17 -12 lines
resync from head

Revision 1.153: download - view: text, markup, annotated - select for diffs
Wed Jun 5 19:01:26 2013 UTC (11 years, 6 months ago) by christos
Branches: MAIN
Branch point for: rmind-smpnet
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +12 -12 lines
IPSEC has not come in two speeds for a long time now (IPSEC == kame,
FAST_IPSEC). Make everything refer to IPSEC to avoid confusion.

Revision 1.152: download - view: text, markup, annotated - select for diffs
Mon Mar 18 19:31:39 2013 UTC (11 years, 8 months ago) by gdt
Branches: MAIN
CVS tags: khorben-n900, agc-symver-base, agc-symver
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +7 -2 lines
Initialize variable used as (conditional) result parameter.

ip6_insertfraghdr either sets a result parameter or returns an error.
While the caller only uses the result parameter in the non-error case,
knowing that requires cross-module static analysis, and that's not
robust against distant code changes.  Therfore, set ip6f to NULL
before the function call that maybe sets it, avoiding a spuruious
warning and changing the future possible bug from an unitialized
dereference to a NULL deferrence.

Revision 1.150.2.1: download - view: text, markup, annotated - select for diffs
Mon Feb 25 00:30:05 2013 UTC (11 years, 9 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +3 -3 lines
resync with head

Revision 1.151: download - view: text, markup, annotated - select for diffs
Fri Jan 25 10:33:53 2013 UTC (11 years, 10 months ago) by kefren
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +3 -3 lines
don't return hlim when asked for multicast loop flag

Revision 1.140.4.2: download - view: text, markup, annotated - select for diffs
Tue Oct 30 17:22:49 2012 UTC (12 years, 1 month ago) by yamt
Branches: yamt-pagecache
CVS tags: yamt-pagecache-tag8
Diff to: previous 1.140.4.1: preferred, colored; branchpoint 1.140: preferred, colored
Changes since revision 1.140.4.1: +20 -2 lines
sync with head

Revision 1.150: download - view: text, markup, annotated - select for diffs
Sat Jul 21 14:52:40 2012 UTC (12 years, 4 months ago) by gdt
Branches: MAIN
CVS tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6
Branch point for: tls-maxphys
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +6 -2 lines
Add comments describing parameter handling for ip6_insertfraghdr.

Depending on compiler options, this code can be involved in an
(apparently) spurious compiler warning.  However, it was not
immediately obvious the the compiler was wrong.

Revision 1.149: download - view: text, markup, annotated - select for diffs
Mon Jun 25 15:28:40 2012 UTC (12 years, 5 months ago) by christos
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +5 -5 lines
rename rfc6056 -> portalgo, requested by yamt

Revision 1.148: download - view: text, markup, annotated - select for diffs
Fri Jun 22 14:54:35 2012 UTC (12 years, 5 months ago) by christos
Branches: MAIN
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +16 -2 lines
PR/46602: Move the rfc6056 port randomization to the IP layer.

Revision 1.140.4.1: download - view: text, markup, annotated - select for diffs
Tue Apr 17 00:08:44 2012 UTC (12 years, 7 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +37 -235 lines
sync with head

Revision 1.140.8.2: download - view: text, markup, annotated - select for diffs
Thu Apr 5 21:33:46 2012 UTC (12 years, 8 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.140.8.1: preferred, colored; branchpoint 1.140: preferred, colored; next MAIN 1.141: preferred, colored
Changes since revision 1.140.8.1: +23 -210 lines
sync to latest -current.

Revision 1.147: download - view: text, markup, annotated - select for diffs
Thu Mar 22 20:34:41 2012 UTC (12 years, 8 months ago) by drochner
Branches: MAIN
CVS tags: yamt-pagecache-base5, yamt-pagecache-base4, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base10
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +4 -196 lines
remove KAME IPSEC, replaced by FAST_IPSEC

Revision 1.146: download - view: text, markup, annotated - select for diffs
Tue Mar 13 18:40:59 2012 UTC (12 years, 9 months ago) by elad
Branches: MAIN
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +21 -16 lines
Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

Most of these changes were brought up in the following messages:

    http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html
    http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html
    http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html

Thanks to christos, manu, njoly, and jmmv for input.

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.

Revision 1.140.8.1: download - view: text, markup, annotated - select for diffs
Sat Feb 18 07:35:43 2012 UTC (12 years, 9 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +32 -43 lines
merge to -current.

Revision 1.145: download - view: text, markup, annotated - select for diffs
Sun Feb 5 00:41:15 2012 UTC (12 years, 10 months ago) by rmind
Branches: MAIN
CVS tags: netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2
Branch point for: netbsd-6-1, netbsd-6-0, netbsd-6
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +6 -3 lines
ip6_output: check for rtcache_setdst() error, which may happen if running
out of memory.

Revision 1.144: download - view: text, markup, annotated - select for diffs
Tue Jan 10 20:05:37 2012 UTC (12 years, 11 months ago) by drochner
Branches: MAIN
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +6 -6 lines
remove conditionals which can't succeed, and also shouldn't because
one would get a kernel NULL dereference immediately

Revision 1.143: download - view: text, markup, annotated - select for diffs
Tue Jan 10 20:01:56 2012 UTC (12 years, 11 months ago) by drochner
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +7 -21 lines
add patch from Arnaud Degroote to handle IPv6 extended options with
(FAST_)IPSEC, tested lightly with a DSTOPTS header consisting
of PAD1

Revision 1.142: download - view: text, markup, annotated - select for diffs
Sat Dec 31 20:41:59 2011 UTC (12 years, 11 months ago) by christos
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +3 -3 lines
- fix offsetof usage, and redundant defines
- kill pointer casts to 0

Revision 1.141: download - view: text, markup, annotated - select for diffs
Mon Dec 19 11:59:58 2011 UTC (12 years, 11 months ago) by drochner
Branches: MAIN
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +18 -18 lines
rename the IPSEC in-kernel CPP variable and config(8) option to
KAME_IPSEC, and make IPSEC define it so that existing kernel
config files work as before
Now the default can be easily be changed to FAST_IPSEC just by
setting the IPSEC alias to FAST_IPSEC.

Revision 1.139.6.1: download - view: text, markup, annotated - select for diffs
Mon Jun 6 09:09:59 2011 UTC (13 years, 6 months ago) by jruoho
Branches: jruoho-x86intr
Diff to: previous 1.139: preferred, colored; next MAIN 1.140: preferred, colored
Changes since revision 1.139: +2 -7 lines
Sync with HEAD.

Revision 1.139.4.1: download - view: text, markup, annotated - select for diffs
Tue May 31 03:05:09 2011 UTC (13 years, 6 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.139: preferred, colored; next MAIN 1.140: preferred, colored
Changes since revision 1.139: +2 -7 lines
sync with head

Revision 1.140: download - view: text, markup, annotated - select for diffs
Mon Apr 25 22:20:59 2011 UTC (13 years, 7 months ago) by yamt
Branches: MAIN
CVS tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, rmind-uvmplock-nbase, rmind-uvmplock-base, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3, cherry-xenmp-base, cherry-xenmp
Branch point for: yamt-pagecache, jmcneill-usbmp
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +2 -7 lines
undefer csum in looutput.
looutput is used by various code (ether_output, mcast) to loopback packets.

Revision 1.129.2.2: download - view: text, markup, annotated - select for diffs
Sat May 16 10:41:50 2009 UTC (15 years, 7 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.129.2.1: preferred, colored; branchpoint 1.129: preferred, colored; next MAIN 1.130: preferred, colored
Changes since revision 1.129.2.1: +44 -39 lines
sync with head

Revision 1.135.6.1: download - view: text, markup, annotated - select for diffs
Wed May 13 17:22:29 2009 UTC (15 years, 7 months ago) by jym
Branches: jym-xensuspend
Diff to: previous 1.135: preferred, colored; next MAIN 1.136: preferred, colored
Changes since revision 1.135: +52 -46 lines
Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.

Revision 1.139: download - view: text, markup, annotated - select for diffs
Thu May 7 21:51:47 2009 UTC (15 years, 7 months ago) by elad
Branches: MAIN
CVS tags: yamt-nfs-mp-base9, yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, uebayasi-xip-base1, uebayasi-xip-base, uebayasi-xip, matt-premerge-20091211, matt-mips64-premerge-20101231, jymxensuspend-base, jym-xensuspend-nbase, jym-xensuspend-base, jruoho-x86intr-base, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: rmind-uvmplock, jruoho-x86intr
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +16 -13 lines
Remove some more "priv" variable usage in favor of kauth(9) calls.

Revision 1.138: download - view: text, markup, annotated - select for diffs
Wed May 6 21:41:59 2009 UTC (15 years, 7 months ago) by elad
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +34 -32 lines
Remove some usage of "priv" and "privileged" variables and instead pass
around credentials. Also push down kauth(9) calls closer to where the
operation is done.

Mailing list reference:

	http://mail-index.netbsd.org/tech-net/2009/04/30/msg001270.html

Revision 1.129.2.1: download - view: text, markup, annotated - select for diffs
Mon May 4 08:14:19 2009 UTC (15 years, 7 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +152 -198 lines
sync with head.

Revision 1.134.2.2: download - view: text, markup, annotated - select for diffs
Tue Apr 28 07:37:23 2009 UTC (15 years, 7 months ago) by skrll
Branches: nick-hppapmap
Diff to: previous 1.134.2.1: preferred, colored; branchpoint 1.134: preferred, colored; next MAIN 1.135: preferred, colored
Changes since revision 1.134.2.1: +10 -9 lines
Sync with HEAD.

Revision 1.135.2.1: download - view: text, markup, annotated - select for diffs
Mon Apr 20 22:56:04 2009 UTC (15 years, 7 months ago) by snj
Branches: netbsd-5
CVS tags: netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-0-RELEASE, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b
Branch point for: netbsd-5-2, netbsd-5-1
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +4 -3 lines
Pull up following revision(s) (requested by drochner in ticket #713):
	sys/netinet6/ip6_output.c: revision 1.137
fix traversing of a control mbuf in the case that a message len
is not aligned wrt CMSG_ALIGN - the length counter drops below 0
in this case which was not checked for,
fixes crashes (with isc_dhcrelay4) reported by Uwe in tech-net
(subject: netbsd5-rc3 crash caused by isc_dhcrelay)

Revision 1.137: download - view: text, markup, annotated - select for diffs
Sat Apr 18 12:40:52 2009 UTC (15 years, 7 months ago) by drochner
Branches: MAIN
CVS tags: yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +4 -3 lines
fix traversing of a control mbuf in the case that a message len
is not aligned wrt CMSG_ALIGN - the length counter drops below 0
in this case which was not checked for,
fixes crashes (with isc_dhcrelay4) reported by Uwe in tech-net
(subject: netbsd5-rc3 crash caused by isc_dhcrelay)

Revision 1.136: download - view: text, markup, annotated - select for diffs
Wed Mar 18 16:00:23 2009 UTC (15 years, 8 months ago) by cegger
Branches: MAIN
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +8 -8 lines
bzero -> memset

Revision 1.134.2.1: download - view: text, markup, annotated - select for diffs
Mon Jan 19 13:20:14 2009 UTC (15 years, 10 months ago) by skrll
Branches: nick-hppapmap
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +7 -2 lines
Sync with HEAD.

Revision 1.126.6.3: download - view: text, markup, annotated - select for diffs
Sat Jan 17 13:29:33 2009 UTC (15 years, 10 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.126.6.2: preferred, colored; branchpoint 1.126: preferred, colored; next MAIN 1.127: preferred, colored
Changes since revision 1.126.6.2: +87 -93 lines
Sync with HEAD.

Revision 1.129.8.2: download - view: text, markup, annotated - select for diffs
Sat Dec 13 01:15:27 2008 UTC (16 years ago) by haad
Branches: haad-dm
Diff to: previous 1.129.8.1: preferred, colored; branchpoint 1.129: preferred, colored; next MAIN 1.130: preferred, colored
Changes since revision 1.129.8.1: +7 -2 lines
Update haad-dm branch to haad-dm-base2.

Revision 1.135: download - view: text, markup, annotated - select for diffs
Mon Oct 27 20:03:07 2008 UTC (16 years, 1 month ago) by plunky
Branches: MAIN
CVS tags: nick-hppapmap-base2, netbsd-5-base, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, mjf-devfs2-base, haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Branch point for: netbsd-5, jym-xensuspend
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +7 -2 lines
sockopt_getmbuf() may fail, handle that possibility

Revision 1.129.8.1: download - view: text, markup, annotated - select for diffs
Sun Oct 19 22:17:52 2008 UTC (16 years, 1 month ago) by haad
Branches: haad-dm
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +139 -191 lines
Sync with HEAD.

Revision 1.134: download - view: text, markup, annotated - select for diffs
Sun Oct 12 15:24:10 2008 UTC (16 years, 2 months ago) by plunky
Branches: MAIN
CVS tags: matt-mips64-base2, haad-dm-base1
Branch point for: nick-hppapmap
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +7 -4 lines
ip6_pcbopts() is called with the socket lock held, use M_NOWAIT

Revision 1.133: download - view: text, markup, annotated - select for diffs
Sun Oct 12 15:12:17 2008 UTC (16 years, 2 months ago) by plunky
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +6 -3 lines
ip6_pcbopt() is in the ctloutput path, we should not
sleep here because socket lock is held. use M_NOWAIT

Revision 1.132: download - view: text, markup, annotated - select for diffs
Sun Oct 12 11:34:48 2008 UTC (16 years, 2 months ago) by plunky
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +68 -90 lines
convert ip6_[sg]etmoptions() to use sockopt(9) API
should be no functional change

Revision 1.131: download - view: text, markup, annotated - select for diffs
Sun Oct 12 10:25:04 2008 UTC (16 years, 2 months ago) by plunky
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +10 -5 lines
do not sleep while allocating memory, socket lock is held
(use ENOBUFS for failure)

Revision 1.126.6.2: download - view: text, markup, annotated - select for diffs
Sun Sep 28 10:40:59 2008 UTC (16 years, 2 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.126.6.1: preferred, colored; branchpoint 1.126: preferred, colored
Changes since revision 1.126.6.1: +78 -119 lines
Sync with HEAD.

Revision 1.129.4.1: download - view: text, markup, annotated - select for diffs
Thu Sep 18 04:37:01 2008 UTC (16 years, 2 months ago) by wrstuden
Branches: wrstuden-revivesa
Diff to: previous 1.129: preferred, colored; next MAIN 1.130: preferred, colored
Changes since revision 1.129: +80 -121 lines
Sync with wrstuden-revivesa-base-2.

Revision 1.130: download - view: text, markup, annotated - select for diffs
Wed Aug 6 15:01:23 2008 UTC (16 years, 4 months ago) by plunky
Branches: MAIN
CVS tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +80 -121 lines
Convert socket options code to use a sockopt structure
instead of laying everything into an mbuf.

approved by core

Revision 1.126.6.1: download - view: text, markup, annotated - select for diffs
Mon Jun 2 13:24:27 2008 UTC (16 years, 6 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +16 -14 lines
Sync with HEAD.

Revision 1.128.2.1: download - view: text, markup, annotated - select for diffs
Sun May 18 12:35:35 2008 UTC (16 years, 6 months ago) by yamt
Branches: yamt-pf42
Diff to: previous 1.128: preferred, colored; next MAIN 1.129: preferred, colored
Changes since revision 1.128: +5 -4 lines
sync with head.

Revision 1.129: download - view: text, markup, annotated - select for diffs
Wed Apr 23 06:09:05 2008 UTC (16 years, 7 months ago) by thorpej
Branches: MAIN
CVS tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-nfs-mp-base2, yamt-nfs-mp-base, wrstuden-revivesa-base-1, wrstuden-revivesa-base, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl, hpcarm-cleanup-nbase
Branch point for: yamt-nfs-mp, wrstuden-revivesa, haad-dm
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +5 -4 lines
Make IPSEC and FAST_IPSEC stats per-cpu.  Use <net/net_stats.h> and
netstat_sysctl().

Revision 1.128: download - view: text, markup, annotated - select for diffs
Tue Apr 15 03:57:04 2008 UTC (16 years, 8 months ago) by thorpej
Branches: MAIN
CVS tags: yamt-pf42-baseX, yamt-pf42-base
Branch point for: yamt-pf42
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +13 -12 lines
Make ip6 and icmp6 stats per-cpu.

Revision 1.127: download - view: text, markup, annotated - select for diffs
Tue Apr 8 23:37:43 2008 UTC (16 years, 8 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +12 -12 lines
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.

Revision 1.120.8.4: download - view: text, markup, annotated - select for diffs
Sun Mar 23 02:05:07 2008 UTC (16 years, 8 months ago) by matt
Branches: matt-armv6
Diff to: previous 1.120.8.3: preferred, colored; branchpoint 1.120: preferred, colored; next MAIN 1.121: preferred, colored
Changes since revision 1.120.8.3: +8 -8 lines
sync with HEAD

Revision 1.126.2.1: download - view: text, markup, annotated - select for diffs
Fri Feb 22 02:53:33 2008 UTC (16 years, 9 months ago) by keiichi
Branches: keiichi-mipv6
Diff to: previous 1.126: preferred, colored; next MAIN 1.127: preferred, colored
Changes since revision 1.126: +308 -51 lines
imported Mobile IPv6 code developed by the SHISA project
(http://www.mobileip.jp/).

Revision 1.122.2.3: download - view: text, markup, annotated - select for diffs
Mon Feb 18 21:07:13 2008 UTC (16 years, 9 months ago) by mjf
Branches: mjf-devfs
Diff to: previous 1.122.2.2: preferred, colored; branchpoint 1.122: preferred, colored; next MAIN 1.123: preferred, colored
Changes since revision 1.122.2.2: +8 -8 lines
Sync with HEAD.

Revision 1.88.4.7: download - view: text, markup, annotated - select for diffs
Mon Jan 21 09:47:23 2008 UTC (16 years, 10 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.88.4.6: preferred, colored; branchpoint 1.88: preferred, colored; next MAIN 1.89: preferred, colored
Changes since revision 1.88.4.6: +17 -18 lines
sync with head

Revision 1.123.6.3: download - view: text, markup, annotated - select for diffs
Sat Jan 19 12:15:34 2008 UTC (16 years, 10 months ago) by bouyer
Branches: bouyer-xeni386
Diff to: previous 1.123.6.2: preferred, colored; branchpoint 1.123: preferred, colored; next MAIN 1.124: preferred, colored
Changes since revision 1.123.6.2: +5 -4 lines
Sync with HEAD

Revision 1.126: download - view: text, markup, annotated - select for diffs
Mon Jan 14 04:16:45 2008 UTC (16 years, 11 months ago) by dyoung
Branches: MAIN
CVS tags: yamt-lazymbuf-base15, yamt-lazymbuf-base14, nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, hpcarm-cleanup-base, bouyer-xeni386-nbase, bouyer-xeni386-base, ad-socklock-base1
Branch point for: mjf-devfs2, keiichi-mipv6
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +7 -6 lines
Use rtcache_validate() instead of rtcache_getrt().  Shorten staircase
in in6_losing().

Revision 1.123.6.2: download - view: text, markup, annotated - select for diffs
Thu Jan 10 23:44:38 2008 UTC (16 years, 11 months ago) by bouyer
Branches: bouyer-xeni386
CVS tags: bouyer-xeni386-merge1
Diff to: previous 1.123.6.1: preferred, colored; branchpoint 1.123: preferred, colored
Changes since revision 1.123.6.1: +1 -2 lines
Sync with HEAD

Revision 1.125: download - view: text, markup, annotated - select for diffs
Thu Jan 10 08:06:12 2008 UTC (16 years, 11 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +3 -4 lines
Save some rtcache_getrt() calls.

Revision 1.120.8.3: download - view: text, markup, annotated - select for diffs
Wed Jan 9 01:57:37 2008 UTC (16 years, 11 months ago) by matt
Branches: matt-armv6
Diff to: previous 1.120.8.2: preferred, colored; branchpoint 1.120: preferred, colored
Changes since revision 1.120.8.2: +14 -15 lines
sync with HEAD

Revision 1.123.6.1: download - view: text, markup, annotated - select for diffs
Wed Jan 2 21:57:30 2008 UTC (16 years, 11 months ago) by bouyer
Branches: bouyer-xeni386
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +14 -15 lines
Sync with HEAD

Revision 1.122.2.2: download - view: text, markup, annotated - select for diffs
Thu Dec 27 00:46:33 2007 UTC (16 years, 11 months ago) by mjf
Branches: mjf-devfs
Diff to: previous 1.122.2.1: preferred, colored; branchpoint 1.122: preferred, colored
Changes since revision 1.122.2.1: +14 -15 lines
Sync with HEAD.

Revision 1.123.2.1: download - view: text, markup, annotated - select for diffs
Wed Dec 26 19:57:46 2007 UTC (16 years, 11 months ago) by ad
Branches: vmlocking2
Diff to: previous 1.123: preferred, colored; next MAIN 1.124: preferred, colored
Changes since revision 1.123: +14 -15 lines
Sync with head.

Revision 1.124: download - view: text, markup, annotated - select for diffs
Thu Dec 20 19:53:34 2007 UTC (16 years, 11 months ago) by dyoung
Branches: MAIN
CVS tags: vmlocking2-base3, matt-armv6-base
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +14 -15 lines
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.

Revision 1.122.2.1: download - view: text, markup, annotated - select for diffs
Mon Nov 19 00:49:13 2007 UTC (17 years ago) by mjf
Branches: mjf-devfs
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +8 -22 lines
Sync with HEAD.

Revision 1.88.4.6: download - view: text, markup, annotated - select for diffs
Thu Nov 15 11:45:12 2007 UTC (17 years, 1 month ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.88.4.5: preferred, colored; branchpoint 1.88: preferred, colored
Changes since revision 1.88.4.5: +23 -37 lines
sync with head.

Revision 1.121.4.1: download - view: text, markup, annotated - select for diffs
Tue Nov 13 16:02:57 2007 UTC (17 years, 1 month ago) by bouyer
Branches: bouyer-xenamd64
Diff to: previous 1.121: preferred, colored; next MAIN 1.122: preferred, colored
Changes since revision 1.121: +23 -37 lines
Sync with HEAD

Revision 1.120.6.3: download - view: text, markup, annotated - select for diffs
Sun Nov 11 16:48:34 2007 UTC (17 years, 1 month ago) by joerg
Branches: jmcneill-pm
Diff to: previous 1.120.6.2: preferred, colored; branchpoint 1.120: preferred, colored; next MAIN 1.121: preferred, colored
Changes since revision 1.120.6.2: +8 -22 lines
Sync with HEAD.

Revision 1.120.8.2: download - view: text, markup, annotated - select for diffs
Thu Nov 8 11:00:14 2007 UTC (17 years, 1 month ago) by matt
Branches: matt-armv6
CVS tags: matt-armv6-prevmlocking
Diff to: previous 1.120.8.1: preferred, colored; branchpoint 1.120: preferred, colored
Changes since revision 1.120.8.1: +8 -22 lines
sync with -HEAD

Revision 1.123: download - view: text, markup, annotated - select for diffs
Tue Nov 6 23:48:24 2007 UTC (17 years, 1 month ago) by dyoung
Branches: MAIN
CVS tags: yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base2, vmlocking2-base1, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, jmcneill-pm-base, cube-autoconf-base, cube-autoconf, bouyer-xenamd64-base2, bouyer-xenamd64-base
Branch point for: vmlocking2, bouyer-xeni386
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +8 -22 lines
Use sockaddr_in6_init().

Revision 1.120.8.1: download - view: text, markup, annotated - select for diffs
Tue Nov 6 23:34:04 2007 UTC (17 years, 1 month ago) by matt
Branches: matt-armv6
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +490 -491 lines
sync with HEAD

Revision 1.120.6.2: download - view: text, markup, annotated - select for diffs
Sun Nov 4 21:03:43 2007 UTC (17 years, 1 month ago) by jmcneill
Branches: jmcneill-pm
Diff to: previous 1.120.6.1: preferred, colored; branchpoint 1.120: preferred, colored
Changes since revision 1.120.6.1: +17 -17 lines
Sync with HEAD.

Revision 1.122: download - view: text, markup, annotated - select for diffs
Thu Nov 1 20:33:57 2007 UTC (17 years, 1 month ago) by dyoung
Branches: MAIN
CVS tags: jmcneill-base
Branch point for: mjf-devfs
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +17 -17 lines
De-__P().

Revision 1.88.4.5: download - view: text, markup, annotated - select for diffs
Sat Oct 27 11:36:13 2007 UTC (17 years, 1 month ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.88.4.4: preferred, colored; branchpoint 1.88: preferred, colored
Changes since revision 1.88.4.4: +475 -476 lines
sync with head.

Revision 1.117.2.3: download - view: text, markup, annotated - select for diffs
Tue Oct 9 13:44:55 2007 UTC (17 years, 2 months ago) by ad
Branches: vmlocking
Diff to: previous 1.117.2.2: preferred, colored; branchpoint 1.117: preferred, colored; next MAIN 1.118: preferred, colored
Changes since revision 1.117.2.2: +475 -476 lines
Sync with head.

Revision 1.120.6.1: download - view: text, markup, annotated - select for diffs
Tue Oct 2 18:29:23 2007 UTC (17 years, 2 months ago) by joerg
Branches: jmcneill-pm
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +475 -476 lines
Sync with HEAD.

Revision 1.121: download - view: text, markup, annotated - select for diffs
Wed Sep 19 04:33:44 2007 UTC (17 years, 2 months ago) by dyoung
Branches: MAIN
CVS tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, vmlocking-base
Branch point for: bouyer-xenamd64
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +475 -476 lines
1) Introduce a new socket option, (SOL_SOCKET, SO_NOHEADER), that
   tells a socket that it should both add a protocol header to tx'd
   datagrams and remove the header from rx'd datagrams:

        int onoff = 1, s = socket(...);
        setsockopt(s, SOL_SOCKET, SO_NOHEADER, &onoff);

2) Add an implementation of (SOL_SOCKET, SO_NOHEADER) for raw IPv4
   sockets.

3) Reorganize the protocols' pr_ctloutput implementations a bit.
   Consistently return ENOPROTOOPT when an option is unsupported,
   and EINVAL if a supported option's arguments are incorrect.
   Reorganize the flow of code so that it's more clear how/when
   options are passed down the stack until they are handled.

   Shorten some pr_ctloutput staircases for readability.

4) Extract common mbuf code into subroutines, add new sockaddr
   methods, and introduce a new subroutine, fsocreate(), for reuse
   later; use it first in sys_socket():

struct mbuf *m_getsombuf(struct socket *so)

        Create an mbuf and make its owner the socket `so'.

struct mbuf *m_intopt(struct socket *so, int val)

        Create an mbuf, make its owner the socket `so', put the
        int `val' into it, and set its length to sizeof(int).


int fsocreate(..., int *fd)

        Create a socket, a la socreate(9), put the socket into the
        given LWP's descriptor table, return the descriptor at `fd'
        on success.

void *sockaddr_addr(struct sockaddr *sa, socklen_t *slenp)
const void *sockaddr_const_addr(const struct sockaddr *sa, socklen_t *slenp)

        Extract a pointer to the address part of a sockaddr.  Write
        the length of the address  part at `slenp', if `slenp' is
        not NULL.

socklen_t sockaddr_getlen(const struct sockaddr *sa)

        Return the length of a sockaddr.  This just evaluates to
        sa->sa_len.  I only add this for consistency with code that
        appears in a portable userland library that I am going to
        import.

const struct sockaddr *sockaddr_any(const struct sockaddr *sa)

        Return the "don't care" sockaddr in the same family as
        `sa'.  This is the address a client should sobind(9) if it
        does not care the source address and, if applicable, the
        port et cetera that it uses.

const void *sockaddr_anyaddr(const struct sockaddr *sa, socklen_t *slenp)

        Return the "don't care" sockaddr in the same family as
        `sa'.  This is the address a client should sobind(9) if it
        does not care the source address and, if applicable, the
        port et cetera that it uses.

Revision 1.88.4.4: download - view: text, markup, annotated - select for diffs
Mon Sep 3 14:43:33 2007 UTC (17 years, 3 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.88.4.3: preferred, colored; branchpoint 1.88: preferred, colored
Changes since revision 1.88.4.3: +91 -128 lines
sync with head.

Revision 1.117.4.1: download - view: text, markup, annotated - select for diffs
Wed Jul 11 20:11:44 2007 UTC (17 years, 5 months ago) by mjf
Branches: mjf-ufs-trans
Diff to: previous 1.117: preferred, colored; next MAIN 1.118: preferred, colored
Changes since revision 1.117: +80 -117 lines
Sync with head.

Revision 1.117.2.2: download - view: text, markup, annotated - select for diffs
Sat Jun 9 23:58:13 2007 UTC (17 years, 6 months ago) by ad
Branches: vmlocking
Diff to: previous 1.117.2.1: preferred, colored; branchpoint 1.117: preferred, colored
Changes since revision 1.117.2.1: +2 -10 lines
Sync with head.

Revision 1.117.2.1: download - view: text, markup, annotated - select for diffs
Fri Jun 8 14:17:55 2007 UTC (17 years, 6 months ago) by ad
Branches: vmlocking
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +80 -109 lines
Sync with head.

Revision 1.106.4.1: download - view: text, markup, annotated - select for diffs
Mon Jun 4 01:54:26 2007 UTC (17 years, 6 months ago) by wrstuden
Branches: wrstuden-fixsa
Diff to: previous 1.106: preferred, colored; next MAIN 1.107: preferred, colored
Changes since revision 1.106: +71 -10 lines
Update to today's netbsd-4.

Revision 1.120: download - view: text, markup, annotated - select for diffs
Sat Jun 2 23:26:26 2007 UTC (17 years, 6 months ago) by alc
Branches: MAIN
CVS tags: nick-csl-alignment-base5, nick-csl-alignment-base, nick-csl-alignment, mjf-ufs-trans-base, matt-mips64-base, matt-mips64, hpcarm-cleanup
Branch point for: matt-armv6, jmcneill-pm
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +2 -10 lines
don't increment `ip6stat.ip6s_noroute' here, it has already been done in
in6_src:in6_selectroute().

ok dyoung@

Revision 1.106.2.1: download - view: text, markup, annotated - select for diffs
Thu May 24 19:13:16 2007 UTC (17 years, 6 months ago) by pavel
Branches: netbsd-4
CVS tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, matt-nb4-arm-base, matt-nb4-arm
Diff to: previous 1.106: preferred, colored; next MAIN 1.107: preferred, colored
Changes since revision 1.106: +71 -10 lines
Pull up following revision(s) (requested by degroote in ticket #667):
	sys/netinet/tcp_input.c: revision 1.260
	sys/netinet/tcp_output.c: revision 1.154
	sys/netinet/tcp_subr.c: revision 1.210
	sys/netinet6/icmp6.c: revision 1.129
	sys/netinet6/in6_proto.c: revision 1.70
	sys/netinet6/ip6_forward.c: revision 1.54
	sys/netinet6/ip6_input.c: revision 1.94
	sys/netinet6/ip6_output.c: revision 1.114
	sys/netinet6/raw_ip6.c: revision 1.81
	sys/netipsec/ipcomp_var.h: revision 1.4
	sys/netipsec/ipsec.c: revision 1.26 via patch,1.31-1.32
	sys/netipsec/ipsec6.h: revision 1.5
	sys/netipsec/ipsec_input.c: revision 1.14
	sys/netipsec/ipsec_netbsd.c: revision 1.18,1.26
	sys/netipsec/ipsec_output.c: revision 1.21 via patch
	sys/netipsec/key.c: revision 1.33,1.44
	sys/netipsec/xform_ipcomp.c: revision 1.9
	sys/netipsec/xform_ipip.c: revision 1.15
	sys/opencrypto/deflate.c: revision 1.8
Commit my SoC work
Add ipv6 support for fast_ipsec
Note that currently, packet with extensions headers are not correctly
supported
Change the ipcomp logic

Add sysctl tree to modify the fast_ipsec options related to ipv6. Similar
to the sysctl kame interface.

Choose the good default policy, depending of the adress family of the
desired policy

Increase the refcount for the default ipv6 policy so nobody can reclaim it

Always compute the sp index even if we don't have any sp in spd. It will
let us to choose the right default policy (based on the adress family
requested).
While here, fix an error message

Use dynamic array instead of an static array to decompress. It lets us to
decompress any data, whatever is the radio decompressed data / compressed
data.
It fixes the last issues with fast_ipsec and ipcomp.
While here, bzero -> memset, bcopy -> memcpy, FREE -> free
Reviewed a long time ago by sam@

Revision 1.119: download - view: text, markup, annotated - select for diffs
Wed May 23 17:15:02 2007 UTC (17 years, 6 months ago) by christos
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +18 -45 lines
Ansify + add a few comments, from Karl Sjödahl

Revision 1.114.2.3: download - view: text, markup, annotated - select for diffs
Mon May 7 10:56:04 2007 UTC (17 years, 7 months ago) by yamt
Branches: yamt-idlelwp
Diff to: previous 1.114.2.2: preferred, colored; next MAIN 1.115: preferred, colored
Changes since revision 1.114.2.2: +64 -66 lines
sync with head.

Revision 1.118: download - view: text, markup, annotated - select for diffs
Wed May 2 20:40:27 2007 UTC (17 years, 7 months ago) by dyoung
Branches: MAIN
CVS tags: yamt-idlelwp-base8
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +64 -66 lines
Eliminate address family-specific route caches (struct route, struct
route_in6, struct route_iso), replacing all caches with a struct
route.

The principle benefit of this change is that all of the protocol
families can benefit from route cache-invalidation, which is
necessary for correct routing.  Route-cache invalidation fixes an
ancient PR, kern/3508, at long last; it fixes various other PRs,
also.

Discussions with and ideas from Joerg Sonnenberger influenced this
work tremendously.  Of course, all design oversights and bugs are
mine.

DETAILS

1 I added to each address family a pool of sockaddrs.  I have
  introduced routines for allocating, copying, and duplicating,
  and freeing sockaddrs:

        struct sockaddr *sockaddr_alloc(sa_family_t af, int flags);
        struct sockaddr *sockaddr_copy(struct sockaddr *dst,
                                       const struct sockaddr *src);
        struct sockaddr *sockaddr_dup(const struct sockaddr *src, int flags);
        void sockaddr_free(struct sockaddr *sa);

  sockaddr_alloc() returns either a sockaddr from the pool belonging
  to the specified family, or NULL if the pool is exhausted.  The
  returned sockaddr has the right size for that family; sa_family
  and sa_len fields are initialized to the family and sockaddr
  length---e.g., sa_family = AF_INET and sa_len = sizeof(struct
  sockaddr_in).  sockaddr_free() puts the given sockaddr back into
  its family's pool.

  sockaddr_dup() and sockaddr_copy() work analogously to strdup()
  and strcpy(), respectively.  sockaddr_copy() KASSERTs that the
  family of the destination and source sockaddrs are alike.

  The 'flags' argumet for sockaddr_alloc() and sockaddr_dup() is
  passed directly to pool_get(9).

2 I added routines for initializing sockaddrs in each address
  family, sockaddr_in_init(), sockaddr_in6_init(), sockaddr_iso_init(),
  etc.  They are fairly self-explanatory.

3 structs route_in6 and route_iso are no more.  All protocol families
  use struct route.  I have changed the route cache, 'struct route',
  so that it does not contain storage space for a sockaddr.  Instead,
  struct route points to a sockaddr coming from the pool the sockaddr
  belongs to.  I added a new method to struct route, rtcache_setdst(),
  for setting the cache destination:

        int rtcache_setdst(struct route *, const struct sockaddr *);

  rtcache_setdst() returns 0 on success, or ENOMEM if no memory is
  available to create the sockaddr storage.

  It is now possible for rtcache_getdst() to return NULL if, say,
  rtcache_setdst() failed.  I check the return value for NULL
  everywhere in the kernel.

4 Each routing domain (struct domain) has a list of live route
  caches, dom_rtcache.  rtflushall(sa_family_t af) looks up the
  domain indicated by 'af', walks the domain's list of route caches
  and invalidates each one.

Revision 1.114.2.2: download - view: text, markup, annotated - select for diffs
Mon Mar 12 05:59:58 2007 UTC (17 years, 9 months ago) by rmind
Branches: yamt-idlelwp
Diff to: previous 1.114.2.1: preferred, colored
Changes since revision 1.114.2.1: +14 -14 lines
Sync with HEAD.

Revision 1.117: download - view: text, markup, annotated - select for diffs
Sun Mar 4 06:03:26 2007 UTC (17 years, 9 months ago) by christos
Branches: MAIN
CVS tags: thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup
Branch point for: vmlocking, mjf-ufs-trans
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +14 -14 lines
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.

Revision 1.114.2.1: download - view: text, markup, annotated - select for diffs
Tue Feb 27 16:55:03 2007 UTC (17 years, 9 months ago) by yamt
Branches: yamt-idlelwp
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +22 -27 lines
- sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.

Revision 1.88.4.3: download - view: text, markup, annotated - select for diffs
Mon Feb 26 09:11:52 2007 UTC (17 years, 9 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.88.4.2: preferred, colored; branchpoint 1.88: preferred, colored
Changes since revision 1.88.4.2: +100 -48 lines
sync with head.

Revision 1.116: download - view: text, markup, annotated - select for diffs
Wed Feb 21 23:00:08 2007 UTC (17 years, 9 months ago) by thorpej
Branches: MAIN
CVS tags: ad-audiomp-base, ad-audiomp
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +3 -3 lines
Replace the Mach-derived boolean_t type with the C99 bool type.  A
future commit will replace use of TRUE and FALSE with true and false.

Revision 1.115: download - view: text, markup, annotated - select for diffs
Sat Feb 17 22:34:14 2007 UTC (17 years, 9 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +21 -26 lines
KNF: de-__P, bzero -> memset, bcmp -> memcmp.  Remove extraneous
   parentheses in return statements.

Cosmetic: don't open-code TAILQ_FOREACH().

Cosmetic: change types of variables to avoid oodles of casts: in
   in6_src.c, avoid casts by changing several route_in6 pointers
   to struct route pointers.  Remove unnecessary casts to caddr_t
   elsewhere.

Pave the way for eliminating address family-specific route caches:
   soon, struct route will not embed a sockaddr, but it will hold
   a reference to an external sockaddr, instead.  We will set the
   destination sockaddr using rtcache_setdst().  (I created a stub
   for it, but it isn't used anywhere, yet.)  rtcache_free() will
   free the sockaddr.  I have extracted from rtcache_free() a helper
   subroutine, rtcache_clear().  rtcache_clear() will "forget" a
   cached route, but it will not forget the destination by releasing
   the sockaddr.  I use rtcache_clear() instead of rtcache_free()
   in rtcache_update(), because rtcache_update() is not supposed
   to forget the destination.

Constify:

   1 Introduce const accessor for route->ro_dst, rtcache_getdst().

   2 Constify the 'dst' argument to ifnet->if_output().  This
     led me to constify a lot of code called by output routines.

   3 Constify the sockaddr argument to protosw->pr_ctlinput.  This
     led me to constify a lot of code called by ctlinput routines.

   4 Introduce const macros for converting from a generic sockaddr
     to family-specific sockaddrs, e.g., sockaddr_in: satocsin6,
     satocsin, et cetera.

Revision 1.114: download - view: text, markup, annotated - select for diffs
Sat Feb 10 09:43:05 2007 UTC (17 years, 10 months ago) by degroote
Branches: MAIN
Branch point for: yamt-idlelwp
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +71 -10 lines
Commit my SoC work
Add ipv6 support for fast_ipsec
Note that currently, packet with extensions headers are not correctly
supported
Change the ipcomp logic

Revision 1.102.2.3: download - view: text, markup, annotated - select for diffs
Thu Feb 1 08:48:44 2007 UTC (17 years, 10 months ago) by ad
Branches: newlock2
Diff to: previous 1.102.2.2: preferred, colored; branchpoint 1.102: preferred, colored; next MAIN 1.103: preferred, colored
Changes since revision 1.102.2.2: +8 -12 lines
Sync with head.

Revision 1.113: download - view: text, markup, annotated - select for diffs
Mon Jan 29 06:13:58 2007 UTC (17 years, 10 months ago) by dyoung
Branches: MAIN
CVS tags: post-newlock2-merge, newlock2-nbase, newlock2-base
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +7 -7 lines
Cosmetic: bzero -> memset, remove gratuitous cast, compare pointer
with NULL instead of 0.

Revision 1.112: download - view: text, markup, annotated - select for diffs
Mon Jan 29 06:12:48 2007 UTC (17 years, 10 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +3 -7 lines
In In ip6_setmoptions(), don't leave a route cache (struct route_in6)
on the stack if we exit with EADDRNOTAVAIL.

(I already fixed this bug once tonight.  Clearly, ip6_setmoptions
was cut-and-pasted from ip_setmoptions.)

Revision 1.102.2.2: download - view: text, markup, annotated - select for diffs
Fri Jan 12 01:04:15 2007 UTC (17 years, 11 months ago) by ad
Branches: newlock2
Diff to: previous 1.102.2.1: preferred, colored; branchpoint 1.102: preferred, colored
Changes since revision 1.102.2.1: +52 -46 lines
Sync with head.

Revision 1.111: download - view: text, markup, annotated - select for diffs
Thu Jan 4 19:07:04 2007 UTC (17 years, 11 months ago) by elad
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +5 -5 lines
Consistent usage of KAUTH_GENERIC_ISSUSER.

Revision 1.88.4.2: download - view: text, markup, annotated - select for diffs
Sat Dec 30 20:50:39 2006 UTC (17 years, 11 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.88.4.1: preferred, colored; branchpoint 1.88: preferred, colored
Changes since revision 1.88.4.1: +102 -65 lines
sync with head.

Revision 1.110: download - view: text, markup, annotated - select for diffs
Wed Dec 27 18:49:40 2006 UTC (17 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +15 -12 lines
CID-3317: check for 'm != NULL' before using it (rework the code path to
explicitly return `EINVAL'. Before, it was done but later in
ip6_setpktopt() when checking for 'len < ...')
CID-3316: check for 'm != NULL' before using it

ok christos@

Revision 1.102.4.3: download - view: text, markup, annotated - select for diffs
Mon Dec 18 11:42:23 2006 UTC (17 years, 11 months ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.102.4.2: preferred, colored; branchpoint 1.102: preferred, colored; next MAIN 1.103: preferred, colored
Changes since revision 1.102.4.2: +16 -18 lines
sync with head.

Revision 1.109: download - view: text, markup, annotated - select for diffs
Fri Dec 15 21:18:55 2006 UTC (18 years ago) by joerg
Branches: MAIN
CVS tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +16 -18 lines
Introduce new helper functions to abstract the route caching.
rtcache_init and rtcache_init_noclone lookup ro_dst and store
the result in ro_rt, taking care of the reference counting and
calling the domain specific route cache.
rtcache_free checks if a route was cashed and frees the reference.
rtcache_copy copies ro_dst of the given struct route, checking that
enough space is available and incrementing the reference count of the
cached rtentry if necessary.
rtcache_check validates that the cached route is still up. If it isn't,
it tries to look it up again. Afterwards ro_rt is either a valid again
or NULL.
rtcache_copy is used internally.

Adjust to callers of rtalloc/rtflush in the tree to check the sanity of
ro_dst first (if necessary). If it doesn't fit the expectations, free
the cache, otherwise check if the cached route is still valid. After
that combination, a single check for ro_rt == NULL is enough to decide
whether a new lookup needs to be done with a different ro_dst.
Make the route checking in gre stricter by repeating the loop check
after revalidation.
Remove some unused RADIX_MPATH code in in6_src.c. The logic is slightly
changed here to first validate the route and check RTF_GATEWAY
afterwards. This is sementically equivalent though.
etherip doesn't need sc_route_expire similiar to the gif changes from
dyoung@ earlier.

Based on the earlier patch from dyoung@, reviewed and discussed with
him.

Revision 1.102.4.2: download - view: text, markup, annotated - select for diffs
Sun Dec 10 07:19:16 2006 UTC (18 years ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.102.4.1: preferred, colored; branchpoint 1.102: preferred, colored
Changes since revision 1.102.4.1: +35 -30 lines
sync with head.

Revision 1.108: download - view: text, markup, annotated - select for diffs
Sat Dec 9 05:33:08 2006 UTC (18 years ago) by dyoung
Branches: MAIN
CVS tags: yamt-splraiseipl-base3
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +13 -20 lines
Here are various changes designed to protect against bad IPv4
routing caused by stale route caches (struct route).  Route caches
are sprinkled throughout PCBs, the IP fast-forwarding table, and
IP tunnel interfaces (gre, gif, stf).

Stale IPv6 and ISO route caches will be treated by separate patches.

Thank you to Christoph Badura for suggesting the general approach
to invalidating route caches that I take here.

Here are the details:

Add hooks to struct domain for tracking and for invalidating each
domain's route caches: dom_rtcache, dom_rtflush, and dom_rtflushall.

Introduce helper subroutines, rtflush(ro) for invalidating a route
cache, rtflushall(family) for invalidating all route caches in a
routing domain, and rtcache(ro) for notifying the domain of a new
cached route.

Chain together all IPv4 route caches where ro_rt != NULL.  Provide
in_rtcache() for adding a route to the chain.  Provide in_rtflush()
and in_rtflushall() for invalidating IPv4 route caches.  In
in_rtflush(), set ro_rt to NULL, and remove the route from the
chain.  In in_rtflushall(), walk the chain and remove every route
cache.

In rtrequest1(), call rtflushall() to invalidate route caches when
a route is added.

In gif(4), discard the workaround for stale caches that involves
expiring them every so often.

Replace the pattern 'RTFREE(ro->ro_rt); ro->ro_rt = NULL;' with a
call to rtflush(ro).

Update ipflow_fastforward() and all other users of route caches so
that they expect a cached route, ro->ro_rt, to turn to NULL.

Take care when moving a 'struct route' to rtflush() the source and
to rtcache() the destination.

In domain initializers, use .dom_xxx tags.

KNF here and there.

Revision 1.107: download - view: text, markup, annotated - select for diffs
Sat Dec 2 18:59:17 2006 UTC (18 years ago) by dyoung
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +6 -7 lines
Use the queue(3) macros instead of open-coding them.  Shorten
staircases.  Remove unnecessary casts.  Where appropriate, s/8/NBBY/.
De-__P().  KNF.

No functional changes intended.

Revision 1.106: download - view: text, markup, annotated - select for diffs
Sat Nov 25 18:41:36 2006 UTC (18 years ago) by yamt
Branches: MAIN
CVS tags: netbsd-4-base
Branch point for: wrstuden-fixsa, netbsd-4
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +2 -35 lines
move tso-by-software code to their own files.  no functional changes.

Revision 1.105: download - view: text, markup, annotated - select for diffs
Thu Nov 23 19:41:58 2006 UTC (18 years ago) by yamt
Branches: MAIN
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +52 -6 lines
implement ipv6 TSO.
partly from Matthias Scheler.  tested by him.

Revision 1.102.2.1: download - view: text, markup, annotated - select for diffs
Sat Nov 18 21:39:37 2006 UTC (18 years ago) by ad
Branches: newlock2
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +11 -10 lines
Sync with head.

Revision 1.104: download - view: text, markup, annotated - select for diffs
Thu Nov 16 01:33:45 2006 UTC (18 years ago) by christos
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +3 -3 lines
__unused removal on arguments; approved by core.

Revision 1.102.4.1: download - view: text, markup, annotated - select for diffs
Sun Oct 22 06:07:35 2006 UTC (18 years, 1 month ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +11 -10 lines
sync with head

Revision 1.103: download - view: text, markup, annotated - select for diffs
Thu Oct 12 01:32:39 2006 UTC (18 years, 2 months ago) by christos
Branches: MAIN
CVS tags: yamt-splraiseipl-base2
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +11 -10 lines
- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386

Revision 1.94.2.5: download - view: text, markup, annotated - select for diffs
Sat Sep 9 02:58:55 2006 UTC (18 years, 3 months ago) by rpaulo
Branches: rpaulo-netinet-merge-pcb
Diff to: previous 1.94.2.4: preferred, colored; branchpoint 1.94: preferred, colored; next MAIN 1.95: preferred, colored
Changes since revision 1.94.2.4: +1145 -281 lines
sync with head

Revision 1.94.6.4: download - view: text, markup, annotated - select for diffs
Sun Sep 3 15:25:42 2006 UTC (18 years, 3 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.94.6.3: preferred, colored; branchpoint 1.94: preferred, colored; next MAIN 1.95: preferred, colored
Changes since revision 1.94.6.3: +6 -10 lines
sync with head.

Revision 1.102: download - view: text, markup, annotated - select for diffs
Wed Aug 30 17:15:22 2006 UTC (18 years, 3 months ago) by christos
Branches: MAIN
CVS tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, rpaulo-netinet-merge-pcb-base
Branch point for: yamt-splraiseipl, newlock2
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +6 -10 lines
remove impossible comparisons.

Revision 1.94.6.3: download - view: text, markup, annotated - select for diffs
Fri Aug 11 15:46:48 2006 UTC (18 years, 4 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.94.6.2: preferred, colored; branchpoint 1.94: preferred, colored
Changes since revision 1.94.6.2: +42 -8 lines
sync with head

Revision 1.101: download - view: text, markup, annotated - select for diffs
Sun Jul 23 22:06:13 2006 UTC (18 years, 4 months ago) by ad
Branches: MAIN
CVS tags: yamt-pdpolicy-base7, abandoned-netbsd-4-base, abandoned-netbsd-4
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +11 -8 lines
Use the LWP cached credentials where sane.

Revision 1.98.4.1: download - view: text, markup, annotated - select for diffs
Thu Jul 13 17:50:06 2006 UTC (18 years, 5 months ago) by gdamore
Branches: gdamore-uart
Diff to: previous 1.98: preferred, colored; next MAIN 1.99: preferred, colored
Changes since revision 1.98: +33 -2 lines
Merge from HEAD.

Revision 1.100: download - view: text, markup, annotated - select for diffs
Wed Jul 12 13:11:27 2006 UTC (18 years, 5 months ago) by tron
Branches: MAIN
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +19 -2 lines
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.

Revision 1.99: download - view: text, markup, annotated - select for diffs
Sat Jul 8 19:58:40 2006 UTC (18 years, 5 months ago) by rpaulo
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +16 -2 lines
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.

Revision 1.88.4.1: download - view: text, markup, annotated - select for diffs
Wed Jun 21 15:11:08 2006 UTC (18 years, 5 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +1416 -499 lines
sync with head.

Revision 1.94.4.2: download - view: text, markup, annotated - select for diffs
Thu Jun 1 22:39:03 2006 UTC (18 years, 6 months ago) by kardel
Branches: simonb-timecounters
CVS tags: simonb-timcounters-final
Diff to: previous 1.94.4.1: preferred, colored; branchpoint 1.94: preferred, colored; next MAIN 1.95: preferred, colored
Changes since revision 1.94.4.1: +1110 -277 lines
Sync with head.

Revision 1.95.4.1: download - view: text, markup, annotated - select for diffs
Wed May 24 15:50:45 2006 UTC (18 years, 6 months ago) by tron
Branches: peter-altq
Diff to: previous 1.95: preferred, colored; next MAIN 1.96: preferred, colored
Changes since revision 1.95: +1109 -275 lines
Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.

Revision 1.94.6.2: download - view: text, markup, annotated - select for diffs
Wed May 24 10:59:09 2006 UTC (18 years, 6 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.94.6.1: preferred, colored; branchpoint 1.94: preferred, colored
Changes since revision 1.94.6.1: +1109 -275 lines
sync with head.

Revision 1.98: download - view: text, markup, annotated - select for diffs
Sun May 14 21:19:34 2006 UTC (18 years, 7 months ago) by elad
Branches: MAIN
CVS tags: yamt-pdpolicy-base6, yamt-pdpolicy-base5, simonb-timecounters-base, gdamore-uart-base, chap-midi-nbase, chap-midi-base, chap-midi
Branch point for: gdamore-uart
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +6 -5 lines
integrate kauth.

Revision 1.95.2.6: download - view: text, markup, annotated - select for diffs
Fri May 12 23:06:36 2006 UTC (18 years, 7 months ago) by elad
Branches: elad-kernelauth
Diff to: previous 1.95.2.5: preferred, colored; branchpoint 1.95: preferred, colored; next MAIN 1.96: preferred, colored
Changes since revision 1.95.2.5: +4 -3 lines
adapt to kauth kpi, include sys/kauth.h where needed..

Revision 1.95.2.5: download - view: text, markup, annotated - select for diffs
Thu May 11 23:31:35 2006 UTC (18 years, 7 months ago) by elad
Branches: elad-kernelauth
Diff to: previous 1.95.2.4: preferred, colored; branchpoint 1.95: preferred, colored
Changes since revision 1.95.2.4: +1106 -278 lines
sync with head

Revision 1.95.2.4: download - view: text, markup, annotated - select for diffs
Sat May 6 23:32:11 2006 UTC (18 years, 7 months ago) by christos
Branches: elad-kernelauth
Diff to: previous 1.95.2.3: preferred, colored; branchpoint 1.95: preferred, colored
Changes since revision 1.95.2.3: +3 -2 lines
- Move kauth_cred_t declaration to <sys/types.h>
- Cleanup struct ucred; forward declarations that are unused.
- Don't include <sys/kauth.h> in any header, but include it in the c files
  that need it.

Approved by core.

Revision 1.97: download - view: text, markup, annotated - select for diffs
Fri May 5 00:03:22 2006 UTC (18 years, 7 months ago) by rpaulo
Branches: MAIN
CVS tags: elad-kernelauth-base
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +1107 -275 lines
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.

Revision 1.94.4.1: download - view: text, markup, annotated - select for diffs
Sat Apr 22 11:40:12 2006 UTC (18 years, 7 months ago) by simonb
Branches: simonb-timecounters
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +6 -5 lines
Sync with head.

Revision 1.95.2.3: download - view: text, markup, annotated - select for diffs
Wed Apr 19 04:46:12 2006 UTC (18 years, 7 months ago) by elad
Branches: elad-kernelauth
Diff to: previous 1.95.2.2: preferred, colored; branchpoint 1.95: preferred, colored
Changes since revision 1.95.2.2: +4 -3 lines
sync with head.

Revision 1.96: download - view: text, markup, annotated - select for diffs
Sat Apr 15 00:28:16 2006 UTC (18 years, 8 months ago) by christos
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +4 -3 lines
Coverity CID 608: #ifdef out dead code.

Revision 1.94.6.1: download - view: text, markup, annotated - select for diffs
Mon Mar 13 09:07:39 2006 UTC (18 years, 9 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +4 -4 lines
sync with head.

Revision 1.95.2.2: download - view: text, markup, annotated - select for diffs
Fri Mar 10 15:20:54 2006 UTC (18 years, 9 months ago) by elad
Branches: elad-kernelauth
Diff to: previous 1.95.2.1: preferred, colored; branchpoint 1.95: preferred, colored
Changes since revision 1.95.2.1: +7 -7 lines
generic_authorize() -> kauth_authorize_generic().

Revision 1.95.2.1: download - view: text, markup, annotated - select for diffs
Wed Mar 8 01:19:40 2006 UTC (18 years, 9 months ago) by elad
Branches: elad-kernelauth
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +10 -7 lines
Adapt to kernel authorization KPI.

Revision 1.95: download - view: text, markup, annotated - select for diffs
Sun Mar 5 23:47:08 2006 UTC (18 years, 9 months ago) by rpaulo
Branches: MAIN
CVS tags: yamt-pdpolicy-base4, yamt-pdpolicy-base3, yamt-pdpolicy-base2, peter-altq-base
Branch point for: peter-altq, elad-kernelauth
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +4 -4 lines
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.

Revision 1.94.2.4: download - view: text, markup, annotated - select for diffs
Thu Feb 23 16:59:20 2006 UTC (18 years, 9 months ago) by rpaulo
Branches: rpaulo-netinet-merge-pcb
Diff to: previous 1.94.2.3: preferred, colored; branchpoint 1.94: preferred, colored
Changes since revision 1.94.2.3: +10 -10 lines
ip6_raw_ctloutput(): s/in6pcb/inpcb
ip6_optlen(): convert to inpcb

Revision 1.94.2.3: download - view: text, markup, annotated - select for diffs
Tue Feb 14 02:25:13 2006 UTC (18 years, 10 months ago) by rpaulo
Branches: rpaulo-netinet-merge-pcb
Diff to: previous 1.94.2.2: preferred, colored; branchpoint 1.94: preferred, colored
Changes since revision 1.94.2.2: +27 -27 lines
in6pcb -> inpcb.

Revision 1.94.2.2: download - view: text, markup, annotated - select for diffs
Tue Feb 7 16:57:16 2006 UTC (18 years, 10 months ago) by rpaulo
Branches: rpaulo-netinet-merge-pcb
Diff to: previous 1.94.2.1: preferred, colored; branchpoint 1.94: preferred, colored
Changes since revision 1.94.2.1: +3 -3 lines
sotoinpcb_hdr -> sotoinpcb.

Revision 1.94.2.1: download - view: text, markup, annotated - select for diffs
Tue Feb 7 04:58:11 2006 UTC (18 years, 10 months ago) by rpaulo
Branches: rpaulo-netinet-merge-pcb
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +3 -3 lines
remove in6_pcb.h and include in_pcb.h.

Revision 1.93.2.1: download - view: text, markup, annotated - select for diffs
Wed Feb 1 14:52:42 2006 UTC (18 years, 10 months ago) by yamt
Branches: yamt-uio_vmspace
Diff to: previous 1.93: preferred, colored; next MAIN 1.94: preferred, colored
Changes since revision 1.93: +254 -235 lines
sync with head.

Revision 1.94: download - view: text, markup, annotated - select for diffs
Sat Jan 21 00:15:36 2006 UTC (18 years, 10 months ago) by rpaulo
Branches: MAIN
CVS tags: yamt-uio_vmspace-base5, yamt-pdpolicy-base
Branch point for: yamt-pdpolicy, simonb-timecounters, rpaulo-netinet-merge-pcb
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +254 -235 lines
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@.

Revision 1.93: download - view: text, markup, annotated - select for diffs
Sun Dec 11 12:25:02 2005 UTC (19 years ago) by christos
Branches: MAIN
Branch point for: yamt-uio_vmspace
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +2 -2 lines
merge ktrace-lwp.

Revision 1.61.2.7: download - view: text, markup, annotated - select for diffs
Thu Nov 10 14:11:25 2005 UTC (19 years, 1 month ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.61.2.6: preferred, colored; next MAIN 1.62: preferred, colored
Changes since revision 1.61.2.6: +70 -6 lines
Sync with HEAD. Here we go again...

Revision 1.92: download - view: text, markup, annotated - select for diffs
Fri Sep 23 21:21:58 2005 UTC (19 years, 2 months ago) by christos
Branches: MAIN
CVS tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, thorpej-vnode-attr-base, thorpej-vnode-attr, ktrace-lwp-base
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +3 -3 lines
change bcopy to memmove since this was supposed to be an ovbcopy (from kre)

Revision 1.91: download - view: text, markup, annotated - select for diffs
Thu Aug 18 00:30:59 2005 UTC (19 years, 3 months ago) by yamt
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +3 -5 lines
- introduce M_MOVE_PKTHDR and use it where appropriate.
  intended to be mostly API compatible with openbsd/freebsd.
- remove a glue #define in netipsec/ipsec_osdep.h.

Revision 1.90: download - view: text, markup, annotated - select for diffs
Wed Aug 10 13:08:11 2005 UTC (19 years, 4 months ago) by yamt
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +17 -4 lines
re-implement ipv6 tx loopback checksum omission.

Revision 1.89: download - view: text, markup, annotated - select for diffs
Wed Aug 10 12:58:37 2005 UTC (19 years, 4 months ago) by yamt
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +55 -2 lines
ipv6 tx checksum offloading.  reviewed by Jason Thorpe.

Revision 1.87.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 29 11:29:34 2005 UTC (19 years, 7 months ago) by kent
Branches: kent-audio2
Diff to: previous 1.87: preferred, colored; next MAIN 1.88: preferred, colored
Changes since revision 1.87: +5 -3 lines
sync with -current

Revision 1.87.4.1: download - view: text, markup, annotated - select for diffs
Sat Mar 19 08:36:41 2005 UTC (19 years, 8 months ago) by yamt
Branches: yamt-km
Diff to: previous 1.87: preferred, colored; next MAIN 1.88: preferred, colored
Changes since revision 1.87: +5 -3 lines
sync with head.  xen and whitespace.  xen part is not finished.

Revision 1.61.2.6: download - view: text, markup, annotated - select for diffs
Fri Mar 4 16:53:30 2005 UTC (19 years, 9 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.61.2.5: preferred, colored
Changes since revision 1.61.2.5: +5 -3 lines
Sync with HEAD.

Hi Perry!

Revision 1.88: download - view: text, markup, annotated - select for diffs
Mon Feb 28 09:27:07 2005 UTC (19 years, 9 months ago) by itojun
Branches: MAIN
CVS tags: yamt-km-base4, yamt-km-base3, netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3, kent-audio2-base
Branch point for: yamt-lazymbuf
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +5 -3 lines
make ip6_getpmtu back to static

Revision 1.61.2.5: download - view: text, markup, annotated - select for diffs
Mon Jan 17 19:32:55 2005 UTC (19 years, 10 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.61.2.4: preferred, colored
Changes since revision 1.61.2.4: +35 -30 lines
Sync with HEAD.

Revision 1.87: download - view: text, markup, annotated - select for diffs
Tue Dec 21 11:37:47 2004 UTC (19 years, 11 months ago) by drochner
Branches: MAIN
CVS tags: yamt-km-base2, yamt-km-base, kent-audio1-beforemerge
Branch point for: yamt-km, kent-audio2
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +35 -30 lines
fix ifindex argument checks for IPV6_JOIN_GROUP,
IPV6_LEAVE_GROUP and IPV6_MULTICAST_IF -
0 is always legal

Revision 1.61.2.4: download - view: text, markup, annotated - select for diffs
Sat Dec 18 09:33:06 2004 UTC (19 years, 11 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.61.2.3: preferred, colored
Changes since revision 1.61.2.3: +6 -11 lines
Sync with HEAD.

Revision 1.86: download - view: text, markup, annotated - select for diffs
Sat Dec 4 16:10:25 2004 UTC (20 years ago) by peter
Branches: MAIN
CVS tags: kent-audio1-base, kent-audio1
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +6 -11 lines
Convert lo(4) to a clonable device.

This also removes the loif array and changes all code to use the new
lo0ifp pointer which points to the lo0 ifnet structure.

Approved by christos.

Revision 1.61.2.3: download - view: text, markup, annotated - select for diffs
Tue Sep 21 13:37:35 2004 UTC (20 years, 2 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.61.2.2: preferred, colored
Changes since revision 1.61.2.2: +2 -2 lines
Fix the sync with head I botched.

Revision 1.61.2.2: download - view: text, markup, annotated - select for diffs
Sat Sep 18 14:55:15 2004 UTC (20 years, 2 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.61.2.1: preferred, colored
Changes since revision 1.61.2.1: +0 -0 lines
Sync with HEAD.

Revision 1.61.2.1: download - view: text, markup, annotated - select for diffs
Tue Aug 3 10:55:13 2004 UTC (20 years, 4 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +205 -88 lines
Sync with HEAD

Revision 1.85: download - view: text, markup, annotated - select for diffs
Wed Jul 14 03:06:08 2004 UTC (20 years, 5 months ago) by itojun
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +7 -3 lines
- update ro_pmtu on IPsec tunnel encapsulation.  ro != ro_pmtu is used as the
  sign for the existence of routing header.
- fragment to 1280 on IPv6-over-IPv6 encapsulation, as ICMPv6 too big may not
  give you enough information to update pmtu cache.

from iij seil team, via kame.

Revision 1.84: download - view: text, markup, annotated - select for diffs
Tue Jul 6 04:30:29 2004 UTC (20 years, 5 months ago) by minoura
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +4 -3 lines
Remove broken code for now: getsockopt(s, IPPROTO_IP, IP_IPSEC_POLICY,...).
It returned EINVAL, now returns ENOPROTOOPT.
Ok'd by itojun.

Revision 1.82.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 14 18:01:09 2004 UTC (20 years, 6 months ago) by tron
Branches: netbsd-2-0
CVS tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2
Diff to: previous 1.82: preferred, colored; next MAIN 1.83: preferred, colored
Changes since revision 1.82: +12 -2 lines
Pull up revision 1.83 (requested by itojun in ticket #468):
implement IPV6_USE_MIN_MTU sockopt.  needed by bind9 + EDNS0 + big receive buffer.

Revision 1.44.4.5: download - view: text, markup, annotated - select for diffs
Mon Jun 14 02:47:57 2004 UTC (20 years, 6 months ago) by jmc
Branches: netbsd-1-6
Diff to: previous 1.44.4.4: preferred, colored; branchpoint 1.44: preferred, colored; next MAIN 1.45: preferred, colored
Changes since revision 1.44.4.4: +12 -2 lines
Pullup rev 1.83 (requested by itojun in ticket #1709)

Implement IPV6_USE_MIN_MTU sockopt.

Revision 1.83: download - view: text, markup, annotated - select for diffs
Fri Jun 11 04:10:10 2004 UTC (20 years, 6 months ago) by itojun
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +12 -2 lines
implement IPV6_USE_MIN_MTU sockopt.  needed by bind9 + EDNS0 + big receive buffer.

Revision 1.82: download - view: text, markup, annotated - select for diffs
Tue Mar 23 18:21:38 2004 UTC (20 years, 8 months ago) by martti
Branches: MAIN
CVS tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +3 -5 lines
Make ip6_getpmtu() globally visible. This is needed by IPFilter 4.x.

Revision 1.81: download - view: text, markup, annotated - select for diffs
Tue Mar 2 02:28:28 2004 UTC (20 years, 9 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +9 -3 lines
Use the new IPSEC_PCB_SKIP_IPSEC() to bypass a socket policy lookup
when possible.  This shaves several cycles from the output path for
non-IPsec connections, even if the policy is cached in the PCB.

Revision 1.80: download - view: text, markup, annotated - select for diffs
Mon Mar 1 22:32:35 2004 UTC (20 years, 9 months ago) by itojun
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +6 -6 lines
knf

Revision 1.44.4.4: download - view: text, markup, annotated - select for diffs
Sat Feb 7 20:06:04 2004 UTC (20 years, 10 months ago) by jmc
Branches: netbsd-1-6
CVS tags: netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002
Diff to: previous 1.44.4.3: preferred, colored; branchpoint 1.44: preferred, colored
Changes since revision 1.44.4.3: +173 -88 lines
Pullup rev 1.78 (requested by itojun in ticket #1605)

Strictly follow RFC2460 section 5 last paragraph (sending rule when
PMTU < 1280).

Revision 1.79: download - view: text, markup, annotated - select for diffs
Fri Feb 6 08:07:55 2004 UTC (20 years, 10 months ago) by itojun
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +2 -10 lines
remove unneeded #ifdef

Revision 1.78: download - view: text, markup, annotated - select for diffs
Wed Feb 4 05:17:28 2004 UTC (20 years, 10 months ago) by itojun
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +114 -30 lines
strictly follow RFC2460 section 5 last paragraph
(sending rule when PMTU < 1280).  pointed out by guninski at guninski.com

Revision 1.77: download - view: text, markup, annotated - select for diffs
Sat Jan 24 13:02:41 2004 UTC (20 years, 10 months ago) by darrenr
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +3 -5 lines
make ip6_getpmtu() externally visible

Revision 1.76: download - view: text, markup, annotated - select for diffs
Mon Jan 19 05:14:58 2004 UTC (20 years, 10 months ago) by itojun
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +9 -2 lines
do not lookup security policy if IPV6_FORWARDING.
avoids possible infinite ipsec encapsulation on
        ip6_input -> ip6_forward -(tunnel mode)-> ip6_output
case.  from kame

Revision 1.75: download - view: text, markup, annotated - select for diffs
Wed Dec 10 22:35:35 2003 UTC (21 years ago) by itojun
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +6 -5 lines
fix cases where pktinfo specifies outgoing interface of "0".

Revision 1.74: download - view: text, markup, annotated - select for diffs
Wed Dec 10 11:46:33 2003 UTC (21 years ago) by itojun
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +12 -8 lines
use if_indexlim (instead of if_index) and ifindex2ifnet[x] != NULL
to check if interface exists, as (1) if_index has different meaning
(2) ifindex2ifnet could become NULL when interface gets destroyed,
since when we have introduced dynamically-created interfaces.  from kame

Revision 1.73: download - view: text, markup, annotated - select for diffs
Thu Nov 6 06:10:51 2003 UTC (21 years, 1 month ago) by itojun
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +5 -5 lines
correct behavior when ipv6mr_interface is 0.  Matthias Drochner

Revision 1.72: download - view: text, markup, annotated - select for diffs
Thu Oct 30 01:43:09 2003 UTC (21 years, 1 month ago) by simonb
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +2 -5 lines
Remove some assigned-to but otherwise unused variables.

Revision 1.71: download - view: text, markup, annotated - select for diffs
Fri Oct 3 20:56:11 2003 UTC (21 years, 2 months ago) by itojun
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +3 -2 lines
when dropping M_PKTHDR, need to free m_tag associated with it.

Revision 1.44.4.3: download - view: text, markup, annotated - select for diffs
Thu Oct 2 20:29:06 2003 UTC (21 years, 2 months ago) by tron
Branches: netbsd-1-6
CVS tags: netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1
Diff to: previous 1.44.4.2: preferred, colored; branchpoint 1.44: preferred, colored
Changes since revision 1.44.4.2: +3 -3 lines
Pull up revision 1.54 via patch (requested by itojun in ticket #1491):
sync with latest KAME in6_ifaddr/prefix/default router manipulation.
behavior changes:
- two iocts used by ndp(8) are now obsolete (backward compat provided).
  use sysctl path instead.
- lo0 does not get ::1 automatically.  it will get ::1 when lo0 comes up.

Revision 1.70: download - view: text, markup, annotated - select for diffs
Sat Sep 6 03:36:33 2003 UTC (21 years, 3 months ago) by itojun
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +3 -3 lines
randomize IPv4/v6 fragment ID and IPv6 flowlabel.  avoids predictability
of these fields.  ip_id.c is from openbsd.  ip6_id.c is adapted by kame.

Revision 1.69: download - view: text, markup, annotated - select for diffs
Fri Sep 5 23:20:50 2003 UTC (21 years, 3 months ago) by itojun
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +4 -4 lines
u_short -> u_int16_t.  sync w/ kame.
don't set ip6_plen where unneeded (i.e. before calling ip6_output)

Revision 1.68: download - view: text, markup, annotated - select for diffs
Thu Sep 4 03:07:33 2003 UTC (21 years, 3 months ago) by itojun
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +7 -3 lines
don't use m_cat to mbuf of different types.  KAME-PR-495

Revision 1.67: download - view: text, markup, annotated - select for diffs
Mon Aug 25 00:10:27 2003 UTC (21 years, 3 months ago) by itojun
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +42 -25 lines
don't commit value into ip6_ptkopts until the validation is done.
(note: the code will be updated with 2292bis definition soon, hopefully)

Revision 1.66: download - view: text, markup, annotated - select for diffs
Fri Aug 22 22:00:40 2003 UTC (21 years, 3 months ago) by itojun
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +2 -5 lines
remove ipsec_set/getsocket.  now we explicitly pass socket * to ip{,6}_output.

Revision 1.65: download - view: text, markup, annotated - select for diffs
Fri Aug 22 21:53:08 2003 UTC (21 years, 3 months ago) by itojun
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +4 -6 lines
change the additional arg to be passed to ip{,6}_output to struct socket *.

this fixes KAME policy lookup which was broken by the previous commit.

Revision 1.64: download - view: text, markup, annotated - select for diffs
Fri Aug 22 20:29:01 2003 UTC (21 years, 3 months ago) by jonathan
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +3 -3 lines
Change KAME code for ip_output()/ip6_output() to obtain struct socket*
from the explicit inpcb*/in6pcb* argument.  set_socket() becomes redundant.

Revision 1.63: download - view: text, markup, annotated - select for diffs
Fri Aug 22 20:20:09 2003 UTC (21 years, 3 months ago) by jonathan
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +6 -4 lines
Replace the set_socket() method of passing an extra struct socket*
argument to ip6_output() with a new explicit struct in6pcb* argument.
(The underlying socket can be obtained via in6pcb->inp6_socket.)

In preparation for fast-ipsec.  Reviewed by itojun.

Revision 1.62: download - view: text, markup, annotated - select for diffs
Thu Aug 7 16:33:28 2003 UTC (21 years, 4 months ago) by agc
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +3 -7 lines
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.

Revision 1.61: download - view: text, markup, annotated - select for diffs
Fri Jun 6 08:13:43 2003 UTC (21 years, 6 months ago) by itojun
Branches: MAIN
Branch point for: ktrace-lwp
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +7 -6 lines
- sync up MLD declaration with RFC3542 (s/MLD6/MLD/)
- routing header declaration with RFC3542
  (note: sizeof(ip6_rthdr0) has changed!)
  also, sync up with RFC2460 routing header definition (no "strict" source
  routing mode any more)

part of advanced API update (RFC2292 -> 3542).

Revision 1.31.2.14: download - view: text, markup, annotated - select for diffs
Mon Nov 11 22:15:48 2002 UTC (22 years, 1 month ago) by nathanw
Branches: nathanw_sa
CVS tags: nathanw_sa_end
Diff to: previous 1.31.2.13: preferred, colored; next MAIN 1.32: preferred, colored
Changes since revision 1.31.2.13: +5 -5 lines
Catch up to -current

Revision 1.60: download - view: text, markup, annotated - select for diffs
Sat Nov 2 07:30:58 2002 UTC (22 years, 1 month ago) by perry
Branches: MAIN
CVS tags: nathanw_sa_before_merge, nathanw_sa_base, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +5 -5 lines
/*CONTCOND*/ while (0)'ed macros

Revision 1.59: download - view: text, markup, annotated - select for diffs
Thu Oct 31 17:36:16 2002 UTC (22 years, 1 month ago) by itojun
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +4 -4 lines
plug a memory leak.  from sam leffler.  sync w/kame

Revision 1.31.2.13: download - view: text, markup, annotated - select for diffs
Fri Oct 18 02:45:23 2002 UTC (22 years, 1 month ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.31.2.12: preferred, colored
Changes since revision 1.31.2.12: +1 -1 lines
Catch up to -current.

Revision 1.44.4.2: download - view: text, markup, annotated - select for diffs
Sun Oct 13 22:39:05 2002 UTC (22 years, 2 months ago) by lukem
Branches: netbsd-1-6
CVS tags: netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001
Diff to: previous 1.44.4.1: preferred, colored; branchpoint 1.44: preferred, colored
Changes since revision 1.44.4.1: +3 -3 lines
Pull up revision 1.58 (requested by itojun in ticket #855):
length field on PADN option, before jumbo payload option was wrong.
sync w/kame

Revision 1.36.2.3: download - view: text, markup, annotated - select for diffs
Thu Oct 10 18:44:19 2002 UTC (22 years, 2 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.36.2.2: preferred, colored; branchpoint 1.36: preferred, colored; next MAIN 1.37: preferred, colored
Changes since revision 1.36.2.2: +56 -56 lines
sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work

Revision 1.23.2.7: download - view: text, markup, annotated - select for diffs
Mon Sep 23 13:48:36 2002 UTC (22 years, 2 months ago) by itojun
Branches: netbsd-1-5
Diff to: previous 1.23.2.6: preferred, colored; branchpoint 1.23: preferred, colored; next MAIN 1.24: preferred, colored
Changes since revision 1.23.2.6: +2 -2 lines
Correct length field on PADN option, before jumbo payload option.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Mon Sep 23 13:28:55 2002 UTC (22 years, 2 months ago) by itojun
Branches: MAIN
CVS tags: kqueue-beforemerge, kqueue-base, kqueue-aftermerge
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +3 -3 lines
length field on PADN option, before jumbo payload option was wrong.
sync w/kame

Revision 1.31.2.12: download - view: text, markup, annotated - select for diffs
Tue Sep 17 21:23:25 2002 UTC (22 years, 2 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.31.2.11: preferred, colored
Changes since revision 1.31.2.11: +55 -55 lines
Catch up to -current.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Wed Sep 11 02:46:45 2002 UTC (22 years, 3 months ago) by itojun
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +51 -51 lines
KNF - return is not a function.  sync w/kame.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Wed Sep 11 02:41:26 2002 UTC (22 years, 3 months ago) by itojun
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +6 -6 lines
correct signedness mixup in pointer passing.  sync w/kame

Revision 1.31.2.11: download - view: text, markup, annotated - select for diffs
Fri Jul 12 01:40:33 2002 UTC (22 years, 5 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.31.2.10: preferred, colored
Changes since revision 1.31.2.10: +2 -3 lines
No longer need to pull in lwp.h; proc.h pulls it in for us.

Revision 1.31.2.10: download - view: text, markup, annotated - select for diffs
Mon Jun 24 22:11:52 2002 UTC (22 years, 5 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.31.2.9: preferred, colored
Changes since revision 1.31.2.9: +5 -5 lines
Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).

Revision 1.36.2.2: download - view: text, markup, annotated - select for diffs
Sun Jun 23 17:51:16 2002 UTC (22 years, 5 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.36.2.1: preferred, colored; branchpoint 1.36: preferred, colored
Changes since revision 1.36.2.1: +216 -145 lines
catch up with -current on kqueue branch

Revision 1.44.2.2: download - view: text, markup, annotated - select for diffs
Thu Jun 20 15:52:46 2002 UTC (22 years, 5 months ago) by gehenna
Branches: gehenna-devsw
Diff to: previous 1.44.2.1: preferred, colored; branchpoint 1.44: preferred, colored; next MAIN 1.45: preferred, colored
Changes since revision 1.44.2.1: +146 -103 lines
catch up with -current.

Revision 1.31.2.9: download - view: text, markup, annotated - select for diffs
Thu Jun 20 03:49:22 2002 UTC (22 years, 5 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.31.2.8: preferred, colored
Changes since revision 1.31.2.8: +216 -146 lines
Catch up to -current.

Revision 1.55: download - view: text, markup, annotated - select for diffs
Sun Jun 9 14:43:12 2002 UTC (22 years, 6 months ago) by itojun
Branches: MAIN
CVS tags: gehenna-devsw-base
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +3 -3 lines
whitespace cleanup

Revision 1.54: download - view: text, markup, annotated - select for diffs
Sat Jun 8 21:22:33 2002 UTC (22 years, 6 months ago) by itojun
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +3 -3 lines
sync with latest KAME in6_ifaddr/prefix/default router manipulation.
behavior changes:
- two iocts used by ndp(8) are now obsolete (backward compat provided).
  use sysctl path instead.
- lo0 does not get ::1 automatically.  it will get ::1 when lo0 comes up.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Fri Jun 7 22:03:02 2002 UTC (22 years, 6 months ago) by itojun
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +78 -2 lines
sync IPV6_CHECKSUM handling with kame.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Fri Jun 7 17:13:56 2002 UTC (22 years, 6 months ago) by itojun
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +6 -2 lines
comment

Revision 1.51: download - view: text, markup, annotated - select for diffs
Fri Jun 7 14:48:56 2002 UTC (22 years, 6 months ago) by itojun
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +4 -5 lines
whitespace

Revision 1.50: download - view: text, markup, annotated - select for diffs
Fri Jun 7 14:43:11 2002 UTC (22 years, 6 months ago) by itojun
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +2 -14 lines
remove #if 0'ed portion

Revision 1.49: download - view: text, markup, annotated - select for diffs
Fri Jun 7 14:29:10 2002 UTC (22 years, 6 months ago) by itojun
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +56 -80 lines
KNF a bit

Revision 1.48: download - view: text, markup, annotated - select for diffs
Fri Jun 7 04:18:12 2002 UTC (22 years, 6 months ago) by itojun
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +7 -7 lines
typo

Revision 1.47: download - view: text, markup, annotated - select for diffs
Fri Jun 7 04:07:55 2002 UTC (22 years, 6 months ago) by itojun
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +7 -7 lines
'fall through' is not a valid LINT keyword.

Revision 1.44.4.1: download - view: text, markup, annotated - select for diffs
Wed Jun 5 03:50:25 2002 UTC (22 years, 6 months ago) by lukem
Branches: netbsd-1-6
CVS tags: netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +6 -4 lines
Pull up revision 1.46 (via patch) (requested by itojun in ticket #123):
do not try to update rmx_mtu if rmx_mtu == 0 (obey ifmtu)

Revision 1.46: download - view: text, markup, annotated - select for diffs
Fri May 31 03:18:54 2002 UTC (22 years, 6 months ago) by itojun
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +6 -6 lines
do not try to update rmx_mtu if rmx_mtu == 0 (obey ifmtu)

Revision 1.44.2.1: download - view: text, markup, annotated - select for diffs
Thu May 30 13:52:33 2002 UTC (22 years, 6 months ago) by gehenna
Branches: gehenna-devsw
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +76 -49 lines
Catch up with -current.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Wed May 29 07:53:41 2002 UTC (22 years, 6 months ago) by itojun
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +76 -49 lines
attach nd_ifinfo structure into if_afdata.
split IPv6 link MTU (advertised by RA) from real link MTU.
sync with kame

Revision 1.31.2.8: download - view: text, markup, annotated - select for diffs
Mon Apr 1 07:48:51 2002 UTC (22 years, 8 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.31.2.7: preferred, colored
Changes since revision 1.31.2.7: +4 -3 lines
Catch up to -current.
(CVS: It's not just a program. It's an adventure!)

Revision 1.44: download - view: text, markup, annotated - select for diffs
Thu Mar 28 01:33:50 2002 UTC (22 years, 8 months ago) by itojun
Branches: MAIN
CVS tags: netbsd-1-6-base
Branch point for: netbsd-1-6, gehenna-devsw
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +4 -3 lines
make sure to check address family in route cache
(I really hate IPv4 mapped address...)

Revision 1.23.2.6: download - view: text, markup, annotated - select for diffs
Tue Feb 26 20:14:37 2002 UTC (22 years, 9 months ago) by he
Branches: netbsd-1-5
CVS tags: netbsd-1-5-PATCH003
Diff to: previous 1.23.2.5: preferred, colored; branchpoint 1.23: preferred, colored
Changes since revision 1.23.2.5: +4 -2 lines
Apply patch (requested by martti):
  Fix it so that IPFilter handles IPv6 traffic.

Revision 1.36.2.1: download - view: text, markup, annotated - select for diffs
Thu Jan 10 20:03:22 2002 UTC (22 years, 11 months ago) by thorpej
Branches: kqueue
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +91 -100 lines
Sync kqueue branch with -current.

Revision 1.31.2.7: download - view: text, markup, annotated - select for diffs
Tue Jan 8 00:34:21 2002 UTC (22 years, 11 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.31.2.6: preferred, colored
Changes since revision 1.31.2.6: +22 -21 lines
Catch up to -current.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Thu Dec 20 07:26:37 2001 UTC (22 years, 11 months ago) by itojun
Branches: MAIN
CVS tags: newlock-base, newlock, ifpoll-base, eeh-devprop-base, eeh-devprop
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +11 -16 lines
centralize multicast group management (in6_join/leavegroup).
have a flag for ip6_output() to fragment to minimum MTU.
sync with kame

Revision 1.42: download - view: text, markup, annotated - select for diffs
Tue Dec 18 03:04:04 2001 UTC (22 years, 11 months ago) by itojun
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +13 -7 lines
reduce white space/cosmetic diffs w/kame.

Revision 1.31.2.6: download - view: text, markup, annotated - select for diffs
Wed Nov 14 19:18:10 2001 UTC (23 years, 1 month ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.31.2.5: preferred, colored
Changes since revision 1.31.2.5: +5 -2 lines
Catch up to -current.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Tue Nov 13 00:57:02 2001 UTC (23 years, 1 month ago) by lukem
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +4 -1 lines
add RCSIDs

Revision 1.39.2.1: download - view: text, markup, annotated - select for diffs
Mon Nov 12 21:19:32 2001 UTC (23 years, 1 month ago) by thorpej
Branches: thorpej-mips-cache
Diff to: previous 1.39: preferred, colored; next MAIN 1.40: preferred, colored
Changes since revision 1.39: +2 -2 lines
Sync the thorpej-mips-cache branch with -current.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Wed Oct 24 06:36:38 2001 UTC (23 years, 1 month ago) by itojun
Branches: MAIN
CVS tags: thorpej-mips-cache-base
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +2 -2 lines
more whitespace sync with kame

Revision 1.31.2.5: download - view: text, markup, annotated - select for diffs
Mon Oct 22 20:42:03 2001 UTC (23 years, 1 month ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.31.2.4: preferred, colored
Changes since revision 1.31.2.4: +67 -80 lines
Catch up to -current.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Thu Oct 18 07:44:34 2001 UTC (23 years, 1 month ago) by itojun
Branches: MAIN
Branch point for: thorpej-mips-cache
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +1 -11 lines
reduce diffs with kame (mostly cosmetic).
move IPV6_CHECKSUM processing to sys/netinet6/raw_ip6.c.
constify a couple of places.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Wed Oct 17 08:23:06 2001 UTC (23 years, 2 months ago) by itojun
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +1 -12 lines
unifdef OLDIP6OUTPUT

Revision 1.37: download - view: text, markup, annotated - select for diffs
Mon Oct 15 09:51:17 2001 UTC (23 years, 2 months ago) by itojun
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +70 -62 lines
implement IPV6_V6ONLY socket option from draft-ietf-ipngwg-rfc2553bis-03.txt.
IPV6_BINDV6ONLY (netbsd only) is deprecated, but still work just like before.

Revision 1.31.2.4: download - view: text, markup, annotated - select for diffs
Thu Jun 21 20:08:59 2001 UTC (23 years, 5 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.31.2.3: preferred, colored
Changes since revision 1.31.2.3: +9 -6 lines
Catch up to -current.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Mon Jun 11 13:49:18 2001 UTC (23 years, 6 months ago) by itojun
Branches: MAIN
CVS tags: thorpej-devvp-base3, thorpej-devvp-base2, thorpej-devvp-base, thorpej-devvp, pre-chs-ubcperf, post-chs-ubcperf
Branch point for: kqueue
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +1 -5 lines
remove IPV6FIREWALL case, which is never used

Revision 1.23.2.5: download - view: text, markup, annotated - select for diffs
Sun Apr 22 18:11:17 2001 UTC (23 years, 7 months ago) by he
Branches: netbsd-1-5
CVS tags: netbsd-1-5-PATCH002, netbsd-1-5-PATCH001
Diff to: previous 1.23.2.4: preferred, colored; branchpoint 1.23: preferred, colored
Changes since revision 1.23.2.4: +9 -2 lines
Pull up revision 1.35 (requested by itojun):
  Disallow addresses that are not supposed to be put into IPv6
  source, on IPV6_PKTINFO setsockopt.

Revision 1.8.2.5: download - view: text, markup, annotated - select for diffs
Sat Apr 21 17:46:56 2001 UTC (23 years, 7 months ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.8.2.4: preferred, colored; branchpoint 1.8: preferred, colored; next MAIN 1.9: preferred, colored
Changes since revision 1.8.2.4: +18 -25 lines
Sync with HEAD

Revision 1.35: download - view: text, markup, annotated - select for diffs
Wed Apr 11 04:57:53 2001 UTC (23 years, 8 months ago) by itojun
Branches: MAIN
CVS tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +9 -2 lines
disallow userland programs from specifying addresses with IPV6_PKTINFO
setsockopt, if:
- the address is not verified by DAD (= not ready)
- the address is an anycast address (= not permitted as source)
sync with kame

Revision 1.31.2.3: download - view: text, markup, annotated - select for diffs
Mon Apr 9 01:58:41 2001 UTC (23 years, 8 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.31.2.2: preferred, colored
Changes since revision 1.31.2.2: +16 -27 lines
Catch up with -current.

Revision 1.23.2.4: download - view: text, markup, annotated - select for diffs
Fri Apr 6 00:28:02 2001 UTC (23 years, 8 months ago) by he
Branches: netbsd-1-5
Diff to: previous 1.23.2.3: preferred, colored; branchpoint 1.23: preferred, colored
Changes since revision 1.23.2.3: +10 -2 lines
Pull up revision 1.28 (requested by itojun):
  Record IPsec packet history in m_aux structure.  Let ipfilter
  look at wire-format packet only (not the decapsulated ones), so
  that VPN setting can work with NAT/ipfilter settings.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Fri Mar 30 11:08:57 2001 UTC (23 years, 8 months ago) by itojun
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +10 -24 lines
enable FAKE_LOOPBACK_IF case by default.
now traffic on loopback interface will be presented to bpf as normal wire
format packet (without KAME scopeid in s6_addr16[1]).

fix KAME PR 250 (host mistakenly accepts packets to fe80::x%lo0).

sync with kame.

Revision 1.8.2.4: download - view: text, markup, annotated - select for diffs
Tue Mar 27 15:32:38 2001 UTC (23 years, 8 months ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.8.2.3: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.3: +7 -4 lines
Sync with HEAD.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Sun Mar 25 09:58:43 2001 UTC (23 years, 8 months ago) by itojun
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +3 -3 lines
re-initialize mopt in ip6_insert_jumboopt().  sync with kame
From: csapuntz@stanford.edu

Revision 1.32: download - view: text, markup, annotated - select for diffs
Wed Mar 21 07:52:14 2001 UTC (23 years, 8 months ago) by itojun
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +6 -3 lines
set rmx_mtu to L2 interface mtu, instead of 0, on mtudisc timeout.
ip6_output() change is for safety.  sync with kame

Revision 1.31.2.2: download - view: text, markup, annotated - select for diffs
Tue Mar 13 20:29:50 2001 UTC (23 years, 9 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.31.2.1: preferred, colored
Changes since revision 1.31.2.1: +3 -3 lines
Be more careful not to dereference curproc when there might not be
a process context.

Revision 1.31.2.1: download - view: text, markup, annotated - select for diffs
Mon Mar 5 22:49:57 2001 UTC (23 years, 9 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +5 -4 lines
Initial commit of scheduler activations and lightweight process support.

Revision 1.23.2.3: download - view: text, markup, annotated - select for diffs
Mon Feb 26 17:01:56 2001 UTC (23 years, 9 months ago) by he
Branches: netbsd-1-5
Diff to: previous 1.23.2.2: preferred, colored; branchpoint 1.23: preferred, colored
Changes since revision 1.23.2.2: +2 -2 lines
Pull up revision 1.30 (requested by itojun):
  Remove a misplaced semicolon after ``if'' conditional.

Revision 1.8.2.3: download - view: text, markup, annotated - select for diffs
Sun Feb 11 19:17:26 2001 UTC (23 years, 10 months ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.8.2.2: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.2: +45 -23 lines
Sync with HEAD.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Sat Feb 10 04:14:28 2001 UTC (23 years, 10 months ago) by itojun
Branches: MAIN
Branch point for: nathanw_sa
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +21 -20 lines
to sync with kame better, (1) remove register declaration for variables,
(2) sync whitespaces, (3) update comments. (4) bring in some of portability
and logging enhancements.  no functional changes here.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Tue Feb 6 01:27:29 2001 UTC (23 years, 10 months ago) by itojun
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +2 -2 lines
bad semicolon after "if" conditional.  sync with kame

Revision 1.23.2.2: download - view: text, markup, annotated - select for diffs
Sun Feb 4 19:22:08 2001 UTC (23 years, 10 months ago) by he
Branches: netbsd-1-5
Diff to: previous 1.23.2.1: preferred, colored; branchpoint 1.23: preferred, colored
Changes since revision 1.23.2.1: +2212 -0 lines
Pull up revision 1.29 (via patch, requested by itojun):
  Avoid panic when a packet with nonexistent link-local address is
  issued.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Fri Feb 2 15:54:56 2001 UTC (23 years, 10 months ago) by itojun
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +16 -3 lines
avoid panic when a packet with nonexistent link-local address is issued.
kame 1.151 -> 1.152.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Wed Jan 24 09:04:17 2001 UTC (23 years, 10 months ago) by itojun
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +10 -2 lines
- record IPsec packet history into m_aux structure.
- let ipfilter look at wire-format packet only (not the decapsulated ones),
  so that VPN setting can work with NAT/ipfilter settings.
sync with kame.

TODO: use header history for stricter inbound validation

Revision 1.8.2.2: download - view: text, markup, annotated - select for diffs
Wed Nov 22 16:06:22 2000 UTC (24 years ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.8.2.1: preferred, colored; branchpoint 1.8: preferred, colored
Changes since revision 1.8.2.1: +11 -20 lines
Sync with HEAD.

Revision 1.8.2.1: download - view: text, markup, annotated - select for diffs
Mon Nov 20 18:10:53 2000 UTC (24 years ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +348 -146 lines
Update thorpej_scsipi to -current as of a month ago

Revision 1.27: download - view: text, markup, annotated - select for diffs
Sat Nov 11 00:52:39 2000 UTC (24 years, 1 month ago) by thorpej
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +11 -20 lines
Restructure the PFIL_HOOKS mechanism a bit:
- All packets are passed to PFIL_HOOKS as they come off the wire, i.e.
  fields in protocol headers in network order, etc.
- Allow for multiple hooks to be registered, using a "key" and a "dlt".
  The "dlt" is a BPF data link type, indicating what type of header is
  present.
- INET and INET6 register with key == AF_INET or AF_INET6, and
  dlt == DLT_RAW.
- PFIL_HOOKS now take an argument for the filter hook, and mbuf **,
  an ifnet *, and a direction (PFIL_IN or PFIL_OUT), thus making them
  less IP (really, IP Filter) centric.

Maintain compatibility with IP Filter by adding wrapper functions for
IP Filter.

Revision 1.26: download - view: text, markup, annotated - select for diffs
Mon Oct 23 03:45:25 2000 UTC (24 years, 1 month ago) by itojun
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +13 -17 lines
make IFA_STATS really work on IPv6.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Sat Aug 19 08:15:54 2000 UTC (24 years, 3 months ago) by itojun
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +48 -17 lines
- icmp6 nodeinfo: remove possibility of unaligned pointer access.
- jumbo payload output: fix incorrect mbuf manipulation
- pedant: align issues, mbuf assumption
(sync with kame)

Revision 1.24: download - view: text, markup, annotated - select for diffs
Thu Jul 6 12:51:41 2000 UTC (24 years, 5 months ago) by itojun
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +2 -3 lines
remove unnecessary #include <netkey/key_debug.h>.  from kame.

Revision 1.21.2.1: download - view: text, markup, annotated - select for diffs
Thu Jun 22 17:10:02 2000 UTC (24 years, 5 months ago) by minoura
Branches: minoura-xpg4dl
Diff to: previous 1.21: preferred, colored; next MAIN 1.22: preferred, colored
Changes since revision 1.21: +52 -16 lines
Sync w/ netbsd-1-5-base.

Revision 1.23.2.1
Tue Jun 20 02:24:42 2000 UTC (24 years, 5 months ago) by he
Branches: netbsd-1-5
FILE REMOVED
Changes since revision 1.23: +0 -2199 lines
file ip6_output.c was added on branch netbsd-1-5 on 2001-02-04 19:22:08 +0000

Revision 1.23: download - view: text, markup, annotated - select for diffs
Tue Jun 20 02:24:42 2000 UTC (24 years, 5 months ago) by itojun
Branches: MAIN
CVS tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2
Branch point for: netbsd-1-5
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +4 -4 lines
avoid possible mbuf leaks on ipsec policy violation.(sync with kame)

Revision 1.22: download - view: text, markup, annotated - select for diffs
Sat Jun 3 14:36:37 2000 UTC (24 years, 6 months ago) by itojun
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +49 -13 lines
sync with kame.
- use latest source address selection code - in6_src.c.
- correct frag header insertion.
- deep copy ip6 header portion in ip6_mloopback to avoid overwrite.
- do not bark when we forward packet to loopback.
- some cosmetics.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Fri May 19 20:09:27 2000 UTC (24 years, 6 months ago) by itojun
Branches: MAIN
CVS tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +3 -3 lines
correct manipulation of link-local scoped address on loopback.
now "telnet fe80::1%lo0" should work again.
(we have another bug near here - will attack it soon)

Revision 1.20: download - view: text, markup, annotated - select for diffs
Fri May 19 04:34:43 2000 UTC (24 years, 6 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +2 -2 lines
NULL != 0

Revision 1.19: download - view: text, markup, annotated - select for diffs
Fri May 19 01:40:18 2000 UTC (24 years, 6 months ago) by itojun
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +67 -43 lines
do not mistakingly forward link-local scoped packet (the bug was added
with "beyondscope" icmp6 support).
"options FAKE_LOOPBACK_IF" will honor scope on loopback outputs.  rcvif will
be real interface, not the loopback, just like when multicast loopback.

(sync with kame)

Revision 1.18: download - view: text, markup, annotated - select for diffs
Wed Mar 29 03:38:53 2000 UTC (24 years, 8 months ago) by simonb
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +1 -2 lines
Remove duplicate declaration of ifindex2ifnet - it's in <net/if.h>.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Wed Mar 1 12:49:46 2000 UTC (24 years, 9 months ago) by itojun
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +3 -3 lines
introduce m->m_pkthdr.aux to hold random data which needs to be passed
between protocol handlers.

ipsec socket pointers, ipsec decryption/auth information, tunnel
decapsulation information are in my mind - there can be several other usage.
at this moment, we use this for ipsec socket pointer passing.  this will
avoid reuse of m->m_pkthdr.rcvif in ipsec code.

due to the change, MHLEN will be decreased by sizeof(void *) - for example,
for i386, MHLEN was 100 bytes, but is now 96 bytes.
we may want to increase MSIZE from 128 to 256 for some of our architectures.

take caution if you use it for keeping some data item for long period
of time - use extra caution on M_PREPEND() or m_adj(), as they may result
in loss of m->m_pkthdr.aux pointer (and mbuf leak).

this will bump kernel version.

(as discussed in tech-net, tested in kame tree)

Revision 1.16: download - view: text, markup, annotated - select for diffs
Sun Feb 20 00:56:43 2000 UTC (24 years, 9 months ago) by darrenr
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +2 -2 lines
pass "struct pfil_head *" to pfil_add_hook and pfil_remove hook rather
than "struct protosw *".

Revision 1.15: download - view: text, markup, annotated - select for diffs
Thu Feb 17 10:59:39 2000 UTC (24 years, 9 months ago) by darrenr
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +29 -1 lines
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.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sun Feb 6 12:49:46 2000 UTC (24 years, 10 months ago) by itojun
Branches: MAIN
CVS tags: chs-ubc2-newbase
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +3 -3 lines
fix include pathname for better rfc2292 compliance.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Mon Jan 31 14:19:03 2000 UTC (24 years, 10 months ago) by itojun
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +18 -9 lines
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

Revision 1.12: download - view: text, markup, annotated - select for diffs
Wed Jan 26 17:06:37 2000 UTC (24 years, 10 months ago) by itojun
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +40 -1 lines
make setsockopt(IPV6_PORTRANGE) work.  obeys IPNOPRIVPORTS.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Thu Jan 6 15:46:10 2000 UTC (24 years, 11 months ago) by itojun
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +3 -69 lines
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...

Revision 1.10: download - view: text, markup, annotated - select for diffs
Thu Jan 6 06:41:19 2000 UTC (24 years, 11 months ago) by itojun
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +20 -2 lines
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).

Revision 1.8.8.1: download - view: text, markup, annotated - select for diffs
Mon Dec 27 18:36:25 1999 UTC (24 years, 11 months ago) by wrstuden
Branches: wrstuden-devbsize
Diff to: previous 1.8: preferred, colored; next MAIN 1.9: preferred, colored
Changes since revision 1.8: +118 -29 lines
Pull up to last week's -current.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Mon Dec 13 15:17:23 1999 UTC (25 years ago) by itojun
Branches: MAIN
CVS tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +118 -29 lines
sync IPv6 part with latest KAME tree.   IPsec part is left unmodified
due to massive changes in KAME side.
- IPv6 output goes through nd6_output
- faith can capture IPv4 packets as well - you can run IPv4-to-IPv6 translator
  using heavily modified DNS servers
- per-interface statistics (required for IPv6 MIB)
- interface autoconfig is revisited
- udp input handling has a big change for mapped address support.
- introduce in4_cksum() for non-overwriting checksumming
- introduce m_pulldown()
- neighbor discovery cleanups/improvements
- netinet/in.h strictly conforms to RFC2553 (no extra defs visible to userland)
- IFA_STATS is fixed a bit (not tested)
- and more more more.

TODO:
- cleanup os-independency #ifdef
- avoid rcvif dual use (for IPsec) to help ifdetach

(sorry for jumbo commit, I can't separate this any more...)

Revision 1.1.2.2: download - view: text, markup, annotated - select for diffs
Tue Nov 30 13:35:54 1999 UTC (25 years ago) by itojun
Branches: kame
CVS tags: kame_141_19991130
Diff to: previous 1.1.2.1: preferred, colored; next MAIN 1.2: preferred, colored
Changes since revision 1.1.2.1: +579 -62 lines
bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code).  Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.

Revision 1.2.2.3: download - view: text, markup, annotated - select for diffs
Mon Aug 2 22:36:05 1999 UTC (25 years, 4 months ago) by thorpej
Branches: chs-ubc2
Diff to: previous 1.2.2.2: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2.2.2: +15 -3 lines
Update from trunk.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sat Jul 31 18:41:16 1999 UTC (25 years, 4 months ago) by itojun
Branches: MAIN
CVS tags: fvdl-softdep-base, fvdl-softdep, comdex-fall-1999-base, comdex-fall-1999, chs-ubc2-base
Branch point for: wrstuden-devbsize, thorpej_scsipi
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +3 -1 lines
sync with recent KAME.
- loosen ipsec restriction on packet diredtion.
- revise icmp6 redirect handling on IsRouter bit.
- tcp/udp notification processing (link-local address case)
- cosmetic fixes (better code share across *BSD).

Revision 1.7: download - view: text, markup, annotated - select for diffs
Fri Jul 30 10:35:36 1999 UTC (25 years, 4 months ago) by itojun
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +1 -2 lines
remove reference to in6_systm.h (file itself will be removed afterwords)

Revision 1.6: download - view: text, markup, annotated - select for diffs
Thu Jul 22 12:56:57 1999 UTC (25 years, 4 months ago) by itojun
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +9 -1 lines
- implement IPv6 pmtud, which is necessary for TCP6.
- fix memory leak on SO_DEBUG over TCP.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu Jul 22 03:59:42 1999 UTC (25 years, 4 months ago) by itojun
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +3 -3 lines
change unnecessary u_long/long into u_int32_t or something relevant.
more fixes should follow.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Fri Jul 9 22:57:28 1999 UTC (25 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +2 -1 lines
defopt IPSEC and IPSEC_ESP (both into opt_ipsec.h).

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sat Jul 3 21:30:19 1999 UTC (25 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +2 -0 lines
RCS ID police.

Revision 1.2.2.2: download - view: text, markup, annotated - select for diffs
Thu Jul 1 23:48:28 1999 UTC (25 years, 5 months ago) by thorpej
Branches: chs-ubc2
Diff to: previous 1.2.2.1: preferred, colored
Changes since revision 1.2.2.1: +2011 -0 lines
Sync w/ -current.

Revision 1.2.2.1
Thu Jul 1 08:12:56 1999 UTC (25 years, 5 months ago) by thorpej
Branches: chs-ubc2
FILE REMOVED
Changes since revision 1.2: +0 -2011 lines
file ip6_output.c was added on branch chs-ubc2 on 1999-07-01 23:48:28 +0000

Revision 1.2: download - view: text, markup, annotated - select for diffs
Thu Jul 1 08:12:56 1999 UTC (25 years, 5 months ago) by itojun
Branches: MAIN
Branch point for: chs-ubc2
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +2011 -0 lines
IPv6 kernel code, based on KAME/NetBSD 1.4, SNAP kit 19990628.
(Sorry for a big commit, I can't separate this into several pieces...)
Pls check sys/netinet6/TODO and sys/netinet6/IMPLEMENTATION for details.

- sys/kern: do not assume single mbuf, accept chained mbuf on passing
  data from userland to kernel (or other way round).
- "midway" ATM card: ATM PVC pseudo device support, like those done in ALTQ
  package (ftp://ftp.csl.sony.co.jp/pub/kjc/).
- sys/netinet/tcp*: IPv4/v6 dual stack tcp support.
- sys/netinet/{ip6,icmp6}.h, sys/net/pfkeyv2.h: IETF document assumes those
  file to be there so we patch it up.
- sys/netinet: IPsec additions are here and there.
- sys/netinet6/*: most of IPv6 code sits here.
- sys/netkey: IPsec key management code
- dev/pci/pcidevs: regen

In my understanding no code here is subject to export control so it
should be safe.

Revision 1.1.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 28 06:37:05 1999 UTC (25 years, 5 months ago) by itojun
Branches: kame
CVS tags: kame_14_19990705, kame_14_19990628
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +2011 -0 lines
KAME/NetBSD 1.4 SNAP kit, dated 19990628.

NOTE: this branch (kame) is used just for refernce.  this may not compile
due to multiple reasons.

Revision 1.1
Mon Jun 28 06:37:05 1999 UTC (25 years, 5 months ago) by itojun
Branches: MAIN
Branch point for: kame
FILE REMOVED
file ip6_output.c was initially added on branch kame.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>