The NetBSD Project

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

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

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.103: download - view: text, markup, annotated - select for diffs
Sat Jun 29 13:00:44 2024 UTC (2 years, 4 months ago) by riastradh
Branches: MAIN
CVS tags: perseant-exfatfs-base-20261102, perseant-exfatfs-base-20250801, perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs, netbsd-11-base, netbsd-11-1-RELEASE, netbsd-11-0-RELEASE, netbsd-11-0-RC7, netbsd-11-0-RC6, netbsd-11-0-RC5, netbsd-11-0-RC4, netbsd-11-0-RC3, netbsd-11-0-RC2, netbsd-11-0-RC1, netbsd-11, HEAD
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +5 -5 lines
netinet6: Use _NET_STAT* API instead of direct array access.

XXX Exception: ip6flow_addstats_rt _assigns_ one of the `statistics'
to the current count of ip6 flows in use, and we don't have anything
in the _NET_STAT* API for that.  So for now I abuse the abstraction,
until we sort out this one exceptional case properly.

PR kern/58380

Revision 1.102: download - view: text, markup, annotated - select for diffs
Fri Aug 28 06:32:24 2020 UTC (6 years, 2 months ago) by ozaki-r
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, 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-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, thorpej-altq-separation-base, thorpej-altq-separation, netbsd-10-base, netbsd-10-2-RELEASE, netbsd-10-1-RELEASE, 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, netbsd-10, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +3 -2 lines
inet6: reduce silent packet discards

Revision 1.101: download - view: text, markup, annotated - select for diffs
Fri Aug 28 06:28:58 2020 UTC (6 years, 2 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +3 -11 lines
inet6: pass rcvif to ip6_forward to avoid extra psref_acquire

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

The counters count packets dropped due to security policy checks.

Revision 1.99: download - view: text, markup, annotated - select for diffs
Fri Jun 12 11:04:45 2020 UTC (6 years, 5 months ago) by roy
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +6 -9 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.95.2.2: download - view: text, markup, annotated - select for diffs
Mon Apr 13 08:05:17 2020 UTC (6 years, 7 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.95.2.1: preferred, colored; branchpoint 1.95: preferred, colored; next MAIN 1.96: preferred, colored
Changes since revision 1.95.2.1: +5 -5 lines
Mostly merge changes from HEAD upto 20200411

Revision 1.98: download - view: text, markup, annotated - select for diffs
Fri Nov 1 04:23:21 2019 UTC (7 years ago) by knakahara
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.97: preferred, colored
Changes since revision 1.97: +3 -3 lines
Fix ipsecif(4) IPV6_MINMTU does not work correctly.

Revision 1.87.2.4: download - view: text, markup, annotated - select for diffs
Tue Sep 24 18:27:09 2019 UTC (7 years, 1 month ago) by martin
Branches: netbsd-8
CVS tags: netbsd-8-3-RELEASE, netbsd-8-2-RELEASE
Diff to: previous 1.87.2.3: preferred, colored; branchpoint 1.87: preferred, colored; next MAIN 1.88: preferred, colored
Changes since revision 1.87.2.3: +4 -4 lines
Pull up following revision(s) (requested by knakahara in ticket #1385):

	sys/net/if.c				1.461
	sys/net/if.h				1.277
	sys/net/if_gif.c			1.149
	sys/net/if_gif.h			1.33
	sys/net/if_ipsec.c			1.19,1.20,1.24
	sys/net/if_ipsec.h			1.5
	sys/net/if_l2tp.c			1.33,1.36-1.39
	sys/net/if_l2tp.h			1.7,1.8
	sys/net/route.c				1.220,1.221
	sys/net/route.h				1.125
	sys/netinet/in_gif.c			1.95
	sys/netinet/in_l2tp.c			1.17
	sys/netinet/ip_input.c			1.391,1.392
	sys/netinet/wqinput.c			1.6
	sys/netinet6/in6_gif.c			1.94
	sys/netinet6/in6_l2tp.c			1.18
	sys/netinet6/ip6_forward.c		1.97
	sys/netinet6/ip6_input.c		1.210,1.211
	sys/netipsec/ipsec_output.c		1.82,1.83 (patched)
	sys/netipsec/ipsecif.c			1.12,1.13,1.15,1.17 (patched)
	sys/netipsec/key.c			1.259,1.260

ipsecif(4) support input drop packet counter.

ipsecif(4) should not increment drop counter by errors not related to if_snd. Pointed out by ozaki-r@n.o, thanks.
Remove unnecessary addresses in PF_KEY message.

MOBIKE Extensions for PF_KEY draft-schilcher-mobike-pfkey-extension-01.txt says
====================
5.  SPD Update
// snip
   SADB_X_SPDADD:
// snip
      sadb_x_ipsecrequest_reqid:
         An ID for that SA can be passed to the kernel in the
         sadb_x_ipsecrequest_reqid field.
      If tunnel mode is specified, the sadb_x_ipsecrequest structure is
      followed by two sockaddr structures that define the tunnel
      endpoint addresses.  In the case that transport mode is used, no
      additional addresses are specified.
====================
see: <a  rel="nofollow" href="https://tools.ietf.org/html/draft-schilcher-mobike-pfkey-extension-01">https://tools.ietf.org/html/draft-schilcher-mobike-pfkey-extension-01</a>

ipsecif(4) uses transport mode, so it should not add addresses.

ipsecif(4) supports multiple peers in the same NAPT.

E.g. ipsec0 connects between NetBSD_A and NetBSD_B, ipsec1 connects
NetBSD_A and NetBSD_C at the following figure.
                                        +----------+
                                   +----| NetBSD_B |
 +----------+           +------+   |    +----------+
 | NetBSD_A |--- ... ---| NAPT |---+
 +----------+           +------+   |    +----------+
                                   +----| NetBSD_C |
                                        +----------+

Add ATF later.

l2tp(4): fix output bytes counter. Pointed by k-goda@IIJ, thanks.
remove a variable which is no longer used.

l2tp: initialize mowner variables for MBUFTRACE

Avoid having a rtcache directly in a percpu storage
percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.
A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Using rtcache, i.e., packet processing, typically involves sleepable operations
such as rwlock so we must avoid dereferencing a rtcache that is directly stored
in a percpu storage during packet processing.  Address this situation by having
just a pointer to a rtcache in a percpu storage instead.

Reviewed by knakahara@ and yamaguchi@


wqinput: avoid having struct wqinput_worklist directly in a percpu storage
percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Input handlers of wqinput normally involves sleepable operations so we must
avoid dereferencing a percpu data (struct wqinput_worklist) after executing
an input handler.  Address this situation by having just a pointer to the data
in a percpu storage instead.

Reviewed by knakahara@ and yamaguchi@

Add missing #include <sys/kmem.h>

Divide Tx context of l2tp(4) to improve performance.
It seems l2tp(4) call path is too long for instruction cache. So, dividing
l2tp(4) Tx context improves CPU use efficiency.

After this commit, l2tp(4) throughput gains 10% on my machine(Atom C3000).

Apply some missing changes lost on the previous commit

Avoid having a rtcache directly in a percpu storage for tunnel protocols.
percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.
A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Using rtcache, i.e., packet processing, typically involves sleepable operations
such as rwlock so we must avoid dereferencing a rtcache that is directly stored
in a percpu storage during packet processing.  Address this situation by having
just a pointer to a rtcache in a percpu storage instead.

Reviewed by ozaki-r@ and yamaguchi@

l2tp(4): avoid having struct ifqueue directly in a percpu storage.

percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Tx processing of l2tp(4) uses normally involves sleepable operations so we
must avoid dereferencing a percpu data (struct ifqueue) after executing Tx
processing.  Address this situation by having just a pointer to the data in
a percpu storage instead.

Reviewed by ozaki-r@ and yamaguchi@

Revision 1.96.2.1: download - view: text, markup, annotated - select for diffs
Tue Sep 24 03:10:35 2019 UTC (7 years, 1 month ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-5-RELEASE, netbsd-9-4-RELEASE, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Diff to: previous 1.96: preferred, colored; next MAIN 1.97: preferred, colored
Changes since revision 1.96: +4 -4 lines
Pull up following revision(s) (requested by ozaki-r in ticket #238):

	sys/netipsec/ipsec_output.c: revision 1.83
	sys/net/route.h: revision 1.125
	sys/netinet6/ip6_input.c: revision 1.210
	sys/netinet6/ip6_input.c: revision 1.211
	sys/net/if.c: revision 1.461
	sys/net/if_gif.h: revision 1.33
	sys/net/route.c: revision 1.220
	sys/net/route.c: revision 1.221
	sys/net/if.h: revision 1.277
	sys/netinet6/ip6_forward.c: revision 1.97
	sys/netinet/wqinput.c: revision 1.6
	sys/net/if_ipsec.h: revision 1.5
	sys/netinet6/in6_l2tp.c: revision 1.18
	sys/netinet6/in6_gif.c: revision 1.94
	sys/net/if_l2tp.h: revision 1.7
	sys/net/if_gif.c: revision 1.149
	sys/net/if_l2tp.h: revision 1.8
	sys/netinet/in_gif.c: revision 1.95
	sys/netinet/in_l2tp.c: revision 1.17
	sys/netipsec/ipsecif.c: revision 1.17
	sys/net/if_ipsec.c: revision 1.24
	sys/net/if_l2tp.c: revision 1.37
	sys/netinet/ip_input.c: revision 1.391
	sys/net/if_l2tp.c: revision 1.38
	sys/netinet/ip_input.c: revision 1.392
	sys/net/if_l2tp.c: revision 1.39

Avoid having a rtcache directly in a percpu storage

percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Using rtcache, i.e., packet processing, typically involves sleepable operations
such as rwlock so we must avoid dereferencing a rtcache that is directly stored
in a percpu storage during packet processing.  Address this situation by having
just a pointer to a rtcache in a percpu storage instead.
Reviewed by knakahara@ and yamaguchi@

 -

wqinput: avoid having struct wqinput_worklist directly in a percpu storage

percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Input handlers of wqinput normally involves sleepable operations so we must
avoid dereferencing a percpu data (struct wqinput_worklist) after executing
an input handler.  Address this situation by having just a pointer to the data
in a percpu storage instead.
Reviewed by knakahara@ and yamaguchi@

 -

Add missing #include <sys/kmem.h>

 -

Divide Tx context of l2tp(4) to improve performance.

It seems l2tp(4) call path is too long for instruction cache. So, dividing
l2tp(4) Tx context improves CPU use efficiency.

After this commit, l2tp(4) throughput gains 10% on my machine(Atom C3000).

 -

Apply some missing changes lost on the previous commit

 -

Avoid having a rtcache directly in a percpu storage for tunnel protocols.
percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Using rtcache, i.e., packet processing, typically involves sleepable operations
such as rwlock so we must avoid dereferencing a rtcache that is directly stored
in a percpu storage during packet processing.  Address this situation by having
just a pointer to a rtcache in a percpu storage instead.

Reviewed by ozaki-r@ and yamaguchi@

 -

l2tp(4): avoid having struct ifqueue directly in a percpu storage.
percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Tx processing of l2tp(4) uses normally involves sleepable operations so we
must avoid dereferencing a percpu data (struct ifqueue) after executing Tx
processing.  Address this situation by having just a pointer to the data in
a percpu storage instead.

Reviewed by ozaki-r@ and yamaguchi@

Revision 1.97: download - view: text, markup, annotated - select for diffs
Thu Sep 19 04:08:29 2019 UTC (7 years, 1 month ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +4 -4 lines
Avoid having a rtcache directly in a percpu storage

percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.
A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Using rtcache, i.e., packet processing, typically involves sleepable operations
such as rwlock so we must avoid dereferencing a rtcache that is directly stored
in a percpu storage during packet processing.  Address this situation by having
just a pointer to a rtcache in a percpu storage instead.

Reviewed by knakahara@ and yamaguchi@

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

Revision 1.96: download - view: text, markup, annotated - select for diffs
Mon May 13 07:47:59 2019 UTC (7 years, 6 months ago) by ozaki-r
Branches: MAIN
CVS tags: phil-wifi-20190609, netbsd-9-base
Branch point for: netbsd-9
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +8 -4 lines
Count packets dropped by pfil

Revision 1.92.2.2: download - view: text, markup, annotated - select for diffs
Wed May 2 07:20:23 2018 UTC (8 years, 6 months ago) by pgoyette
Branches: pgoyette-compat
CVS tags: pgoyette-compat-merge-20190127
Diff to: previous 1.92.2.1: preferred, colored; branchpoint 1.92: preferred, colored; next MAIN 1.93: preferred, colored
Changes since revision 1.92.2.1: +4 -5 lines
Synch with HEAD

Revision 1.95: download - view: text, markup, annotated - select for diffs
Tue May 1 07:21:39 2018 UTC (8 years, 6 months ago) by maxv
Branches: MAIN
CVS tags: phil-wifi-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, isaki-audio2-base, isaki-audio2
Branch point for: phil-wifi
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +2 -4 lines
Remove now unused net_osdep.h includes, the other BSDs did the same.

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

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

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

Revision 1.69.6.2: download - view: text, markup, annotated - select for diffs
Sun Apr 1 09:20:22 2018 UTC (8 years, 7 months ago) by martin
Branches: netbsd-6-0
Diff to: previous 1.69.6.1: preferred, colored; branchpoint 1.69: preferred, colored; next MAIN 1.70: preferred, colored
Changes since revision 1.69.6.1: +8 -5 lines
Pull up following revision(s) (requested by maxv in ticket #1540):

	sys/netinet6/ip6_forward.c: revision 1.91 (via patch)

Fix two pretty bad mistakes. If ipsec6_check_policy fails m is not freed,
and a 'goto out' is missing after ipsec6_process_packet.

Revision 1.69.8.2: download - view: text, markup, annotated - select for diffs
Sun Apr 1 09:19:32 2018 UTC (8 years, 7 months ago) by martin
Branches: netbsd-6-1
Diff to: previous 1.69.8.1: preferred, colored; branchpoint 1.69: preferred, colored; next MAIN 1.70: preferred, colored
Changes since revision 1.69.8.1: +8 -5 lines
Pull up following revision(s) (requested by maxv in ticket #1540):

	sys/netinet6/ip6_forward.c: revision 1.91 (via patch)

Fix two pretty bad mistakes. If ipsec6_check_policy fails m is not freed,
and a 'goto out' is missing after ipsec6_process_packet.

Revision 1.69.2.2: download - view: text, markup, annotated - select for diffs
Sun Apr 1 09:18:54 2018 UTC (8 years, 7 months ago) by martin
Branches: netbsd-6
Diff to: previous 1.69.2.1: preferred, colored; branchpoint 1.69: preferred, colored; next MAIN 1.70: preferred, colored
Changes since revision 1.69.2.1: +8 -5 lines
Pull up following revision(s) (requested by maxv in ticket #1540):

	sys/netinet6/ip6_forward.c: revision 1.91 (via patch)

Fix two pretty bad mistakes. If ipsec6_check_policy fails m is not freed,
and a 'goto out' is missing after ipsec6_process_packet.

Revision 1.73.2.1.2.2: download - view: text, markup, annotated - select for diffs
Sun Apr 1 09:09:58 2018 UTC (8 years, 7 months ago) by martin
Branches: netbsd-7-0
Diff to: previous 1.73.2.1.2.1: preferred, colored; branchpoint 1.73.2.1: preferred, colored; next MAIN 1.73.2.2: preferred, colored
Changes since revision 1.73.2.1.2.1: +5 -2 lines
Pull up following revision(s) (requested by maxv in ticket #1590):

	sys/netinet6/ip6_forward.c: revision 1.91 (via patch)

Fix two pretty bad mistakes. If ipsec6_check_policy fails m is not freed,
and a 'goto out' is missing after ipsec6_process_packet.

Revision 1.73.2.1.6.2: download - view: text, markup, annotated - select for diffs
Sun Apr 1 09:09:20 2018 UTC (8 years, 7 months ago) by martin
Branches: netbsd-7-1
Diff to: previous 1.73.2.1.6.1: preferred, colored; branchpoint 1.73.2.1: preferred, colored; next MAIN 1.73.2.2: preferred, colored
Changes since revision 1.73.2.1.6.1: +5 -2 lines
Pull up following revision(s) (requested by maxv in ticket #1590):

	sys/netinet6/ip6_forward.c: revision 1.91 (via patch)

Fix two pretty bad mistakes. If ipsec6_check_policy fails m is not freed,
and a 'goto out' is missing after ipsec6_process_packet.

Revision 1.73.2.3: download - view: text, markup, annotated - select for diffs
Sun Apr 1 09:09:04 2018 UTC (8 years, 7 months ago) by martin
Branches: netbsd-7
CVS tags: netbsd-7-2-RELEASE
Diff to: previous 1.73.2.2: preferred, colored; branchpoint 1.73: preferred, colored; next MAIN 1.74: preferred, colored
Changes since revision 1.73.2.2: +5 -2 lines
Pull up following revision(s) (requested by maxv in ticket #1590):

	sys/netinet6/ip6_forward.c: revision 1.91 (via patch)

Fix two pretty bad mistakes. If ipsec6_check_policy fails m is not freed,
and a 'goto out' is missing after ipsec6_process_packet.

Revision 1.87.2.3: download - view: text, markup, annotated - select for diffs
Fri Mar 30 11:57:13 2018 UTC (8 years, 7 months ago) by martin
Branches: netbsd-8
CVS tags: netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1
Diff to: previous 1.87.2.2: preferred, colored; branchpoint 1.87: preferred, colored
Changes since revision 1.87.2.2: +5 -2 lines
Pull up following revision(s) (requested by maxv in ticket #671):

	sys/netinet6/ip6_forward.c: revision 1.91

Fix two pretty bad mistakes. If ipsec6_check_policy fails m is not freed,
and a 'goto out' is missing after ipsec6_process_packet.

Revision 1.69.2.1: download - view: text, markup, annotated - select for diffs
Tue Mar 13 16:43:06 2018 UTC (8 years, 8 months ago) by snj
Branches: netbsd-6
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +4 -4 lines
Pull up following revision(s) (requested by ozaki-r in ticket #1518):
	sys/netinet6/ip6_forward.c: 1.89-1.90 via patch
Fix use-after-free of mbuf by ip6flow_create
This fixes recent failures of some ATF tests such as t_ipsec_tunnel_odd.
--
Fix use-after-free of mbuf by ip6flow_create (one more)

Revision 1.69.8.1: download - view: text, markup, annotated - select for diffs
Tue Mar 13 16:43:04 2018 UTC (8 years, 8 months ago) by snj
Branches: netbsd-6-1
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +4 -4 lines
Pull up following revision(s) (requested by ozaki-r in ticket #1518):
	sys/netinet6/ip6_forward.c: 1.89-1.90 via patch
Fix use-after-free of mbuf by ip6flow_create
This fixes recent failures of some ATF tests such as t_ipsec_tunnel_odd.
--
Fix use-after-free of mbuf by ip6flow_create (one more)

Revision 1.69.6.1: download - view: text, markup, annotated - select for diffs
Tue Mar 13 16:43:03 2018 UTC (8 years, 8 months ago) by snj
Branches: netbsd-6-0
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +4 -4 lines
Pull up following revision(s) (requested by ozaki-r in ticket #1518):
	sys/netinet6/ip6_forward.c: 1.89-1.90 via patch
Fix use-after-free of mbuf by ip6flow_create
This fixes recent failures of some ATF tests such as t_ipsec_tunnel_odd.
--
Fix use-after-free of mbuf by ip6flow_create (one more)

Revision 1.73.2.2: download - view: text, markup, annotated - select for diffs
Mon Feb 12 18:37:51 2018 UTC (8 years, 9 months ago) by snj
Branches: netbsd-7
Diff to: previous 1.73.2.1: preferred, colored; branchpoint 1.73: preferred, colored
Changes since revision 1.73.2.1: +4 -4 lines
Pull up following revision(s) (requested by ozaki-r in ticket #1551):
	sys/netinet6/ip6_forward.c: 1.89-1.90 via patch
Fix use-after-free of mbuf by ip6flow_create
This fixes recent failures of some ATF tests such as t_ipsec_tunnel_odd.
--
Fix use-after-free of mbuf by ip6flow_create (one more)

Revision 1.73.2.1.6.1: download - view: text, markup, annotated - select for diffs
Mon Feb 12 18:37:49 2018 UTC (8 years, 9 months ago) by snj
Branches: netbsd-7-1
CVS tags: netbsd-7-1-2-RELEASE
Diff to: previous 1.73.2.1: preferred, colored
Changes since revision 1.73.2.1: +4 -4 lines
Pull up following revision(s) (requested by ozaki-r in ticket #1551):
	sys/netinet6/ip6_forward.c: 1.89-1.90 via patch
Fix use-after-free of mbuf by ip6flow_create
This fixes recent failures of some ATF tests such as t_ipsec_tunnel_odd.
--
Fix use-after-free of mbuf by ip6flow_create (one more)

Revision 1.73.2.1.2.1: download - view: text, markup, annotated - select for diffs
Mon Feb 12 18:37:48 2018 UTC (8 years, 9 months ago) by snj
Branches: netbsd-7-0
Diff to: previous 1.73.2.1: preferred, colored
Changes since revision 1.73.2.1: +4 -4 lines
Pull up following revision(s) (requested by ozaki-r in ticket #1551):
	sys/netinet6/ip6_forward.c: 1.89-1.90 via patch
Fix use-after-free of mbuf by ip6flow_create
This fixes recent failures of some ATF tests such as t_ipsec_tunnel_odd.
--
Fix use-after-free of mbuf by ip6flow_create (one more)

Revision 1.92: download - view: text, markup, annotated - select for diffs
Mon Jan 29 08:17:18 2018 UTC (8 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.91: preferred, colored
Changes since revision 1.91: +18 -19 lines
style

Revision 1.91: download - view: text, markup, annotated - select for diffs
Mon Jan 29 08:14:54 2018 UTC (8 years, 9 months ago) by maxv
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +5 -2 lines
Fix two pretty bad mistakes. If ipsec6_check_policy fails m is not freed,
and a 'goto out' is missing after ipsec6_process_packet.

Revision 1.87.2.2: download - view: text, markup, annotated - select for diffs
Tue Jan 9 19:30:45 2018 UTC (8 years, 10 months ago) by snj
Branches: netbsd-8
Diff to: previous 1.87.2.1: preferred, colored; branchpoint 1.87: preferred, colored
Changes since revision 1.87.2.1: +4 -4 lines
Pull up following revision(s) (requested by ozaki-r in ticket #484):
	sys/netinet6/ip6_forward.c: 1.89-1.90
Fix use-after-free of mbuf by ip6flow_create
This fixes recent failures of some ATF tests such as t_ipsec_tunnel_odd.
--
Fix use-after-free of mbuf by ip6flow_create (one more)

Revision 1.90: download - view: text, markup, annotated - select for diffs
Tue Jan 9 04:41:19 2018 UTC (8 years, 10 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +3 -3 lines
Fix use-after-free of mbuf by ip6flow_create (one more)

XXX need pullup-[678]

Revision 1.89: download - view: text, markup, annotated - select for diffs
Tue Jan 9 04:21:26 2018 UTC (8 years, 10 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +3 -3 lines
Fix use-after-free of mbuf by ip6flow_create

This fixes recent failures of some ATF tests such as t_ipsec_tunnel_odd.

XXX need pullup-[678]

Revision 1.70.2.3: download - view: text, markup, annotated - select for diffs
Sun Dec 3 11:39:04 2017 UTC (8 years, 11 months ago) by jdolecek
Branches: tls-maxphys
Diff to: previous 1.70.2.2: preferred, colored; branchpoint 1.70: preferred, colored; next MAIN 1.71: preferred, colored
Changes since revision 1.70.2.2: +111 -90 lines
update from HEAD

Revision 1.87.2.1: download - view: text, markup, annotated - select for diffs
Sat Oct 21 19:43:54 2017 UTC (9 years ago) by snj
Branches: netbsd-8
CVS tags: matt-nb8-mediatek-base, matt-nb8-mediatek
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +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.74.2.6: download - view: text, markup, annotated - select for diffs
Mon Aug 28 17:53:12 2017 UTC (9 years, 2 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.74.2.5: preferred, colored; branchpoint 1.74: preferred, colored; next MAIN 1.75: preferred, colored
Changes since revision 1.74.2.5: +7 -3 lines
Sync with HEAD

Revision 1.88: download - view: text, markup, annotated - select for diffs
Wed Aug 2 01:28:03 2017 UTC (9 years, 3 months ago) by ozaki-r
Branches: MAIN
CVS tags: tls-maxphys-base-20171202, nick-nhusb-base-20170825
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +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.86.4.1: download - view: text, markup, annotated - select for diffs
Thu May 11 02:58:41 2017 UTC (9 years, 6 months ago) by pgoyette
Branches: prg-localcount2
Diff to: previous 1.86: preferred, colored; next MAIN 1.87: preferred, colored
Changes since revision 1.86: +6 -2 lines
Sync with HEAD

Revision 1.87: download - view: text, markup, annotated - select for diffs
Tue May 9 04:24:10 2017 UTC (9 years, 6 months ago) by ozaki-r
Branches: MAIN
CVS tags: prg-localcount2-base3, prg-localcount2-base2, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base
Branch point for: netbsd-8
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +6 -2 lines
Add missing KEY_FREESP to ip6_forward

Revision 1.83.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 21 16:54:06 2017 UTC (9 years, 6 months ago) by bouyer
Branches: bouyer-socketcan
Diff to: previous 1.83: preferred, colored; next MAIN 1.84: preferred, colored
Changes since revision 1.83: +8 -5 lines
Sync with HEAD

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

Revision 1.86: download - view: text, markup, annotated - select for diffs
Tue Feb 14 03:05:06 2017 UTC (9 years, 9 months ago) by ozaki-r
Branches: MAIN
CVS tags: prg-localcount2-base1, prg-localcount2-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Branch point for: prg-localcount2
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +3 -3 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.74.2.5: download - view: text, markup, annotated - select for diffs
Sun Feb 5 13:40:59 2017 UTC (9 years, 9 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.74.2.4: preferred, colored; branchpoint 1.74: preferred, colored
Changes since revision 1.74.2.4: +17 -18 lines
Sync with HEAD

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

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

Reviewed by ozaki-r@

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

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

Revision 1.82: download - view: text, markup, annotated - select for diffs
Thu Dec 8 05:16:34 2016 UTC (9 years, 11 months ago) by ozaki-r
Branches: MAIN
CVS tags: pgoyette-localcount-20170107
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +12 -13 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.74.2.4: download - view: text, markup, annotated - select for diffs
Wed Oct 5 20:56:09 2016 UTC (10 years, 1 month ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.74.2.3: preferred, colored; branchpoint 1.74: preferred, colored
Changes since revision 1.74.2.3: +22 -12 lines
Sync with HEAD

Revision 1.81: download - view: text, markup, annotated - select for diffs
Wed Aug 31 09:14:47 2016 UTC (10 years, 2 months ago) by ozaki-r
Branches: MAIN
CVS tags: pgoyette-localcount-20161104, nick-nhusb-base-20161204, nick-nhusb-base-20161004, localcount-20160914
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +21 -11 lines
Make ipforward_rt and ip6_forward_rt percpu

Sharing one rtcache between CPUs is just a bad idea.

Reviewed by knakahara@

Revision 1.74.2.3: download - view: text, markup, annotated - select for diffs
Sat Jul 9 20:25:22 2016 UTC (10 years, 4 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.74.2.2: preferred, colored; branchpoint 1.74: preferred, colored
Changes since revision 1.74.2.2: +34 -29 lines
Sync with HEAD

Revision 1.80: download - view: text, markup, annotated - select for diffs
Tue Jun 28 02:02:56 2016 UTC (10 years, 4 months ago) by ozaki-r
Branches: MAIN
CVS tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20160907
Branch point for: pgoyette-localcount
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +5 -2 lines
Add missing NULL checks for m_get_rcvif_psref

Revision 1.79: download - view: text, markup, annotated - select for diffs
Fri Jun 10 13:31:44 2016 UTC (10 years, 5 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +30 -28 lines
Avoid storing a pointer of an interface in a mbuf

Having a pointer of an interface in a mbuf isn't safe if we remove big
kernel locks; an interface object (ifnet) can be destroyed anytime in any
packet processing and accessing such object via a pointer is racy. Instead
we have to get an object from the interface collection (ifindex2ifnet) via
an interface index (if_index) that is stored to a mbuf instead of an
pointer.

The change provides two APIs: m_{get,put}_rcvif_psref that use psref(9)
for sleep-able critical sections and m_{get,put}_rcvif that use
pserialize(9) for other critical sections. The change also adds another
API called m_get_rcvif_NOMPSAFE, that is NOT MP-safe and for transition
moratorium, i.e., it is intended to be used for places where are not
planned to be MP-ified soon.

The change adds some overhead due to psref to performance sensitive paths,
however the overhead is not serious, 2% down at worst.

Proposed on tech-kern and tech-net.

Revision 1.74.2.2: download - view: text, markup, annotated - select for diffs
Tue Sep 22 12:06:11 2015 UTC (11 years, 1 month ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.74.2.1: preferred, colored; branchpoint 1.74: preferred, colored
Changes since revision 1.74.2.1: +9 -7 lines
Sync with HEAD

Revision 1.78: download - view: text, markup, annotated - select for diffs
Mon Aug 24 22:21:27 2015 UTC (11 years, 2 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.77: preferred, colored
Changes since revision 1.77: +4 -2 lines
sprinkle _KERNEL_OPT

Revision 1.77: download - view: text, markup, annotated - select for diffs
Fri Aug 7 08:11:33 2015 UTC (11 years, 3 months ago) by ozaki-r
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +4 -4 lines
Use time_uptime instead of time_second to avoid time leaps

Some codes in sys/net* use time_second to manage time periods such as
cache expirations. However, time_second doesn't increase monotonically
and can leap by say settimeofday(2) according to time_second(9). We
should use time_uptime instead of it to avoid such time leaps.

This change replaces time_second with time_uptime. Additionally it
converts a time based on time_uptime to a time based on time_second
when the kernel passes the time to userland programs that expect
the latter, and vice versa.

Note that we shouldn't leak time_uptime to other hosts over the
netowrk. My investigation shows there is no such leak:
http://mail-index.netbsd.org/tech-net/2015/08/06/msg005332.html

Discussed on tech-kern and tech-net.

Revision 1.74.2.1: download - view: text, markup, annotated - select for diffs
Mon Apr 6 15:18:23 2015 UTC (11 years, 7 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +55 -53 lines
Sync with HEAD

Revision 1.73.2.1: download - view: text, markup, annotated - select for diffs
Sat Jan 17 12:10:54 2015 UTC (11 years, 10 months ago) by martin
Branches: netbsd-7
CVS tags: netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-1-RELEASE, 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
Branch point for: netbsd-7-1, netbsd-7-0
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +2 -3 lines
Pull up following revision(s) (requested by maxv in ticket #427):
	sys/compat/svr4/svr4_schedctl.c: revision 1.8
	sys/netinet/tcp_timer.c: revision 1.88
	sys/miscfs/genfs/layer_vfsops.c: revision 1.45
	sys/compat/svr4/svr4_ioctl.c: revision 1.37
	sys/ufs/chfs/chfs_vfsops.c: revision 1.14
	sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
	sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
	sys/compat/common/kern_time_50.c: revision 1.28
	sys/netinet6/ip6_forward.c: revision 1.74
	sys/miscfs/umapfs/umap_vnops.c: revision 1.57
	sys/compat/svr4/svr4_fcntl.c: revision 1.74
	distrib/sets/lists/comp/mi: revision 1.1931
	sys/netinet6/udp6_output.c: revision 1.46
	sys/fs/puffs/puffs_compat.c: revision 1.3
	sys/fs/udf/udf_rename.c: revision 1.11
	sys/compat/svr4/svr4_filio.c: revision 1.24
	sys/fs/udf/udf_rename.c: revision 1.12
	sys/netinet/tcp_usrreq.c: revision 1.202
	sys/miscfs/umapfs/umap_subr.c: revision 1.29
	sys/compat/linux/common/linux_fadvise64.c: revision 1.3
	sys/netinet/if_atm.c: revision 1.34
	sys/miscfs/procfs/procfs_subr.c: revision 1.106
	sys/miscfs/genfs/layer_subr.c: revision 1.37
	sys/netinet/tcp_sack.c: revision 1.30
	sys/compat/freebsd/freebsd_misc.c: revision 1.33
	sys/compat/freebsd/freebsd_file.c: revision 1.33
	sys/ufs/chfs/chfs_vnode.c: revision 1.12
	sys/compat/svr4/svr4_ttold.c: revision 1.34
	sys/compat/linux/common/linux_file.c: revision 1.114
	sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
	sys/compat/linux/common/linux_signal.c: revision 1.76
	sys/compat/common/compat_util.c: revision 1.46
	sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
	sys/compat/svr4/svr4_sockio.c: revision 1.36
	sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
	sys/compat/svr4/svr4_signal.c: revision 1.66
	sys/kern/kern_exec.c: revision 1.410
	sys/fs/puffs/puffs_vfsops.c: revision 1.115
	sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
	sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
	sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
	sys/compat/linux32/common/linux32_misc.c: revision 1.24
	sys/netinet/in_pcb.c: revision 1.153
	sys/sys/malloc.h: revision 1.116
	sys/compat/common/if_43.c: revision 1.9
	share/man/man9/Makefile: revision 1.380
	sys/netinet/tcp_vtw.c: revision 1.12
	sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
	sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
	sys/compat/common/uipc_syscalls_43.c: revision 1.46
	sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
	sys/fs/puffs/puffs_msgif.c: revision 1.97
	sys/compat/svr4/svr4_ipc.c: revision 1.27
	sys/compat/linux/common/linux_exec.c: revision 1.117
	sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
	sys/netinet/tcp_output.c: revision 1.179
	sys/compat/svr4/svr4_termios.c: revision 1.28
	sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
	sys/fs/puffs/puffs_subr.c: revision 1.67
	sys/fs/puffs/puffs_node.c: revision 1.36
	sys/miscfs/overlay/overlay_vnops.c: revision 1.21
	sys/fs/cd9660/cd9660_node.c: revision 1.34
	sys/netinet/raw_ip.c: revision 1.146
	sys/sys/mallocvar.h: revision 1.13
	sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
	share/man/man9/malloc.9: revision 1.50
	sys/netinet6/dest6.c: revision 1.18
	sys/compat/linux/common/linux_uselib.c: revision 1.33
	sys/compat/linux/common/linux_socket.c: revision 1.120
	share/man/man9/malloc.9: revision 1.51
	sys/netinet/tcp_subr.c: revision 1.257
	sys/compat/linux/common/linux_socketcall.c: revision 1.45
	sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
	sys/compat/freebsd/freebsd_ipc.c: revision 1.17
	sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
	sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
	sys/netinet6/in6_pcb.c: revision 1.132
	sys/netinet6/in6_ifattach.c: revision 1.94
	sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
	sys/miscfs/nullfs/null_vfsops.c: revision 1.90
	sys/fs/cd9660/cd9660_util.c: revision 1.12
	sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
	sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
	sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
	sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
	sys/compat/linux/common/linux_sched.c: revision 1.67
	sys/compat/linux/common/linux_exec_aout.c: revision 1.67
	sys/compat/linux/common/linux_pipe.c: revision 1.67
	sys/compat/linux/common/linux_llseek.c: revision 1.34
	sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
 - remove struct kmembuckets (dead)
 - correctly deadify MALLOC_XX
 - remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
 - remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
   and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Wed Dec 10 01:10:14 2014 UTC (11 years, 11 months ago) by christos
Branches: MAIN
CVS tags: nick-nhusb-base-20150606, nick-nhusb-base-20150406
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +8 -6 lines
call vsnprintf instead of snprintf; provide more detail

Revision 1.75: download - view: text, markup, annotated - select for diffs
Mon Dec 8 00:19:37 2014 UTC (11 years, 11 months ago) by christos
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +53 -53 lines
Merge some common code in the failed forwarding case, while providing better
diagnostics, and fixing leaks.

Revision 1.74: download - view: text, markup, annotated - select for diffs
Fri Nov 14 17:34:23 2014 UTC (12 years ago) by maxv
Branches: MAIN
CVS tags: nick-nhusb-base
Branch point for: nick-nhusb
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +2 -3 lines
Do not uselessly include <sys/malloc.h>.

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

Revision 1.72.4.1: download - view: text, markup, annotated - select for diffs
Sun Aug 10 06:56:30 2014 UTC (12 years, 3 months ago) by tls
Branches: tls-earlyentropy
Diff to: previous 1.72: preferred, colored; next MAIN 1.73: preferred, colored
Changes since revision 1.72: +19 -18 lines
Rebase.

Revision 1.73: download - view: text, markup, annotated - select for diffs
Fri May 30 01:39:03 2014 UTC (12 years, 5 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.72: preferred, colored
Changes since revision 1.72: +19 -18 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.68.12.2: download - view: text, markup, annotated - select for diffs
Thu May 22 11:41:10 2014 UTC (12 years, 5 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.68.12.1: preferred, colored; branchpoint 1.68: preferred, colored; next MAIN 1.69: preferred, colored
Changes since revision 1.68.12.1: +19 -31 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.71.2.1: download - view: text, markup, annotated - select for diffs
Wed Aug 28 23:59:36 2013 UTC (13 years, 2 months ago) by rmind
Branches: rmind-smpnet
Diff to: previous 1.71: preferred, colored; next MAIN 1.72: preferred, colored
Changes since revision 1.71: +5 -15 lines
sync with head

Revision 1.72: download - view: text, markup, annotated - select for diffs
Sat Jun 29 21:06:58 2013 UTC (13 years, 4 months ago) by rmind
Branches: MAIN
CVS tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Branch point for: tls-earlyentropy
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +5 -15 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.70.2.1: download - view: text, markup, annotated - select for diffs
Sun Jun 23 06:20:26 2013 UTC (13 years, 4 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +16 -18 lines
resync from head

Revision 1.71: download - view: text, markup, annotated - select for diffs
Wed Jun 5 19:01:26 2013 UTC (13 years, 5 months ago) by christos
Branches: MAIN
Branch point for: rmind-smpnet
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +16 -18 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.68.12.1: download - view: text, markup, annotated - select for diffs
Tue Apr 17 00:08:43 2012 UTC (14 years, 7 months ago) by yamt
Branches: yamt-pagecache
CVS tags: yamt-pagecache-tag8
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +3 -232 lines
sync with head

Revision 1.68.16.2: download - view: text, markup, annotated - select for diffs
Thu Apr 5 21:33:46 2012 UTC (14 years, 7 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.68.16.1: preferred, colored; branchpoint 1.68: preferred, colored; next MAIN 1.69: preferred, colored
Changes since revision 1.68.16.1: +3 -232 lines
sync to latest -current.

Revision 1.70: download - view: text, markup, annotated - select for diffs
Thu Mar 22 20:34:40 2012 UTC (14 years, 7 months ago) by drochner
Branches: MAIN
CVS tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, khorben-n900, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base10, agc-symver-base, agc-symver
Branch point for: tls-maxphys
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +3 -232 lines
remove KAME IPSEC, replaced by FAST_IPSEC

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

Revision 1.69: download - view: text, markup, annotated - select for diffs
Mon Dec 19 11:59:58 2011 UTC (14 years, 11 months ago) by drochner
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-5-RELEASE, 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-6-RELEASE, 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.68: preferred, colored
Changes since revision 1.68: +15 -15 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.65.20.1: download - view: text, markup, annotated - select for diffs
Wed Apr 21 00:28:23 2010 UTC (16 years, 7 months ago) by matt
Branches: matt-nb5-mips64
CVS tags: matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-k15
Diff to: previous 1.65: preferred, colored; next MAIN 1.66: preferred, colored
Changes since revision 1.65: +6 -2 lines
sync to netbsd-5

Revision 1.65.2.2: download - view: text, markup, annotated - select for diffs
Thu Mar 11 15:04:29 2010 UTC (16 years, 8 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.65.2.1: preferred, colored; branchpoint 1.65: preferred, colored; next MAIN 1.66: preferred, colored
Changes since revision 1.65.2.1: +7 -2 lines
sync with head

Revision 1.68: download - view: text, markup, annotated - select for diffs
Thu Feb 4 21:48:35 2010 UTC (16 years, 9 months ago) by joerg
Branches: MAIN
CVS tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-nfs-mp-base9, 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, rmind-uvmplock-nbase, rmind-uvmplock-base, rmind-uvmplock, matt-mips64-premerge-20101231, jruoho-x86intr-base, jruoho-x86intr, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: yamt-pagecache, jmcneill-usbmp
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +3 -2 lines
Explicitly include opt_gateway.h when depending on GATEWAY.

Revision 1.49.8.1.4.1: download - view: text, markup, annotated - select for diffs
Sat Nov 14 10:43:35 2009 UTC (17 years ago) by sborrill
Branches: netbsd-4-0
Diff to: previous 1.49.8.1: preferred, colored; next MAIN 1.49.8.2: preferred, colored
Changes since revision 1.49.8.1: +6 -2 lines
Pull up the following revisions(s) (requested by joerg in ticket #1366):
	sys/netinet6/ip6_forward.c:	revision 1.67

Clear cksum flags before any further processing like ip_forward does.
Many drivers set the UDP/TCP v4 flags even for v6 traffic and if the
packet is encapsulated with gif, the IPv6 header would get corrupted by
ip_output.

Revision 1.49.8.2: download - view: text, markup, annotated - select for diffs
Sat Nov 14 10:40:12 2009 UTC (17 years ago) by sborrill
Branches: netbsd-4
Diff to: previous 1.49.8.1: preferred, colored; branchpoint 1.49: preferred, colored; next MAIN 1.50: preferred, colored
Changes since revision 1.49.8.1: +6 -2 lines
Pull up the following revisions(s) (requested by joerg in ticket #1366):
	sys/netinet6/ip6_forward.c:	revision 1.67

Clear cksum flags before any further processing like ip_forward does.
Many drivers set the UDP/TCP v4 flags even for v6 traffic and if the
packet is encapsulated with gif, the IPv6 header would get corrupted by
ip_output.

Revision 1.65.18.1: download - view: text, markup, annotated - select for diffs
Sat Nov 14 09:48:57 2009 UTC (17 years ago) by sborrill
Branches: netbsd-5-0
CVS tags: netbsd-5-0-2-RELEASE
Diff to: previous 1.65: preferred, colored; next MAIN 1.66: preferred, colored
Changes since revision 1.65: +6 -2 lines
Pull up the following revisions(s) (requested by joerg in ticket #1139):
	sys/netinet6/ip6_forward.c:	revision 1.67

Clear cksum flags before any further processing like ip_forward does.
Many drivers set the UDP/TCP v4 flags even for v6 traffic and if the
packet is encapsulated with gif, the IPv6 header would get corrupted by
ip_output.

Revision 1.65.12.1: download - view: text, markup, annotated - select for diffs
Sat Nov 14 09:45:53 2009 UTC (17 years ago) by sborrill
Branches: netbsd-5
CVS tags: netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, matt-nb5-pq3-base, matt-nb5-pq3
Diff to: previous 1.65: preferred, colored; next MAIN 1.66: preferred, colored
Changes since revision 1.65: +6 -2 lines
Pull up the following revisions(s) (requested by joerg in ticket #1139):
	sys/netinet6/ip6_forward.c:	revision 1.67

Clear cksum flags before any further processing like ip_forward does.
Many drivers set the UDP/TCP v4 flags even for v6 traffic and if the
packet is encapsulated with gif, the IPv6 header would get corrupted by
ip_output.

Revision 1.67: download - view: text, markup, annotated - select for diffs
Wed Nov 11 22:19:22 2009 UTC (17 years ago) by joerg
Branches: MAIN
CVS tags: matt-premerge-20091211
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +6 -2 lines
Clear cksum flags before any further processing like ip_forward does.
Many drivers set the UDP/TCP v4 flags even for v6 traffic and if the
packet is encapsulated with gif, the IPv6 header would get corrupted by
ip_output. Patch suggested by bad@

Revision 1.65.16.1: download - view: text, markup, annotated - select for diffs
Wed May 13 17:22:29 2009 UTC (17 years, 6 months ago) by jym
Branches: jym-xensuspend
Diff to: previous 1.65: preferred, colored; next MAIN 1.66: preferred, colored
Changes since revision 1.65: +3 -3 lines
Sync with HEAD.

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

Revision 1.65.2.1: download - view: text, markup, annotated - select for diffs
Mon May 4 08:14:18 2009 UTC (17 years, 6 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +3 -3 lines
sync with head.

Revision 1.65.10.1: download - view: text, markup, annotated - select for diffs
Tue Apr 28 07:37:23 2009 UTC (17 years, 6 months ago) by skrll
Branches: nick-hppapmap
Diff to: previous 1.65: preferred, colored; next MAIN 1.66: preferred, colored
Changes since revision 1.65: +3 -3 lines
Sync with HEAD.

Revision 1.66: download - view: text, markup, annotated - select for diffs
Wed Mar 18 16:00:23 2009 UTC (17 years, 8 months ago) by cegger
Branches: MAIN
CVS tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base, jymxensuspend-base, jym-xensuspend-nbase, jym-xensuspend-base
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +3 -3 lines
bzero -> memset

Revision 1.62.6.1: download - view: text, markup, annotated - select for diffs
Mon Jun 2 13:24:26 2008 UTC (18 years, 5 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.62: preferred, colored; next MAIN 1.63: preferred, colored
Changes since revision 1.62: +33 -23 lines
Sync with HEAD.

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

Revision 1.65: download - view: text, markup, annotated - select for diffs
Wed Apr 23 06:09:05 2008 UTC (18 years, 6 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-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl, nick-hppapmap-base2, netbsd-5-base, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-1-RELEASE, mjf-devfs2-base, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20091211, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, hpcarm-cleanup-nbase, haad-nbase2, haad-dm-base2, haad-dm-base1, haad-dm-base, haad-dm, ad-audiomp2-base, ad-audiomp2
Branch point for: yamt-nfs-mp, nick-hppapmap, netbsd-5-0, netbsd-5, matt-nb5-mips64, jym-xensuspend
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +6 -5 lines
Make IPSEC and FAST_IPSEC stats per-cpu.  Use <net/net_stats.h> and
netstat_sysctl().

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

Revision 1.63: download - view: text, markup, annotated - select for diffs
Tue Apr 8 23:37:43 2008 UTC (18 years, 7 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +20 -20 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.58.8.2: download - view: text, markup, annotated - select for diffs
Sun Mar 23 02:05:07 2008 UTC (18 years, 7 months ago) by matt
Branches: matt-armv6
Diff to: previous 1.58.8.1: preferred, colored; branchpoint 1.58: preferred, colored; next MAIN 1.59: preferred, colored
Changes since revision 1.58.8.1: +19 -26 lines
sync with HEAD

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

Revision 1.58.14.1: download - view: text, markup, annotated - select for diffs
Mon Feb 18 21:07:13 2008 UTC (18 years, 9 months ago) by mjf
Branches: mjf-devfs
Diff to: previous 1.58: preferred, colored; next MAIN 1.59: preferred, colored
Changes since revision 1.58: +19 -26 lines
Sync with HEAD.

Revision 1.45.2.5: download - view: text, markup, annotated - select for diffs
Mon Jan 21 09:47:22 2008 UTC (18 years, 9 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.45.2.4: preferred, colored; branchpoint 1.45: preferred, colored; next MAIN 1.46: preferred, colored
Changes since revision 1.45.2.4: +19 -26 lines
sync with head

Revision 1.58.20.3: download - view: text, markup, annotated - select for diffs
Sat Jan 19 12:15:34 2008 UTC (18 years, 10 months ago) by bouyer
Branches: bouyer-xeni386
Diff to: previous 1.58.20.2: preferred, colored; branchpoint 1.58: preferred, colored; next MAIN 1.59: preferred, colored
Changes since revision 1.58.20.2: +17 -22 lines
Sync with HEAD

Revision 1.62: download - view: text, markup, annotated - select for diffs
Mon Jan 14 04:16:45 2008 UTC (18 years, 10 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.61: preferred, colored
Changes since revision 1.61: +6 -7 lines
Use rtcache_validate() instead of rtcache_getrt().  Shorten staircase
in in6_losing().

Revision 1.61: download - view: text, markup, annotated - select for diffs
Sat Jan 12 02:58:58 2008 UTC (18 years, 10 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +17 -21 lines
Good-bye, rtcache_check().  Call both rtcache_validate() and
rtcache_update(,1) instead of rtcache_check().

Revision 1.58.20.2: download - view: text, markup, annotated - select for diffs
Thu Jan 10 23:44:37 2008 UTC (18 years, 10 months ago) by bouyer
Branches: bouyer-xeni386
CVS tags: bouyer-xeni386-merge1
Diff to: previous 1.58.20.1: preferred, colored; branchpoint 1.58: preferred, colored
Changes since revision 1.58.20.1: +1 -3 lines
Sync with HEAD

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

Revision 1.58.8.1: download - view: text, markup, annotated - select for diffs
Wed Jan 9 01:57:36 2008 UTC (18 years, 10 months ago) by matt
Branches: matt-armv6
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +6 -6 lines
sync with HEAD

Revision 1.58.20.1: download - view: text, markup, annotated - select for diffs
Wed Jan 2 21:57:30 2008 UTC (18 years, 10 months ago) by bouyer
Branches: bouyer-xeni386
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +6 -6 lines
Sync with HEAD

Revision 1.58.16.1: download - view: text, markup, annotated - select for diffs
Wed Dec 26 19:57:46 2007 UTC (18 years, 10 months ago) by ad
Branches: vmlocking2
Diff to: previous 1.58: preferred, colored; next MAIN 1.59: preferred, colored
Changes since revision 1.58: +6 -6 lines
Sync with head.

Revision 1.59: download - view: text, markup, annotated - select for diffs
Thu Dec 20 19:53:33 2007 UTC (18 years, 11 months ago) by dyoung
Branches: MAIN
CVS tags: vmlocking2-base3, matt-armv6-base
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +6 -6 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.45.2.4: download - view: text, markup, annotated - select for diffs
Mon Sep 3 14:43:32 2007 UTC (19 years, 2 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.45.2.3: preferred, colored; branchpoint 1.45: preferred, colored
Changes since revision 1.45.2.3: +23 -27 lines
sync with head.

Revision 1.56.4.1: download - view: text, markup, annotated - select for diffs
Wed Jul 11 20:11:42 2007 UTC (19 years, 4 months ago) by mjf
Branches: mjf-ufs-trans
Diff to: previous 1.56: preferred, colored; next MAIN 1.57: preferred, colored
Changes since revision 1.56: +19 -27 lines
Sync with head.

Revision 1.56.2.1: download - view: text, markup, annotated - select for diffs
Fri Jun 8 14:17:54 2007 UTC (19 years, 5 months ago) by ad
Branches: vmlocking
Diff to: previous 1.56: preferred, colored; next MAIN 1.57: preferred, colored
Changes since revision 1.56: +19 -27 lines
Sync with head.

Revision 1.49.10.1: download - view: text, markup, annotated - select for diffs
Mon Jun 4 01:54:25 2007 UTC (19 years, 5 months ago) by wrstuden
Branches: wrstuden-fixsa
Diff to: previous 1.49: preferred, colored; next MAIN 1.50: preferred, colored
Changes since revision 1.49: +48 -2 lines
Update to today's netbsd-4.

Revision 1.49.8.1: download - view: text, markup, annotated - select for diffs
Thu May 24 19:13:16 2007 UTC (19 years, 5 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, matt-nb4-arm-base, matt-nb4-arm
Branch point for: netbsd-4-0
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +48 -2 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.58: download - view: text, markup, annotated - select for diffs
Wed May 23 17:15:02 2007 UTC (19 years, 5 months ago) by christos
Branches: MAIN
CVS tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base2, vmlocking2-base1, vmlocking-nbase, vmlocking-base, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, nick-csl-alignment-base5, nick-csl-alignment-base, nick-csl-alignment, mjf-ufs-trans-base, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, jmcneill-pm-base, jmcneill-pm, jmcneill-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf, bouyer-xenamd64-base2, bouyer-xenamd64-base, bouyer-xenamd64
Branch point for: vmlocking2, mjf-devfs, matt-armv6, bouyer-xeni386
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +3 -5 lines
Ansify + add a few comments, from Karl Sjödahl

Revision 1.54.2.3: download - view: text, markup, annotated - select for diffs
Mon May 7 10:56:03 2007 UTC (19 years, 6 months ago) by yamt
Branches: yamt-idlelwp
Diff to: previous 1.54.2.2: preferred, colored; next MAIN 1.55: preferred, colored
Changes since revision 1.54.2.2: +18 -24 lines
sync with head.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Wed May 2 20:40:26 2007 UTC (19 years, 6 months ago) by dyoung
Branches: MAIN
CVS tags: yamt-idlelwp-base8
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +18 -24 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.54.2.2: download - view: text, markup, annotated - select for diffs
Mon Mar 12 05:59:57 2007 UTC (19 years, 8 months ago) by rmind
Branches: yamt-idlelwp
Diff to: previous 1.54.2.1: preferred, colored
Changes since revision 1.54.2.1: +6 -2 lines
Sync with HEAD.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Wed Mar 7 22:20:04 2007 UTC (19 years, 8 months ago) by liamjfoy
Branches: MAIN
CVS tags: thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup
Branch point for: vmlocking, mjf-ufs-trans
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +6 -2 lines
Add IPv6 Fast Forward - the IPv4 counterpart:

If ip6_forward successfully forwards a packet, a cache, in this case a
ip6flow struct entry, will be created. ether_input and friends will
then be able to call ip6flow_fastforward with the packet which will then
be passed to if_output (unless an issue is found - in that case the packet
is passed back to ip6_input).

ok matt@ christos@ dyoung@ and joerg@

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

Revision 1.45.2.3: download - view: text, markup, annotated - select for diffs
Mon Feb 26 09:11:51 2007 UTC (19 years, 8 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.45.2.2: preferred, colored; branchpoint 1.45: preferred, colored
Changes since revision 1.45.2.2: +52 -4 lines
sync with head.

Revision 1.55: download - view: text, markup, annotated - select for diffs
Sat Feb 17 22:34:13 2007 UTC (19 years, 9 months ago) by dyoung
Branches: MAIN
CVS tags: ad-audiomp-base, ad-audiomp
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +5 -3 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.54: download - view: text, markup, annotated - select for diffs
Sat Feb 10 09:43:05 2007 UTC (19 years, 9 months ago) by degroote
Branches: MAIN
Branch point for: yamt-idlelwp
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +48 -2 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.49.4.2: download - view: text, markup, annotated - select for diffs
Thu Feb 1 08:48:44 2007 UTC (19 years, 9 months ago) by ad
Branches: newlock2
Diff to: previous 1.49.4.1: preferred, colored; branchpoint 1.49: preferred, colored; next MAIN 1.50: preferred, colored
Changes since revision 1.49.4.1: +3 -3 lines
Sync with head.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Fri Jan 26 19:20:15 2007 UTC (19 years, 9 months ago) by dyoung
Branches: MAIN
CVS tags: post-newlock2-merge, newlock2-nbase, newlock2-base
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +3 -3 lines
bzero -> memset

Revision 1.49.4.1: download - view: text, markup, annotated - select for diffs
Fri Jan 12 01:04:15 2007 UTC (19 years, 10 months ago) by ad
Branches: newlock2
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +27 -32 lines
Sync with head.

Revision 1.45.2.2: download - view: text, markup, annotated - select for diffs
Sat Dec 30 20:50:38 2006 UTC (19 years, 10 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.45.2.1: preferred, colored; branchpoint 1.45: preferred, colored
Changes since revision 1.45.2.1: +28 -33 lines
sync with head.

Revision 1.49.6.2: download - view: text, markup, annotated - select for diffs
Mon Dec 18 11:42:22 2006 UTC (19 years, 11 months ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.49.6.1: preferred, colored; branchpoint 1.49: preferred, colored; next MAIN 1.50: preferred, colored
Changes since revision 1.49.6.1: +25 -26 lines
sync with head.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Fri Dec 15 21:18:55 2006 UTC (19 years, 11 months ago) by joerg
Branches: MAIN
CVS tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +25 -26 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.49.6.1: download - view: text, markup, annotated - select for diffs
Sun Dec 10 07:19:15 2006 UTC (19 years, 11 months ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +10 -14 lines
sync with head.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Sat Dec 9 05:33:08 2006 UTC (19 years, 11 months ago) by dyoung
Branches: MAIN
CVS tags: yamt-splraiseipl-base3
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +6 -10 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.50: download - view: text, markup, annotated - select for diffs
Sat Dec 2 18:59:17 2006 UTC (19 years, 11 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +6 -6 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.47.2.1: download - view: text, markup, annotated - select for diffs
Sat Sep 9 02:58:55 2006 UTC (20 years, 2 months ago) by rpaulo
Branches: rpaulo-netinet-merge-pcb
Diff to: previous 1.47: preferred, colored; next MAIN 1.48: preferred, colored
Changes since revision 1.47: +7 -7 lines
sync with head

Revision 1.47.6.2: download - view: text, markup, annotated - select for diffs
Fri Aug 11 15:46:48 2006 UTC (20 years, 3 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.47.6.1: preferred, colored; branchpoint 1.47: preferred, colored; next MAIN 1.48: preferred, colored
Changes since revision 1.47.6.1: +3 -3 lines
sync with head

Revision 1.48.2.1: download - view: text, markup, annotated - select for diffs
Thu Jul 13 17:50:06 2006 UTC (20 years, 4 months ago) by gdamore
Branches: gdamore-uart
Diff to: previous 1.48: preferred, colored; next MAIN 1.49: preferred, colored
Changes since revision 1.48: +3 -3 lines
Merge from HEAD.

Revision 1.49: download - view: text, markup, annotated - select for diffs
Thu Jun 29 16:56:31 2006 UTC (20 years, 4 months ago) by liamjfoy
Branches: MAIN
CVS tags: yamt-splraiseipl-base2, yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, yamt-pdpolicy-base7, rpaulo-netinet-merge-pcb-base, netbsd-4-base, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: yamt-splraiseipl, wrstuden-fixsa, newlock2, netbsd-4
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +3 -3 lines
Fix a minor printf found while reading the code

Revision 1.47.6.1: download - view: text, markup, annotated - select for diffs
Mon Jun 26 12:54:13 2006 UTC (20 years, 4 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +6 -6 lines
sync with head.

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

Revision 1.47.12.1: download - view: text, markup, annotated - select for diffs
Mon Jun 19 04:09:49 2006 UTC (20 years, 5 months ago) by chap
Branches: chap-midi
Diff to: previous 1.47: preferred, colored; next MAIN 1.48: preferred, colored
Changes since revision 1.47: +6 -6 lines
Sync with head.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Wed Jun 7 22:34:03 2006 UTC (20 years, 5 months ago) by kardel
Branches: MAIN
CVS tags: yamt-pdpolicy-base6, gdamore-uart-base, chap-midi-nbase, chap-midi-base
Branch point for: gdamore-uart
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +6 -6 lines
merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html

Revision 1.47.4.1: download - view: text, markup, annotated - select for diffs
Sat Feb 4 14:18:52 2006 UTC (20 years, 9 months ago) by simonb
Branches: simonb-timecounters
CVS tags: simonb-timcounters-final
Diff to: previous 1.47: preferred, colored; next MAIN 1.48: preferred, colored
Changes since revision 1.47: +6 -6 lines
Adapt for timecounters: mostly use get*time(), use bintime's for timeout
calculations and use "time_second" instead of "time.tv_sec".

Revision 1.46.2.1: download - view: text, markup, annotated - select for diffs
Wed Feb 1 14:52:41 2006 UTC (20 years, 9 months ago) by yamt
Branches: yamt-uio_vmspace
Diff to: previous 1.46: preferred, colored; next MAIN 1.47: preferred, colored
Changes since revision 1.46: +51 -14 lines
sync with head.

Revision 1.47: download - view: text, markup, annotated - select for diffs
Sat Jan 21 00:15:36 2006 UTC (20 years, 10 months ago) by rpaulo
Branches: MAIN
CVS tags: yamt-uio_vmspace-base5, yamt-pdpolicy-base5, yamt-pdpolicy-base4, yamt-pdpolicy-base3, yamt-pdpolicy-base2, yamt-pdpolicy-base, simonb-timecounters-base, peter-altq-base, peter-altq, elad-kernelauth-base, elad-kernelauth
Branch point for: yamt-pdpolicy, simonb-timecounters, rpaulo-netinet-merge-pcb, chap-midi
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +51 -14 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.46: download - view: text, markup, annotated - select for diffs
Sun Dec 11 12:25:02 2005 UTC (20 years, 11 months ago) by christos
Branches: MAIN
Branch point for: yamt-uio_vmspace
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +2 -2 lines
merge ktrace-lwp.

Revision 1.34.2.5: download - view: text, markup, annotated - select for diffs
Thu Nov 10 14:11:25 2005 UTC (21 years ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.34.2.4: preferred, colored; next MAIN 1.35: preferred, colored
Changes since revision 1.34.2.4: +5 -5 lines
Sync with HEAD. Here we go again...

Revision 1.45: download - view: text, markup, annotated - select for diffs
Sun May 29 21:43:51 2005 UTC (21 years, 5 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
Branch point for: yamt-lazymbuf
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +5 -5 lines
- avoid shadowed variables
- sprinkle const.

Revision 1.43.4.1: download - view: text, markup, annotated - select for diffs
Fri Apr 29 11:29:34 2005 UTC (21 years, 6 months ago) by kent
Branches: kent-audio2
Diff to: previous 1.43: preferred, colored; next MAIN 1.44: preferred, colored
Changes since revision 1.43: +4 -4 lines
sync with -current

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

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

Hi Perry!

Revision 1.44: download - view: text, markup, annotated - select for diffs
Sat Feb 26 22:45:12 2005 UTC (21 years, 8 months ago) by perry
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
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +4 -4 lines
nuke trailing whitespace

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

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

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

Revision 1.43: download - view: text, markup, annotated - select for diffs
Fri Jul 16 01:12:02 2004 UTC (22 years, 4 months ago) by itojun
Branches: MAIN
CVS tags: yamt-km-base2, yamt-km-base, kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Branch point for: yamt-km, kent-audio2
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +3 -3 lines
prevent mbuf leak on IPsec tunnel mode.  from iij seil team

Revision 1.42: download - view: text, markup, annotated - select for diffs
Thu Jun 24 15:01:51 2004 UTC (22 years, 4 months ago) by itojun
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +3 -3 lines
error could be left uninitialized when we jump into "senderr"

Revision 1.12.2.13: download - view: text, markup, annotated - select for diffs
Wed Apr 7 22:33:37 2004 UTC (22 years, 7 months ago) by jmc
Branches: netbsd-1-5
Diff to: previous 1.12.2.12: preferred, colored; branchpoint 1.12: preferred, colored; next MAIN 1.13: preferred, colored
Changes since revision 1.12.2.12: +6 -2 lines
Pullup rev 1.39 (requested by itojun in ticket #99)

Shouldn't check scope match when encapsulating packet into tunnel mode.

Revision 1.12.2.12: download - view: text, markup, annotated - select for diffs
Wed Apr 7 22:07:34 2004 UTC (22 years, 7 months ago) by jmc
Branches: netbsd-1-5
Diff to: previous 1.12.2.11: preferred, colored; branchpoint 1.12: preferred, colored
Changes since revision 1.12.2.11: +2 -2 lines
Pullup rev 1.38 (requested by itojun in ticket #96)

Do not deref state.ro if it is NULL.

Revision 1.12.2.11: download - view: text, markup, annotated - select for diffs
Wed Apr 7 21:57:22 2004 UTC (22 years, 7 months ago) by jmc
Branches: netbsd-1-5
Diff to: previous 1.12.2.10: preferred, colored; branchpoint 1.12: preferred, colored
Changes since revision 1.12.2.10: +18 -5 lines
Pullup patch (requested by itojun in ticket #94)

Correctly look at outer IPv6 header when forwarding packet into ipsec tunnel.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Fri Jan 16 05:12:08 2004 UTC (22 years, 10 months ago) by itojun
Branches: MAIN
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-base, 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-0, netbsd-2
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +23 -5 lines
when ipsec tunnel mode is applied, we are originating packet (instead of
forwarding).  go to ip6_output() path for fragmentation and other processing.
from kame

Revision 1.40: download - view: text, markup, annotated - select for diffs
Wed Oct 29 10:12:43 2003 UTC (23 years ago) by mycroft
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +5 -6 lines
Do a jump optimization that eliminates some uninitialized variable warnings.

Revision 1.27.10.3: download - view: text, markup, annotated - select for diffs
Sat Oct 4 08:36:22 2003 UTC (23 years, 1 month ago) by tron
Branches: netbsd-1-6
CVS tags: netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002
Diff to: previous 1.27.10.2: preferred, colored; branchpoint 1.27: preferred, colored; next MAIN 1.28: preferred, colored
Changes since revision 1.27.10.2: +7 -3 lines
Pull up revision 1.39 (requested by itojun in ticket #1504):
shouldn't check scope match when encapsulating packet into tunnel mode.
iij seil team

Revision 1.39: download - view: text, markup, annotated - select for diffs
Fri Oct 3 04:30:31 2003 UTC (23 years, 1 month ago) by itojun
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +7 -3 lines
shouldn't check scope match when encapsulating packet into tunnel mode.
iij seil team

Revision 1.27.10.2: download - view: text, markup, annotated - select for diffs
Thu Oct 2 20:46:39 2003 UTC (23 years, 1 month ago) by tron
Branches: netbsd-1-6
Diff to: previous 1.27.10.1: preferred, colored; branchpoint 1.27: preferred, colored
Changes since revision 1.27.10.1: +3 -3 lines
Pull up revision 1.38 (requested by itojun in ticket #1501):
do not deref state.ro if it is NULL

Revision 1.27.10.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 20:37:32 2003 UTC (23 years, 1 month ago) by tron
Branches: netbsd-1-6
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +19 -6 lines
Pull up revision 1.37 via patch (requested by itojun in ticket #1500):
correctly look at outer IPv6 header when forwarding packet into ipsec tunnel.
iij seil team

Revision 1.38: download - view: text, markup, annotated - select for diffs
Thu Oct 2 19:32:41 2003 UTC (23 years, 1 month ago) by itojun
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +3 -3 lines
do not deref state.ro if it is NULL

Revision 1.37: download - view: text, markup, annotated - select for diffs
Thu Oct 2 12:13:44 2003 UTC (23 years, 1 month ago) by itojun
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +19 -6 lines
correctly look at outer IPv6 header when forwarding packet into ipsec tunnel.
iij seil team

Revision 1.36: download - view: text, markup, annotated - select for diffs
Thu Aug 7 08:52:33 2003 UTC (23 years, 3 months ago) by itojun
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +3 -3 lines
make net.inet6.ip6.redirect actually work.  from Tomoyuki Sahara via kame

Revision 1.35: download - view: text, markup, annotated - select for diffs
Thu Jul 3 05:03:55 2003 UTC (23 years, 4 months ago) by itojun
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +4 -4 lines
minor KNF

Revision 1.34: download - view: text, markup, annotated - select for diffs
Mon Jun 30 03:30:50 2003 UTC (23 years, 4 months ago) by itojun
Branches: MAIN
Branch point for: ktrace-lwp
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +3 -3 lines
KNF

Revision 1.33: download - view: text, markup, annotated - select for diffs
Tue Jun 24 07:39:25 2003 UTC (23 years, 4 months ago) by itojun
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +6 -7 lines
use time.tv_sec directly

Revision 1.12.2.10: download - view: text, markup, annotated - select for diffs
Tue Feb 11 15:58:04 2003 UTC (23 years, 9 months ago) by msaitoh
Branches: netbsd-1-5
Diff to: previous 1.12.2.9: preferred, colored; branchpoint 1.12: preferred, colored
Changes since revision 1.12.2.9: +19 -2 lines
Pull up revision 1.22 (requested by itojun):
  do not forward packet back to point-to-point interface, if the packet
  matches the ipv6 prefix assigned to the p2p interface (= redirect case).
  this leads to pingpong, chews bandwidth.  bad thing is that bad guy from
  remote can chew bandwidth.  (follows upcoming internet draft)

Revision 1.12.2.9: download - view: text, markup, annotated - select for diffs
Thu Nov 14 15:45:49 2002 UTC (24 years ago) by itojun
Branches: netbsd-1-5
Diff to: previous 1.12.2.8: preferred, colored; branchpoint 1.12: preferred, colored
Changes since revision 1.12.2.8: +2 -1 lines
sys/netinet6/ip6_forward.c			1.20 via patch

  Need opt_pfil_hooks.h for PFIL_HOOK.

(masanobu)

Revision 1.22.2.4: download - view: text, markup, annotated - select for diffs
Thu Oct 10 18:44:17 2002 UTC (24 years, 1 month ago) by jdolecek
Branches: kqueue
Diff to: previous 1.22.2.3: preferred, colored; next MAIN 1.23: preferred, colored
Changes since revision 1.22.2.3: +18 -3 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.18.2.8: download - view: text, markup, annotated - select for diffs
Tue Sep 17 21:23:22 2002 UTC (24 years, 2 months ago) by nathanw
Branches: nathanw_sa
CVS tags: nathanw_sa_end
Diff to: previous 1.18.2.7: preferred, colored; next MAIN 1.19: preferred, colored
Changes since revision 1.18.2.7: +18 -3 lines
Catch up to -current.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Wed Sep 11 08:15:37 2002 UTC (24 years, 2 months ago) by itojun
Branches: MAIN
CVS tags: nathanw_sa_before_merge, nathanw_sa_base, kqueue-beforemerge, kqueue-base, kqueue-aftermerge, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +18 -3 lines
avoid from applying IPsec transport mode to the packets when the kernel
forwards the packets.
sync w/kame

Revision 1.22.2.3: download - view: text, markup, annotated - select for diffs
Sun Jun 23 17:51:15 2002 UTC (24 years, 4 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.22.2.2: preferred, colored
Changes since revision 1.22.2.2: +7 -9 lines
catch up with -current on kqueue branch

Revision 1.27.8.2: download - view: text, markup, annotated - select for diffs
Thu Jun 20 15:52:44 2002 UTC (24 years, 5 months ago) by gehenna
Branches: gehenna-devsw
Diff to: previous 1.27.8.1: preferred, colored; branchpoint 1.27: preferred, colored; next MAIN 1.28: preferred, colored
Changes since revision 1.27.8.1: +4 -6 lines
catch up with -current.

Revision 1.18.2.7: download - view: text, markup, annotated - select for diffs
Thu Jun 20 03:49:19 2002 UTC (24 years, 5 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.18.2.6: preferred, colored
Changes since revision 1.18.2.6: +7 -9 lines
Catch up to -current.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Sat Jun 8 21:22:33 2002 UTC (24 years, 5 months ago) by itojun
Branches: MAIN
CVS tags: gehenna-devsw-base
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +3 -5 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.30: download - view: text, markup, annotated - select for diffs
Fri Jun 7 04:18:12 2002 UTC (24 years, 5 months ago) by itojun
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +3 -3 lines
typo

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

Revision 1.27.8.1: download - view: text, markup, annotated - select for diffs
Thu May 30 13:52:32 2002 UTC (24 years, 5 months ago) by gehenna
Branches: gehenna-devsw
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +5 -5 lines
Catch up with -current.

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

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

Revision 1.12.2.7: download - view: text, markup, annotated - select for diffs
Sat Feb 9 17:02:15 2002 UTC (24 years, 9 months ago) by he
Branches: netbsd-1-5
Diff to: previous 1.12.2.6: preferred, colored; branchpoint 1.12: preferred, colored
Changes since revision 1.12.2.6: +34 -1 lines
Pull up revision 1.12.2.5 (requested by martti):
  Updated IPFilter to 3.4.23.
  (This one re-adds filtering support for forwarded IPv6 packets.)

Revision 1.22.2.2: download - view: text, markup, annotated - select for diffs
Thu Jan 10 20:03:19 2002 UTC (24 years, 10 months ago) by thorpej
Branches: kqueue
Diff to: previous 1.22.2.1: preferred, colored
Changes since revision 1.22.2.1: +6 -9 lines
Sync kqueue branch with -current.

Revision 1.18.2.6: download - view: text, markup, annotated - select for diffs
Tue Jan 8 00:34:19 2002 UTC (24 years, 10 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.18.2.5: preferred, colored
Changes since revision 1.18.2.5: +3 -3 lines
Catch up to -current.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Tue Dec 18 03:04:03 2001 UTC (24 years, 11 months ago) by itojun
Branches: MAIN
CVS tags: newlock-base, newlock, netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, ifpoll-base, eeh-devprop-base, eeh-devprop
Branch point for: netbsd-1-6, gehenna-devsw
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +3 -3 lines
reduce white space/cosmetic diffs w/kame.

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

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

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

Revision 1.12.2.6: download - view: text, markup, annotated - select for diffs
Thu Oct 25 13:22:12 2001 UTC (25 years ago) by jhawk
Branches: netbsd-1-5
Diff to: previous 1.12.2.5: preferred, colored; branchpoint 1.12: preferred, colored
Changes since revision 1.12.2.5: +0 -33 lines
Revert Darren Reed <darrenr@netbsd.org>'s unauthorized commit to the
netbsd-1-5 branch, rev 1.12.2.5 of 2001/10/15 13:19:15. This may
re-appear on the branch pending suitable review.

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

Revision 1.18.2.4: download - view: text, markup, annotated - select for diffs
Mon Oct 22 20:42:02 2001 UTC (25 years, 1 month ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.18.2.3: preferred, colored
Changes since revision 1.18.2.3: +1 -7 lines
Catch up to -current.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Wed Oct 17 08:23:06 2001 UTC (25 years, 1 month ago) by itojun
Branches: MAIN
Branch point for: thorpej-mips-cache
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +1 -7 lines
unifdef OLDIP6OUTPUT

Revision 1.12.2.5: download - view: text, markup, annotated - select for diffs
Mon Oct 15 13:19:15 2001 UTC (25 years, 1 month ago) by darrenr
Branches: netbsd-1-5
Diff to: previous 1.12.2.4: preferred, colored; branchpoint 1.12: preferred, colored
Changes since revision 1.12.2.4: +34 -1 lines
add ipv6 filtering hooks with pfil_hook for forwarded packet case

Revision 1.18.2.3: download - view: text, markup, annotated - select for diffs
Fri Aug 24 00:12:40 2001 UTC (25 years, 2 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.18.2.2: preferred, colored
Changes since revision 1.18.2.2: +25 -2 lines
Catch up with -current.

Revision 1.22.2.1: download - view: text, markup, annotated - select for diffs
Fri Aug 3 04:13:59 2001 UTC (25 years, 3 months ago) by lukem
Branches: kqueue
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +13 -7 lines
update to -current

Revision 1.23: download - view: text, markup, annotated - select for diffs
Wed Jul 18 09:24:26 2001 UTC (25 years, 4 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
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +13 -7 lines
sync with draft-ietf-ipngwg-p2p-pingpong-00.txt.  apply special behavior
only if ip6_dst is "neighbor" within p2p prefix.  sync with kame

Revision 1.22: download - view: text, markup, annotated - select for diffs
Fri Jun 22 12:33:05 2001 UTC (25 years, 5 months ago) by itojun
Branches: MAIN
Branch point for: kqueue
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +20 -3 lines
do not forward packet back to point-to-point interface, if the packet
matches the ipv6 prefix assigned to the p2p interface (= redirect case).
this leads to pingpong, chews bandwidth.  bad thing is that bad guy from
remote can chew bandwidth.  (follows upcoming internet draft)

Revision 1.18.2.2: download - view: text, markup, annotated - select for diffs
Thu Jun 21 20:08:57 2001 UTC (25 years, 5 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.18.2.1: preferred, colored
Changes since revision 1.18.2.1: +27 -3 lines
Catch up to -current.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Tue Jun 12 17:55:52 2001 UTC (25 years, 5 months ago) by matt
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +3 -1 lines
senderr needs only be declared when PFIL_HOOKS is defined

Revision 1.20: download - view: text, markup, annotated - select for diffs
Tue Jun 12 15:12:33 2001 UTC (25 years, 5 months ago) by itojun
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +25 -3 lines
run pfil_hooks for IPv6 forwarding path (note: ip6_forward() does not
call ip6_output()).

Revision 1.4.2.3: download - view: text, markup, annotated - select for diffs
Sat Apr 21 17:46:55 2001 UTC (25 years, 7 months ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.4.2.2: preferred, colored; branchpoint 1.4: preferred, colored; next MAIN 1.5: preferred, colored
Changes since revision 1.4.2.2: +8 -19 lines
Sync with HEAD

Revision 1.18.2.1: download - view: text, markup, annotated - select for diffs
Mon Apr 9 01:58:38 2001 UTC (25 years, 7 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +8 -19 lines
Catch up with -current.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Fri Mar 30 11:08:57 2001 UTC (25 years, 7 months ago) by itojun
Branches: MAIN
CVS tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +8 -19 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.4.2.2: download - view: text, markup, annotated - select for diffs
Sun Feb 11 19:17:24 2001 UTC (25 years, 9 months ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.4.2.1: preferred, colored; branchpoint 1.4: preferred, colored
Changes since revision 1.4.2.1: +5 -25 lines
Sync with HEAD.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Sat Feb 10 04:14:28 2001 UTC (25 years, 9 months ago) by itojun
Branches: MAIN
Branch point for: nathanw_sa
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +5 -25 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.4.2.1: download - view: text, markup, annotated - select for diffs
Mon Nov 20 18:10:51 2000 UTC (26 years ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +355 -44 lines
Update thorpej_scsipi to -current as of a month ago

Revision 1.12.2.4: download - view: text, markup, annotated - select for diffs
Fri Sep 29 06:29:54 2000 UTC (26 years, 1 month ago) by itojun
Branches: netbsd-1-5
CVS tags: netbsd-1-5-RELEASE, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA
Diff to: previous 1.12.2.3: preferred, colored; branchpoint 1.12: preferred, colored
Changes since revision 1.12.2.3: +4 -3 lines
pullup (approved by releng-1-5)

do not try to look up port number on forwarding case.
sys/netinet6/ip6_forward.c 1.16 -> 1.17

Revision 1.17: download - view: text, markup, annotated - select for diffs
Fri Sep 22 05:50:23 2000 UTC (26 years, 2 months ago) by itojun
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +4 -3 lines
on ipsec policy lookup, do not try to lookup port numbers for forwarded packet.
sync with kame.

Revision 1.12.2.3: download - view: text, markup, annotated - select for diffs
Fri Jul 28 02:31:25 2000 UTC (26 years, 3 months ago) by itojun
Branches: netbsd-1-5
CVS tags: netbsd-1-5-ALPHA2
Diff to: previous 1.12.2.2: preferred, colored; branchpoint 1.12: preferred, colored
Changes since revision 1.12.2.2: +10 -3 lines
pullup 1.15 -> 1.16 (aproved by releng-1-5)

 > do not forward packet with :: in the source.
 > this is not in the spec - we had rough consensus on it in ipngwg,
 > spec will get updated to include this behavior.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Thu Jul 27 15:53:51 2000 UTC (26 years, 3 months ago) by itojun
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +10 -3 lines
do not forward packet with :: in the source.
this is not in the spec - we had rough consensus on it in ipngwg,
spec will get updated to include this behavior.

Revision 1.12.2.2: download - view: text, markup, annotated - select for diffs
Mon Jul 17 02:42:12 2000 UTC (26 years, 4 months ago) by itojun
Branches: netbsd-1-5
Diff to: previous 1.12.2.1: preferred, colored; branchpoint 1.12: preferred, colored
Changes since revision 1.12.2.1: +13 -12 lines
pullup 1.13 -> 1.15 (approved by releng-1-5)

1.14 -> 1.15
s/IPSEC_IPV6FWD/IPSEC/.  this should correct strange behavior on ipv6
forwarding (even if policy asks for tunnel mode encryption, packets
go out in clear).  sync with kame.

1.13 -> 1.14
date: 2000/07/06 12:51:41;  author: itojun;  state: Exp;  lines: +2 -3
remove unnecessary #include <netkey/key_debug.h>.  from kame.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Sun Jul 16 07:57:55 2000 UTC (26 years, 4 months ago) by itojun
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +13 -11 lines
s/IPSEC_IPV6FWD/IPSEC/.  this should correct strange behavior on ipv6
forwarding (even if policy asks for tunnel mode encryption, packets
go out in clear).  sync with kame.

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

Revision 1.12.2.1: download - view: text, markup, annotated - select for diffs
Sat Jul 1 00:15:22 2000 UTC (26 years, 4 months ago) by itojun
Branches: netbsd-1-5
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +13 -8 lines
mrege 1.12 -> 1.13: (approved by: releng-1-5)
suppress too noisy warning on forward-over-loopback case.  from kame

Revision 1.13: download - view: text, markup, annotated - select for diffs
Fri Jun 30 19:46:05 2000 UTC (26 years, 4 months ago) by itojun
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +13 -8 lines
suppress too noisy warning on forward-over-loopback case.  from kame

Revision 1.11.2.1: download - view: text, markup, annotated - select for diffs
Thu Jun 22 17:10:01 2000 UTC (26 years, 5 months ago) by minoura
Branches: minoura-xpg4dl
Diff to: previous 1.11: preferred, colored; next MAIN 1.12: preferred, colored
Changes since revision 1.11: +13 -7 lines
Sync w/ netbsd-1-5-base.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sat Jun 3 14:36:36 2000 UTC (26 years, 5 months ago) by itojun
Branches: MAIN
CVS tags: netbsd-1-5-base
Branch point for: netbsd-1-5
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +13 -7 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.11: download - view: text, markup, annotated - select for diffs
Fri May 19 20:09:26 2000 UTC (26 years, 6 months ago) by itojun
Branches: MAIN
CVS tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +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.10: download - view: text, markup, annotated - select for diffs
Fri May 19 01:40:18 2000 UTC (26 years, 6 months ago) by itojun
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +50 -7 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.9: download - view: text, markup, annotated - select for diffs
Sat Feb 26 08:39:20 2000 UTC (26 years, 8 months ago) by itojun
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +37 -7 lines
bring in recent KAME changes (only important and stable ones, as usual).
- remove net.inet6.ip6.nd6_proxyall.  introduce proxy NDP code works
  just like "arp -s".
- revise source address selection.
  be more careful about use of yet-to-be-valid addresses as source.
- as router, transmit ICMP6_DST_UNREACH_BEYONDSCOPE against out-of-scope
  packet forwarding attempt.
- path MTU discovery takes care of routing header properly.
- be more strict about mbuf chain parsing.

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

Revision 1.7: download - view: text, markup, annotated - select for diffs
Mon Jan 31 14:19:03 2000 UTC (26 years, 9 months ago) by itojun
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +31 -1 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.6: download - view: text, markup, annotated - select for diffs
Thu Jan 6 15:46:09 2000 UTC (26 years, 10 months ago) by itojun
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +1 -21 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.4.8.1: download - view: text, markup, annotated - select for diffs
Mon Dec 27 18:36:25 1999 UTC (26 years, 10 months ago) by wrstuden
Branches: wrstuden-devbsize
Diff to: previous 1.4: preferred, colored; next MAIN 1.5: preferred, colored
Changes since revision 1.4: +242 -34 lines
Pull up to last week's -current.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Mon Dec 13 15:17:22 1999 UTC (26 years, 11 months ago) by itojun
Branches: MAIN
CVS tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +242 -34 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:53 1999 UTC (26 years, 11 months 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: +199 -21 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 (27 years, 3 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: +2 -1 lines
Update from trunk.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Fri Jul 30 10:35:36 1999 UTC (27 years, 3 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.3: preferred, colored
Changes since revision 1.3: +1 -2 lines
remove reference to in6_systm.h (file itself will be removed afterwords)

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sat Jul 3 21:30:18 1999 UTC (27 years, 4 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 (27 years, 4 months ago) by thorpej
Branches: chs-ubc2
Diff to: previous 1.2.2.1: preferred, colored
Changes since revision 1.2.2.1: +237 -0 lines
Sync w/ -current.

Revision 1.2.2.1
Thu Jul 1 08:12:55 1999 UTC (27 years, 4 months ago) by thorpej
Branches: chs-ubc2
FILE REMOVED
Changes since revision 1.2: +0 -237 lines
file ip6_forward.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:55 1999 UTC (27 years, 4 months ago) by itojun
Branches: MAIN
Branch point for: chs-ubc2
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +237 -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 (27 years, 4 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: +237 -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 (27 years, 4 months ago) by itojun
Branches: MAIN
Branch point for: kame
FILE REMOVED
file ip6_forward.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>