The NetBSD Project

CVS log for src/sys/net/route.c

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.194.6.17 / (download) - annotate - [select for diffs], Thu Jun 8 11:19:05 2023 UTC (9 months, 2 weeks ago) by martin
Branch: netbsd-8
Changes since 1.194.6.16: +6 -4 lines
Diff to previous 1.194.6.16 (colored) to branchpoint 1.194 (colored) next main 1.195 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #1824):

	sys/net/route.c: revision 1.237

route: run workqueue kthreads with KERNEL_LOCK unless NET_MPSAFE

Without KERNEL_LOCK, rt_timer_work and rt_free_work can run in parallel
with other LWPs running in the network stack, which eventually results
in say use-after-free of a deleted route.

Revision 1.219.2.4 / (download) - annotate - [select for diffs], Thu Jun 8 11:17:18 2023 UTC (9 months, 2 weeks ago) by martin
Branch: netbsd-9
Changes since 1.219.2.3: +6 -4 lines
Diff to previous 1.219.2.3 (colored) to branchpoint 1.219 (colored) next main 1.220 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #1642):

	sys/net/route.c: revision 1.237

route: run workqueue kthreads with KERNEL_LOCK unless NET_MPSAFE

Without KERNEL_LOCK, rt_timer_work and rt_free_work can run in parallel
with other LWPs running in the network stack, which eventually results
in say use-after-free of a deleted route.

Revision 1.235.2.2 / (download) - annotate - [select for diffs], Thu Jun 8 11:15:26 2023 UTC (9 months, 2 weeks ago) by martin
Branch: netbsd-10
CVS Tags: netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1
Changes since 1.235.2.1: +6 -4 lines
Diff to previous 1.235.2.1 (colored) to branchpoint 1.235 (colored) next main 1.236 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #195):

	sys/net/route.c: revision 1.237

route: run workqueue kthreads with KERNEL_LOCK unless NET_MPSAFE

Without KERNEL_LOCK, rt_timer_work and rt_free_work can run in parallel
with other LWPs running in the network stack, which eventually results
in say use-after-free of a deleted route.

Revision 1.237 / (download) - annotate - [select for diffs], Mon Jun 5 03:51:45 2023 UTC (9 months, 3 weeks ago) by ozaki-r
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, HEAD
Changes since 1.236: +6 -4 lines
Diff to previous 1.236 (colored) to selected 1.139 (colored)

route: run workqueue kthreads with KERNEL_LOCK unless NET_MPSAFE

Without KERNEL_LOCK, rt_timer_work and rt_free_work can run in parallel
with other LWPs running in the network stack, which eventually results
in say use-after-free of a deleted route.

Revision 1.194.6.16 / (download) - annotate - [select for diffs], Wed Feb 22 18:55:06 2023 UTC (13 months ago) by martin
Branch: netbsd-8
Changes since 1.194.6.15: +12 -3 lines
Diff to previous 1.194.6.15 (colored) to branchpoint 1.194 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by riastradh in ticket #1801):

	sys/net/route.c: revision 1.236

route(4): Work around deadlock in rt_free wait path.
PR kern/56844

Revision 1.219.2.3 / (download) - annotate - [select for diffs], Wed Feb 22 18:53:56 2023 UTC (13 months ago) by martin
Branch: netbsd-9
Changes since 1.219.2.2: +12 -3 lines
Diff to previous 1.219.2.2 (colored) to branchpoint 1.219 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by riastradh in ticket #1602):

	sys/net/route.c: revision 1.236

route(4): Work around deadlock in rt_free wait path.
PR kern/56844

Revision 1.235.2.1 / (download) - annotate - [select for diffs], Wed Feb 22 18:52:45 2023 UTC (13 months ago) by martin
Branch: netbsd-10
Changes since 1.235: +12 -3 lines
Diff to previous 1.235 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by riastradh in ticket #99):

	sys/net/route.c: revision 1.236

route(4): Work around deadlock in rt_free wait path.
PR kern/56844

Revision 1.236 / (download) - annotate - [select for diffs], Thu Dec 22 13:54:57 2022 UTC (15 months ago) by riastradh
Branch: MAIN
Changes since 1.235: +12 -3 lines
Diff to previous 1.235 (colored) to selected 1.139 (colored)

route(4): Work around deadlock in rt_free wait path.

PR kern/56844

XXX pullup-8
XXX pullup-9
XXX pullup-10

Revision 1.235 / (download) - annotate - [select for diffs], Fri Nov 25 08:39:32 2022 UTC (16 months ago) by knakahara
Branch: MAIN
CVS Tags: netbsd-10-base
Branch point for: netbsd-10
Changes since 1.234: +7 -2 lines
Diff to previous 1.234 (colored) to selected 1.139 (colored)

Support explicit unnumbered interface.

Currently, NetBSD supports implicit unnumbered interface by setting
the same IP address to two interfaces.  However, such interface is not
treated as unnumbered when one of the interfaces is being changed and
has been changed IP address.  That behavior can be harmful for some
routing daemons.

Revision 1.234 / (download) - annotate - [select for diffs], Tue Sep 20 02:23:37 2022 UTC (18 months, 1 week ago) by knakahara
Branch: MAIN
CVS Tags: bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.233: +55 -3 lines
Diff to previous 1.233 (colored) to selected 1.139 (colored)

Remove routes on an address removal if the routes referencing to the address.  Implemented by ozaki-r@n.o.

A route that has a gateway is on a connected route can be invalid if the
connected route is deleted, i.e., an associated address is removed.
Traditionally NetBSD doesn't sweep such a route on the address removal.  Sending
packets over the route fails with "No route to host".  Also the route holds an
orphan ifaddr as rt_ifa that is destructed say by in_purgeaddr.

If the same address is assgined again in such a state, there can be two
different ifaddr objects with the same address.  Until recently it's not a
big problem because we can send packets anyway.  However after MP-ification
of the network stack, we can't send packets because we strictly check if rt_ifa
(i.e., the (old) ifaddr) is valid.

This change automatically removes such routes on a removal of an associated
address to avoid keeping inconsistent routes.

Revision 1.233 / (download) - annotate - [select for diffs], Mon Aug 29 23:48:18 2022 UTC (18 months, 4 weeks ago) by knakahara
Branch: MAIN
Changes since 1.232: +13 -7 lines
Diff to previous 1.232 (colored) to selected 1.139 (colored)

Fix build failure when no options INET6.

Revision 1.232 / (download) - annotate - [select for diffs], Mon Aug 29 09:14:02 2022 UTC (18 months, 4 weeks ago) by knakahara
Branch: MAIN
Changes since 1.231: +43 -2 lines
Diff to previous 1.231 (colored) to selected 1.139 (colored)

Add sysctl entry to control to send routing message for RTM_DYNAMIC.

Some routing daemons require such routing message to keep coherency.

If we want to let kernel send such message, set net.inet.icmp.dynamic_rt_msg=1
for IPv4, net.inet6.icmp6.dynamic_rt_msg=1 for IPv6.
Default(=0) is the same as before, that is, not send such routing message.

Revision 1.231 / (download) - annotate - [select for diffs], Fri Aug 26 08:32:22 2022 UTC (19 months ago) by knakahara
Branch: MAIN
Changes since 1.230: +2 -31 lines
Diff to previous 1.230 (colored) to selected 1.139 (colored)

Refactor: rtrequest_newmsg() is no longer used after nd6_rtr.c:r1.149

That has bumped up to 9.99.66 when nd6_rtr.c:r1.149 was commited.

Revision 1.230 / (download) - annotate - [select for diffs], Sun Dec 5 04:57:38 2021 UTC (2 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.229: +3 -3 lines
Diff to previous 1.229 (colored) to selected 1.139 (colored)

s/gurantee/guarantee/ in comment.

Revision 1.210.2.2 / (download) - annotate - [select for diffs], Mon Apr 13 08:05:15 2020 UTC (3 years, 11 months ago) by martin
Branch: phil-wifi
Changes since 1.210.2.1: +58 -39 lines
Diff to previous 1.210.2.1 (colored) to branchpoint 1.210 (colored) next main 1.211 (colored) to selected 1.139 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.229 / (download) - annotate - [select for diffs], Wed Apr 8 03:37:14 2020 UTC (3 years, 11 months ago) by knakahara
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, phil-wifi-20200421, phil-wifi-20200411, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh
Changes since 1.228: +3 -3 lines
Diff to previous 1.228 (colored) to selected 1.139 (colored)

Fix typo in comment

Revision 1.228 / (download) - annotate - [select for diffs], Wed Apr 1 02:38:17 2020 UTC (3 years, 11 months ago) by knakahara
Branch: MAIN
CVS Tags: phil-wifi-20200406, is-mlppp-base, is-mlppp
Changes since 1.227: +3 -3 lines
Diff to previous 1.227 (colored) to selected 1.139 (colored)

Fix typo in comment.

Revision 1.226.2.1 / (download) - annotate - [select for diffs], Sat Feb 29 20:21:06 2020 UTC (4 years ago) by ad
Branch: ad-namecache
Changes since 1.226: +4 -7 lines
Diff to previous 1.226 (colored) next main 1.227 (colored) to selected 1.139 (colored)

Sync with head.

Revision 1.227 / (download) - annotate - [select for diffs], Sat Feb 1 12:54:50 2020 UTC (4 years, 1 month ago) by riastradh
Branch: MAIN
CVS Tags: ad-namecache-base3
Changes since 1.226: +4 -7 lines
Diff to previous 1.226 (colored) to selected 1.139 (colored)

Switch sys/net to percpu_create.

Revision 1.226 / (download) - annotate - [select for diffs], Wed Nov 13 02:51:22 2019 UTC (4 years, 4 months ago) by ozaki-r
Branch: MAIN
CVS Tags: phil-wifi-20191119, ad-namecache-base2, ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.225: +16 -19 lines
Diff to previous 1.225 (colored) to selected 1.139 (colored)

Get rid of unnecessary NULL checks for rt_ifa and ifa_ifp

They are always non-NULL nowadays.

Revision 1.194.6.15 / (download) - annotate - [select for diffs], Fri Oct 4 11:26:35 2019 UTC (4 years, 5 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE
Changes since 1.194.6.14: +18 -17 lines
Diff to previous 1.194.6.14 (colored) to branchpoint 1.194 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by rin in ticket #1398):

	sys/net/route.c: revision 1.222

Stop passing a large const structure by value, in order to avoid
possible kernel stack overflow; const pointer is suffice here.

Pointed out by the lgtm bot and kamil.
OK ozaki-r

XXX
pullup to netbsd-9

Revision 1.219.2.2 / (download) - annotate - [select for diffs], Thu Oct 3 17:12:53 2019 UTC (4 years, 5 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Changes since 1.219.2.1: +19 -18 lines
Diff to previous 1.219.2.1 (colored) to branchpoint 1.219 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by knakahara in ticket #272):

	sys/net/route.c: revision 1.222
	sys/net/route.c: revision 1.224
	sys/net/route.c: revision 1.225

Stop passing a large const structure by value, in order to avoid
possible kernel stack overflow; const pointer is suffice here.
Pointed out by the lgtm bot and kamil.
OK ozaki-r

 -

Fix a ifa_release() leak for a specific struct rt_addrinfo.
ok by ozaki-r@n.o

 -

Revert route.c:r1.224 to fix net/arp/t_arp and net/ndp/t_ndp failure.
And refactor a little. Discussed with ozaki-r@n.o.

Revision 1.225 / (download) - annotate - [select for diffs], Thu Oct 3 03:10:02 2019 UTC (4 years, 5 months ago) by knakahara
Branch: MAIN
Changes since 1.224: +4 -7 lines
Diff to previous 1.224 (colored) to selected 1.139 (colored)

Revert route.c:r1.224 to fix net/arp/t_arp and net/ndp/t_ndp failure.

And refactor a little. Discussed with ozaki-r@n.o.

Revision 1.224 / (download) - annotate - [select for diffs], Mon Sep 30 10:22:14 2019 UTC (4 years, 5 months ago) by knakahara
Branch: MAIN
Changes since 1.223: +6 -3 lines
Diff to previous 1.223 (colored) to selected 1.139 (colored)

Fix a ifa_release() leak for a specific struct rt_addrinfo.

ok by ozaki-r@n.o

Revision 1.223 / (download) - annotate - [select for diffs], Wed Sep 25 09:53:37 2019 UTC (4 years, 6 months ago) by ozaki-r
Branch: MAIN
Changes since 1.222: +4 -4 lines
Diff to previous 1.222 (colored) to selected 1.139 (colored)

Make panic messages more informative

Revision 1.194.6.14 / (download) - annotate - [select for diffs], Tue Sep 24 18:27:09 2019 UTC (4 years, 6 months ago) by martin
Branch: netbsd-8
Changes since 1.194.6.13: +26 -2 lines
Diff to previous 1.194.6.13 (colored) to branchpoint 1.194 (colored) to selected 1.139 (colored)

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.219.2.1 / (download) - annotate - [select for diffs], Tue Sep 24 03:10:35 2019 UTC (4 years, 6 months ago) by martin
Branch: netbsd-9
Changes since 1.219: +26 -2 lines
Diff to previous 1.219 (colored) to selected 1.139 (colored)

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.222 / (download) - annotate - [select for diffs], Mon Sep 23 05:00:20 2019 UTC (4 years, 6 months ago) by rin
Branch: MAIN
Changes since 1.221: +18 -17 lines
Diff to previous 1.221 (colored) to selected 1.139 (colored)

Stop passing a large const structure by value, in order to avoid
possible kernel stack overflow; const pointer is suffice here.

Pointed out by the lgtm bot and kamil.

OK ozaki-r

XXX
pullup to netbsd-9

Revision 1.221 / (download) - annotate - [select for diffs], Thu Sep 19 04:46:29 2019 UTC (4 years, 6 months ago) by ozaki-r
Branch: MAIN
Changes since 1.220: +3 -2 lines
Diff to previous 1.220 (colored) to selected 1.139 (colored)

Add missing #include <sys/kmem.h>

Revision 1.220 / (download) - annotate - [select for diffs], Thu Sep 19 04:08:29 2019 UTC (4 years, 6 months ago) by ozaki-r
Branch: MAIN
Changes since 1.219: +25 -2 lines
Diff to previous 1.219 (colored) to selected 1.139 (colored)

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.210.2.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:09:45 2019 UTC (4 years, 9 months ago) by christos
Branch: phil-wifi
Changes since 1.210: +49 -58 lines
Diff to previous 1.210 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.219 / (download) - annotate - [select for diffs], Fri May 17 03:34:26 2019 UTC (4 years, 10 months ago) by ozaki-r
Branch: MAIN
CVS Tags: phil-wifi-20190609, netbsd-9-base
Branch point for: netbsd-9
Changes since 1.218: +4 -2 lines
Diff to previous 1.218 (colored) to selected 1.139 (colored)

Implement an aggressive psref leak detector

It is yet another psref leak detector that enables to tell where a leak occurs
while a simpler version that is already committed just tells an occurrence of a
leak.

Investigating of psref leaks is hard because once a leak occurs a percpu list of
psref that tracks references can be corrupted.  A reference to a tracking object
is memorized in the list via an intermediate object (struct psref) that is
normally allocated on a stack of a thread.  Thus, the intermediate object can be
overwritten on a leak resulting in corruption of the list.

The tracker makes a shadow entry to an intermediate object and stores some hints
into it (currently it's a caller address of psref_acquire).  We can detect a
leak by checking the entries on certain points where any references should be
released such as the return point of syscalls and the end of each softint
handler.

The feature is expensive and enabled only if the kernel is built with
PSREF_DEBUG.

Proposed on tech-kern

Revision 1.218 / (download) - annotate - [select for diffs], Mon Apr 29 11:57:22 2019 UTC (4 years, 11 months ago) by roy
Branch: MAIN
Changes since 1.217: +6 -6 lines
Diff to previous 1.217 (colored) to selected 1.139 (colored)

rtsock: Route address message simplification

Rename rt_newaddrmsg to rt_addrmsg_rt.
Add rt_addrmsg which drops the error and route arguments which are only
needed by one caller.

Revision 1.194.6.13 / (download) - annotate - [select for diffs], Fri Mar 15 14:44:05 2019 UTC (5 years ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-1-RELEASE, netbsd-8-1-RC1
Changes since 1.194.6.12: +5 -2 lines
Diff to previous 1.194.6.12 (colored) to branchpoint 1.194 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #1215):

	sys/net/route.c: revision 1.217

Add missing ifa_release on error paths

Revision 1.217 / (download) - annotate - [select for diffs], Mon Mar 11 03:00:41 2019 UTC (5 years ago) by ozaki-r
Branch: MAIN
CVS Tags: isaki-audio2-base, isaki-audio2
Changes since 1.216: +5 -2 lines
Diff to previous 1.216 (colored) to selected 1.139 (colored)

Add missing ifa_release on error paths

Revision 1.206.2.7 / (download) - annotate - [select for diffs], Mon Nov 26 01:52:50 2018 UTC (5 years, 4 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.206.2.6: +28 -42 lines
Diff to previous 1.206.2.6 (colored) to branchpoint 1.206 (colored) next main 1.207 (colored) to selected 1.139 (colored)

Sync with HEAD, resolve a couple of conflicts

Revision 1.194.6.12 / (download) - annotate - [select for diffs], Tue Nov 6 14:38:58 2018 UTC (5 years, 4 months ago) by martin
Branch: netbsd-8
Changes since 1.194.6.11: +28 -42 lines
Diff to previous 1.194.6.11 (colored) to branchpoint 1.194 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #1080):

	sys/netinet6/nd6.c: revision 1.251
	sys/netinet/if_arp.c: revision 1.276
	sys/net/if.c: revision 1.438
	sys/net/if.c: revision 1.439
	sys/net/route.c: revision 1.214
	sys/net/route.c: revision 1.215
	sys/net/route.c: revision 1.216
	sys/netinet6/in6.c: revision 1.270
	sys/net/route.h: revision 1.120
	sys/net/if.c: revision 1.440

Remove a wrong assertion in ifaref

 -

Doing ifref on an ifa with IFA_DESTROYING is not a problem; the reference should
be dropped during the destruction of the ifa.

 -

Use atomic operations for ifa_refcnt

 -

Avoid a dangling pointer during rt_replace_ifa

 -

Avoid double rt_replace_ifa on rtrequest1(RTM_ADD)

Some callers of rtrequest1(RTM_ADD) adjust rt_ifa of an rtentry created by
rtrequest1 that may change rt_ifa (in ifa_rtrequest) with another ifa that is
different from requested one.  It's wasteful and even worse introduces a race
condition.  rtrequest1 should just use a passed ifa as is if a caller hopes so.

 -

Use rt_update framework on updating a rtentry

Revision 1.216 / (download) - annotate - [select for diffs], Tue Oct 30 05:56:02 2018 UTC (5 years, 4 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126
Changes since 1.215: +16 -2 lines
Diff to previous 1.215 (colored) to selected 1.139 (colored)

Use rt_update framework on updating a rtentry

Revision 1.215 / (download) - annotate - [select for diffs], Tue Oct 30 05:54:42 2018 UTC (5 years, 4 months ago) by ozaki-r
Branch: MAIN
Changes since 1.214: +7 -41 lines
Diff to previous 1.214 (colored) to selected 1.139 (colored)

Avoid double rt_replace_ifa on rtrequest1(RTM_ADD)

Some callers of rtrequest1(RTM_ADD) adjust rt_ifa of an rtentry created by
rtrequest1 that may change rt_ifa (in ifa_rtrequest) with another ifa that is
different from requested one.  It's wasteful and even worse introduces a race
condition.  rtrequest1 should just use a passed ifa as is if a caller hopes so.

Revision 1.214 / (download) - annotate - [select for diffs], Tue Oct 30 05:30:31 2018 UTC (5 years, 4 months ago) by ozaki-r
Branch: MAIN
Changes since 1.213: +9 -3 lines
Diff to previous 1.213 (colored) to selected 1.139 (colored)

Avoid a dangling pointer during rt_replace_ifa

Revision 1.194.6.11 / (download) - annotate - [select for diffs], Fri Sep 7 12:31:30 2018 UTC (5 years, 6 months ago) by martin
Branch: netbsd-8
Changes since 1.194.6.10: +4 -4 lines
Diff to previous 1.194.6.10 (colored) to branchpoint 1.194 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #1012):

	sys/net/route.c: revision 1.212
	sys/net/route.c: revision 1.213

route: don't take an extra reference of a rtentry for the delayed free mechanism
Because a reference is already taken at that point.

 -

route: avoid overwriting rt_free_global.enqueued unexpectedly

rt_free_global.enqueued can be set to true by rt_free during rt_free_work
because rt_free_work releases rt_free_global.lock.  So rt_free_work must update
it once and not update after releasing the lock.

Revision 1.206.2.6 / (download) - annotate - [select for diffs], Thu Sep 6 06:56:44 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.206.2.5: +4 -4 lines
Diff to previous 1.206.2.5 (colored) to branchpoint 1.206 (colored) to selected 1.139 (colored)

Sync with HEAD

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

Revision 1.213 / (download) - annotate - [select for diffs], Wed Sep 5 02:49:40 2018 UTC (5 years, 6 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906
Changes since 1.212: +3 -3 lines
Diff to previous 1.212 (colored) to selected 1.139 (colored)

route: avoid overwriting rt_free_global.enqueued unexpectedly

rt_free_global.enqueued can be set to true by rt_free during rt_free_work
because rt_free_work releases rt_free_global.lock.  So rt_free_work must update
it once and not update after releasing the lock.

Revision 1.212 / (download) - annotate - [select for diffs], Wed Sep 5 02:49:09 2018 UTC (5 years, 6 months ago) by ozaki-r
Branch: MAIN
Changes since 1.211: +3 -3 lines
Diff to previous 1.211 (colored) to selected 1.139 (colored)

route: don't take an extra reference of a rtentry for the delayed free mechanism

Because a reference is already taken at that point.

Revision 1.206.2.5 / (download) - annotate - [select for diffs], Sat Jul 28 04:38:10 2018 UTC (5 years, 8 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.206.2.4: +12 -12 lines
Diff to previous 1.206.2.4 (colored) to branchpoint 1.206 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.211 / (download) - annotate - [select for diffs], Thu Jul 12 02:26:04 2018 UTC (5 years, 8 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-compat-0728
Changes since 1.210: +12 -12 lines
Diff to previous 1.210 (colored) to selected 1.139 (colored)

Don't use aprint_* functions for logging unrelated to autoconf(9)

Revision 1.206.2.4 / (download) - annotate - [select for diffs], Mon Jun 25 07:26:06 2018 UTC (5 years, 9 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.206.2.3: +8 -3 lines
Diff to previous 1.206.2.3 (colored) to branchpoint 1.206 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.194.6.10 / (download) - annotate - [select for diffs], Fri Jun 8 10:14:33 2018 UTC (5 years, 9 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-0-RELEASE, netbsd-8-0-RC2
Changes since 1.194.6.9: +8 -3 lines
Diff to previous 1.194.6.9 (colored) to branchpoint 1.194 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #852):

	sys/netinet6/icmp6.c: revision 1.238
	sys/netinet/ip_icmp.c: revision 1.171
	sys/net/route.c: revision 1.210

Fix _rt_free via rtrequest(RTM_DELETE) hangs in rt_timer handlers

A rt_timer handler is passed a rtentry with an extra reference that avoids the
rtentry is accidentally released.  So rt_timer handers must release
the reference of a passed rtentry by themselves (but they didn't).

Revision 1.210 / (download) - annotate - [select for diffs], Fri Jun 1 07:13:35 2018 UTC (5 years, 9 months ago) by ozaki-r
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-0625
Branch point for: phil-wifi
Changes since 1.209: +8 -3 lines
Diff to previous 1.209 (colored) to selected 1.139 (colored)

Fix _rt_free via rtrequest(RTM_DELETE) hangs in rt_timer handlers

A rt_timer handler is passed a rtentry with an extra reference that avoids the
rtentry is accidentally released.  So rt_timer handers must release the reference
of a passed rtentry by themselves (but they didn't).

Revision 1.206.2.3 / (download) - annotate - [select for diffs], Mon Apr 16 02:00:08 2018 UTC (5 years, 11 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.206.2.2: +168 -18 lines
Diff to previous 1.206.2.2 (colored) to branchpoint 1.206 (colored) to selected 1.139 (colored)

Sync with HEAD, resolve some conflicts

Revision 1.194.6.9 / (download) - annotate - [select for diffs], Sat Apr 14 10:16:19 2018 UTC (5 years, 11 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-0-RC1
Changes since 1.194.6.8: +168 -18 lines
Diff to previous 1.194.6.8 (colored) to branchpoint 1.194 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #749):

	sys/net/if.h: revision 1.259
	sys/net/route.c: revision 1.209
	sys/net/route.h: revision 1.118
	sys/net/rtsock.c: revision 1.240

Resolve tangled lock dependencies in route.c

This change sweeps remaining lock decisions based on if locked or not by
moving utility functions of rtentry updates from rtsock.c and ensuring
holding the rt_lock.
It also improves the atomicity of a update of a rtentry.

Revision 1.209 / (download) - annotate - [select for diffs], Thu Apr 12 04:38:13 2018 UTC (5 years, 11 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415
Changes since 1.208: +168 -18 lines
Diff to previous 1.208 (colored) to selected 1.139 (colored)

Resolve tangled lock dependencies in route.c

This change sweeps remaining lock decisions based on if locked or not by moving
utility functions of rtentry updates from rtsock.c and ensuring holding the
rt_lock.  It also improves the atomicity of a update of a rtentry.

Revision 1.206.2.2 / (download) - annotate - [select for diffs], Sat Apr 7 04:12:19 2018 UTC (5 years, 11 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.206.2.1: +3 -3 lines
Diff to previous 1.206.2.1 (colored) to branchpoint 1.206 (colored) to selected 1.139 (colored)

Sync with HEAD.  77 conflicts resolved - all of them $NetBSD$

Revision 1.194.6.8 / (download) - annotate - [select for diffs], Thu Apr 5 14:41:07 2018 UTC (5 years, 11 months ago) by martin
Branch: netbsd-8
Changes since 1.194.6.7: +3 -3 lines
Diff to previous 1.194.6.7 (colored) to branchpoint 1.194 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #697):

	sys/net/route.c: revision 1.208

Kill remaining rt->rt_refcnt++

Revision 1.208 / (download) - annotate - [select for diffs], Thu Apr 5 03:39:14 2018 UTC (5 years, 11 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-compat-0407
Changes since 1.207: +3 -3 lines
Diff to previous 1.207 (colored) to selected 1.139 (colored)

Kill remaining rt->rt_refcnt++

Revision 1.206.2.1 / (download) - annotate - [select for diffs], Fri Mar 30 06:20:16 2018 UTC (6 years ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.206: +14 -4 lines
Diff to previous 1.206 (colored) to selected 1.139 (colored)

Resolve conflicts between branch and HEAD

Revision 1.207 / (download) - annotate - [select for diffs], Fri Mar 23 04:09:41 2018 UTC (6 years ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-compat-0330
Changes since 1.206: +14 -4 lines
Diff to previous 1.206 (colored) to selected 1.139 (colored)

Don't take RT_LOCK in DDB

It definitely causes a diagnostic failure if LOCKDEBUG is enabled.

Revision 1.194.6.7 / (download) - annotate - [select for diffs], Tue Mar 13 13:27:10 2018 UTC (6 years ago) by martin
Branch: netbsd-8
Changes since 1.194.6.6: +3 -3 lines
Diff to previous 1.194.6.6 (colored) to branchpoint 1.194 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #622):
	sys/netinet/if_arp.c: revision 1.270
	sys/net/if_llatbl.c: revision 1.24 (patch)
	sys/net/if_llatbl.c: revision 1.25
	sys/net/if_llatbl.c: revision 1.26
	sys/net/route.c: revision 1.204
	sys/netinet6/in6.c: revision 1.261
	sys/netinet6/in6.c: revision 1.262 (patch)
	sys/netinet6/in6.c: revision 1.263
	sys/netinet/in.c: revision 1.216
	sys/netinet6/in6.c: revision 1.264
	sys/netinet6/nd6.c: revision 1.246 (patch)
	sys/netinet/if_arp.c: revision 1.269
	sys/net/if_llatbl.h: revision 1.14
	sys/netinet6/in6.c: revision 1.259
	sys/netinet/in.c: revision 1.220
	sys/netinet/in.c: revision 1.221 (patch)
	sys/netinet/in.c: revision 1.222
	sys/netinet/in.c: revision 1.223

Suppress noisy debugging outputs
Even if DEBUG they are too noisy under load.

Tweak sanity checks

Scheduling a timer of static entries is wrong.

Add assertions

We must not destroy llentries holding mbufs.

Fix reference leaks of llentry
callout_reset and callout_halt can cancel a pending callout without telling us.
Detect a cancel and remove a reference by using callout_pending and
callout_stop (it's a bit tricy though, we can detect it).
While here, we can remove remaining abuses of mutex_owned for softnet_lock.

Fix memory leaks on arp -d and ndp -d for static entries
We have to delete entries on in_lltable_delete and in6_lltable_delete
unconditionally.  Note that we don't need to worry about LLE_IFADDR because
there is no such entries now.

Use pool(9) for llentry allocations
llentry is easy to be leaked and pool suits for it because pool is usable to
detect leaks.

Also sweep unnecessary wrappers for llentry, in_llentry and in6_llentry.

Revision 1.194.6.6 / (download) - annotate - [select for diffs], Mon Feb 5 14:55:16 2018 UTC (6 years, 1 month ago) by martin
Branch: netbsd-8
Changes since 1.194.6.5: +9 -3 lines
Diff to previous 1.194.6.5 (colored) to branchpoint 1.194 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #528):
	sys/net/agr/if_agr.c: revision 1.42
	sys/netinet6/nd6_rtr.c: revision 1.137
	sys/netinet6/nd6_rtr.c: revision 1.138
	sys/net/agr/if_agr.c: revision 1.46
	sys/net/route.c: revision 1.206
	sys/net/if.c: revision 1.419
	sys/net/agr/if_agrether.c: revision 1.10
	sys/netinet6/nd6.c: revision 1.241
	sys/netinet6/nd6.c: revision 1.242
	sys/netinet6/nd6.c: revision 1.243
	sys/netinet6/nd6.c: revision 1.244
	sys/netinet6/nd6.c: revision 1.245
	sys/netipsec/ipsec_input.c: revision 1.52
	sys/netipsec/ipsec_input.c: revision 1.53
	sys/net/agr/if_agrsubr.h: revision 1.5
	sys/kern/subr_workqueue.c: revision 1.35
	sys/netipsec/ipsec.c: revision 1.124
	sys/net/agr/if_agrsubr.c: revision 1.11
	sys/net/agr/if_agrsubr.c: revision 1.12
Simplify; share agr_vlan_add and agr_vlan_del (NFCI)
Fix late NULL-checking (CID 1427782: Null pointer dereferences (REVERSE_INULL))
KNF: replace soft tabs with hard tabs
Add missing NULL-checking for m_pullup (CID 1427770: Null pointer dereferences (NULL_RETURNS))
Add locking.
Revert "Get rid of unnecessary splsoftnet" (v1.133)
It's not always true that softnet_lock is held these places.
See PR kern/52947.
Get rid of unnecessary splsoftnet (redo)
Unless NET_MPSAFE, splsoftnet is still needed for rt_* functions.
Use existing fill_[pd]rlist() functions to calculate size of buffer to
allocate, rather than relying on an arbitrary length passed in from
userland.
Allow copyout() of partial results if the user buffer is too small, to
be consistent with the way sysctl(3) is documented.
Garbage-collect now-unused third parrameter in the fill_[pd]rlist()
functions.
As discussed on IRC.
OK kamil@ and christos@
XXX Needs pull-up to netbsd-8 branch.
Simplify, from christos@
More simplification, this time from ozaki-r@
No need to break after return.
One more from christos@
No need to initialize fill_func
more cleanup (don't allow oldlenp == NULL)
Destroy ifq_lock at the end of if_detach
It still can be used in if_detach.
Prevent rt_free_global.wk from being enqueued to workqueue doubly
Check if a queued work is tried to be enqueued again, which is not allowed

Revision 1.194.6.5 / (download) - annotate - [select for diffs], Sat Feb 3 22:07:26 2018 UTC (6 years, 1 month ago) by snj
Branch: netbsd-8
Changes since 1.194.6.4: +3 -3 lines
Diff to previous 1.194.6.4 (colored) to branchpoint 1.194 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #514):
	sys/net/route.c: 1.205
	sys/net/rtsock.c: 1.237-1.238
	sys/netinet/in.c: 1.215
	sys/netinet/tcp_subr.c: 1.272
	sys/netinet/tcp_timer.c: 1.93
	sys/netinet/tcp_timer.h: 1.29
	sys/netinet/tcp_var.h: 1.182
	sys/netinet6/in6.c: 1.258
Remove extra pserialize_perform from in_purgeaddr
It's already performed in ifa_remove. Note so there (in in6_unlink_ifa too).
Release rt_so_mtx on updating a rtentry to avoid a deadlock with route_intr
The deadlock happened only if NET_MPSAFE on.
Run tcp_slowtimo in workqueue if NET_MPSAFE
If NET_MPSAFE is enabled, we have to avoid taking softnet_lock in softint as
much as possible to prevent any softint handlers including callout handlers
such as tcp_slowtimo from sticking on softnet_lock because it results in
undesired delays of executing subsequent softint handlers.
NFCI for !NET_MPSAFE
Fix a return value of rt_update_prepare
Callers expect it to be an errno.
Fix another deadlock
When waiting for a route update to finish, a waiter has to release its reference
to the route to avoid a deadlock. Because a updater tries to wait for references
to a target route (except for a reference by the updater itself) to be released.

Revision 1.206 / (download) - annotate - [select for diffs], Tue Jan 30 11:01:04 2018 UTC (6 years, 1 month ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-compat-base, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Changes since 1.205: +9 -3 lines
Diff to previous 1.205 (colored) to selected 1.139 (colored)

Prevent rt_free_global.wk from being enqueued to workqueue doubly

Revision 1.205 / (download) - annotate - [select for diffs], Tue Jan 23 07:20:10 2018 UTC (6 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.204: +3 -3 lines
Diff to previous 1.204 (colored) to selected 1.139 (colored)

Fix a return value of rt_update_prepare

Callers expect it to be an errno.

Revision 1.204 / (download) - annotate - [select for diffs], Fri Jan 19 08:01:05 2018 UTC (6 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.203: +3 -3 lines
Diff to previous 1.203 (colored) to selected 1.139 (colored)

Suppress noisy debugging outputs

Even if DEBUG they are too noisy under load.

Revision 1.194.6.4 / (download) - annotate - [select for diffs], Sat Jan 13 22:10:55 2018 UTC (6 years, 2 months ago) by snj
Branch: netbsd-8
Changes since 1.194.6.3: +22 -29 lines
Diff to previous 1.194.6.3 (colored) to branchpoint 1.194 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by christos in ticket #496):
	sys/net/route.c: revision 1.202-1.203
	sys/net/route.h: revision 1.117
Use a queue of deferred entries to delete routes instead of a fixed stack
of 10. Otherwise we can overflow in route deletions from the rexmit timer.
--
Don't stomp past the end of the array! need __arraycount not sizeof()
Found by chuq, while debugging the sdf.org crashes
Restructure a bit for readability.

Revision 1.203 / (download) - annotate - [select for diffs], Tue Jan 9 19:52:29 2018 UTC (6 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.202: +15 -21 lines
Diff to previous 1.202 (colored) to selected 1.139 (colored)

Use a queue of deferred entries to delete routes instead of a fixed stack
of 10. Otherwise we can overflow in route deletions from the rexmit timer.
XXX: pullup-8

Revision 1.202 / (download) - annotate - [select for diffs], Fri Jan 5 01:53:15 2018 UTC (6 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.201: +19 -20 lines
Diff to previous 1.201 (colored) to selected 1.139 (colored)

Don't stomp past the end of the array! need __arraycount not sizeof()
Found by chuq, while debugging the sdf.org crashes
XXX: pullup-8
Restructure a bit for readability.

Revision 1.126.6.3 / (download) - annotate - [select for diffs], Sun Dec 3 11:39:02 2017 UTC (6 years, 3 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.126.6.2: +1289 -409 lines
Diff to previous 1.126.6.2 (colored) to branchpoint 1.126 (colored) next main 1.127 (colored) to selected 1.139 (colored)

update from HEAD

Revision 1.194.6.3 / (download) - annotate - [select for diffs], Tue Oct 24 08:55:55 2017 UTC (6 years, 5 months ago) by snj
Branch: netbsd-8
CVS Tags: matt-nb8-mediatek-base, matt-nb8-mediatek
Changes since 1.194.6.2: +82 -235 lines
Diff to previous 1.194.6.2 (colored) to branchpoint 1.194 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #305):
	distrib/sets/lists/tests/mi: revision 1.762
	sys/net/route.c: revision 1.198-1.201
	sys/net/route.h: revision 1.114
	sys/netatalk/at_proto.c: revision 1.22
	sys/netinet/in_proto.c: revision 1.124
	sys/netinet6/in6_proto.c: revision 1.118
	sys/netmpls/mpls_proto.c: revision 1.31
	sys/netnatm/natm_proto.c: revision 1.18
	sys/rump/net/lib/libsockin/sockin.c: revision 1.65
	sys/sys/domain.h: revision 1.33
	tests/net/route/Makefile: revision 1.6
	tests/net/route/t_rtcache.sh: revision 1.1
Add tests of rtcache invalidation
Remove unnecessary NULL check of rt_ifp
It's always non-NULL.
Invalidate rtcache based on a global generation counter
The change introduces a global generation counter that is incremented when any
routes have been added or deleted. When a rtcache caches a rtentry into itself,
it also stores a snapshot of the generation counter. If the snapshot equals to
the global counter, the cache is still valid, otherwise invalidated.
One drawback of the change is that all rtcaches of all protocol families are
invalidated when any routes of any protocol families are added or deleted.
If that matters, we should have separate generation counters based on
protocol families.
This change removes LIST_ENTRY from struct route, which fixes a part of
PR kern/52515.
Remove the global lock for rtcache
Thanks to removal of LIST_ENTRY of struct route, rtcaches are accessed only by
their users. And in existing usages a rtcache is guranteed to be not accessed
simultaneously. So the rtcache framework doesn't need any exclusion controls
in itself.
Synchronize on rtcache_generation with rtlock
It's racy if NET_MPSAFE is enabled.
Pointed out by joerg@

Revision 1.201 / (download) - annotate - [select for diffs], Mon Sep 25 04:15:33 2017 UTC (6 years, 6 months ago) by ozaki-r
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202
Changes since 1.200: +12 -7 lines
Diff to previous 1.200 (colored) to selected 1.139 (colored)

Synchronize on rtcache_generation with rtlock

It's racy if NET_MPSAFE is enabled.

Pointed out by joerg@

Revision 1.200 / (download) - annotate - [select for diffs], Fri Sep 22 05:05:32 2017 UTC (6 years, 6 months ago) by ozaki-r
Branch: MAIN
Changes since 1.199: +57 -145 lines
Diff to previous 1.199 (colored) to selected 1.139 (colored)

Remove the global lock for rtcache

Thanks to removal of LIST_ENTRY of struct route, rtcaches are accessed only by
their users. And in existing usages a rtcache is guranteed to be not accessed
simultaneously. So the rtcache framework doesn't need any exclusion controls
in itself.

Revision 1.199 / (download) - annotate - [select for diffs], Thu Sep 21 07:15:34 2017 UTC (6 years, 6 months ago) by ozaki-r
Branch: MAIN
Changes since 1.198: +26 -96 lines
Diff to previous 1.198 (colored) to selected 1.139 (colored)

Invalidate rtcache based on a global generation counter

The change introduces a global generation counter that is incremented when any
routes have been added or deleted. When a rtcache caches a rtentry into itself,
it also stores a snapshot of the generation counter. If the snapshot equals to
the global counter, the cache is still valid, otherwise invalidated.

One drawback of the change is that all rtcaches of all protocol families are
invalidated when any routes of any protocol families are added or deleted.
If that matters, we should have separate generation counters based on
protocol families.

This change removes LIST_ENTRY from struct route, which fixes a part of
PR kern/52515.

Revision 1.198 / (download) - annotate - [select for diffs], Thu Sep 21 04:44:32 2017 UTC (6 years, 6 months ago) by ozaki-r
Branch: MAIN
Changes since 1.197: +3 -3 lines
Diff to previous 1.197 (colored) to selected 1.139 (colored)

Remove unnecessary NULL check of rt_ifp

It's always non-NULL.

Revision 1.133.2.11 / (download) - annotate - [select for diffs], Mon Aug 28 17:53:11 2017 UTC (6 years, 7 months ago) by skrll
Branch: nick-nhusb
Changes since 1.133.2.10: +72 -29 lines
Diff to previous 1.133.2.10 (colored) to branchpoint 1.133 (colored) next main 1.134 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.194.6.2 / (download) - annotate - [select for diffs], Fri Jul 7 13:57:26 2017 UTC (6 years, 8 months ago) by martin
Branch: netbsd-8
Changes since 1.194.6.1: +9 -4 lines
Diff to previous 1.194.6.1 (colored) to branchpoint 1.194 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #107):
	usr.sbin/arp/arp.c: revision 1.56
	sys/net/rtsock.c: revision 1.218
	sys/net/if_llatbl.c: revision 1.20
	usr.sbin/arp/arp.c: revision 1.57
	sys/net/rtsock.c: revision 1.219
	sys/net/if_llatbl.c: revision 1.21
	usr.sbin/arp/arp.c: revision 1.58
	tests/net/net_common.sh: revision 1.19
	sys/netinet6/nd6.h: revision 1.84
	sys/netinet6/nd6.h: revision 1.85
	tests/net/arp/t_arp.sh: revision 1.23
	sys/netinet6/in6.c: revision 1.246
	tests/net/arp/t_arp.sh: revision 1.24
	sys/netinet6/in6.c: revision 1.247
	tests/net/arp/t_arp.sh: revision 1.25
	sys/netinet6/in6.c: revision 1.248
	tests/net/arp/t_arp.sh: revision 1.26
	usr.sbin/ndp/ndp.c: revision 1.49
	tests/net/arp/t_arp.sh: revision 1.27
	tests/net/ndp/t_ndp.sh: revision 1.20
	tests/net/arp/t_arp.sh: revision 1.28
	tests/net/ndp/t_ndp.sh: revision 1.21
	tests/net/arp/t_arp.sh: revision 1.29
	tests/net/ndp/t_ndp.sh: revision 1.22
	tests/net/ndp/t_ndp.sh: revision 1.23
	tests/net/route/t_flags6.sh: revision 1.13
	tests/net/ndp/t_ndp.sh: revision 1.24
	tests/net/route/t_flags6.sh: revision 1.14
	tests/net/ndp/t_ndp.sh: revision 1.25
	tests/net/route/t_flags6.sh: revision 1.15
	tests/net/ndp/t_ndp.sh: revision 1.26
	sbin/route/rtutil.c: revision 1.9
	tests/net/ndp/t_ndp.sh: revision 1.27
	tests/net/ndp/t_ndp.sh: revision 1.28
	tests/net/net/t_ipv6address.sh: revision 1.14
	tests/net/ndp/t_ra.sh: revision 1.28
	tests/net/ndp/t_ndp.sh: revision 1.29
	sys/net/route.h: revision 1.113
	tests/net/ndp/t_ra.sh: revision 1.29
	sys/net/rtsock.c: revision 1.220
	sys/net/rtsock.c: revision 1.221
	sys/net/rtsock.c: revision 1.222
	sys/net/rtsock.c: revision 1.223
	tests/net/route/t_route.sh: revision 1.13
	sys/net/rtsock.c: revision 1.224
	sys/net/route.c: revision 1.196
	sys/net/if_llatbl.c: revision 1.19
	sys/net/route.c: revision 1.197
	sbin/route/route.c: revision 1.156
	tests/net/route/t_flags.sh: revision 1.16
	tests/net/route/t_flags.sh: revision 1.17
	usr.sbin/ndp/ndp.c: revision 1.50
	tests/net/route/t_flags.sh: revision 1.18
	sys/netinet/in.c: revision 1.204
	tests/net/route/t_flags.sh: revision 1.19
	sys/netinet/in.c: revision 1.205
	tests/net/arp/t_arp.sh: revision 1.30
	tests/net/arp/t_arp.sh: revision 1.31
	sys/net/if_llatbl.h: revision 1.11
	tests/net/arp/t_arp.sh: revision 1.32
	sys/net/if_llatbl.h: revision 1.12
	tests/net/arp/t_arp.sh: revision 1.33
	sys/netinet6/nd6.c: revision 1.233
	sys/netinet6/nd6.c: revision 1.234
	sys/netinet/if_arp.c: revision 1.251
	sys/netinet6/nd6.c: revision 1.235
	sys/netinet/if_arp.c: revision 1.252
	sbin/route/route.8: revision 1.57
	sys/net/rtsock.c: revision 1.214
	sys/net/rtsock.c: revision 1.215
	sys/net/rtsock.c: revision 1.216
	sys/net/rtsock.c: revision 1.217
whitespace police
Simplify
We can assume that rt_ifp is always non-NULL.
Sending a routing message (RTM_ADD) on adding an llentry
A message used to be sent on adding a cloned route. Restore the
behavior for backward compatibility.
Requested by ryo@
Drop RTF_CONNECTED from a result of RTM_GET for ARP/NDP entries
ARP/NDP entries aren't connected routes.
Reported by ryo@
Support -c <count> option for route monitor
route command exits if it receives <count> routing messages where
<count> is a value specified by -c.
The option is useful to get only particular message(s) in a test script.
Test routing messages emitted on operations of ARP/NDP entries
Do netstat -a for an appropriate protocol
Add missing declarations for cleanup
Set net.inet.arp.keep only if it's required
Don't create a permanent L2 cache entry on adding an address to an interface
It was created to copy FreeBSD, however actually the cache isn't
necessary. Remove it to simplify the code and reduce the cost to
maintain it (e.g., keep a consistency with a corresponding local
route).
Fix typo
Fix in_lltable_match_prefix
The function has not been used but will be used soon.
Remove unused function (nd6_rem_ifa_lle)
Allow in6_lltable_free_entry to be called without holding the afdata lock of ifp as well as in_lltable_free_entry
This behavior is a bit odd and should be fixed in the future...
Purge ARP/NDP entries on an interface when the interface is down
Fix PR kern/51179
Purge all related L2 caches on removing a route
The change addresses situations similar to PR 51179.
Purge L2 caches on changing an interface of a route
The change addresses situations similar to PR 51179.
Test implicit removals of ARP/NDP entries
One test case reproudces PR 51179.
Fix build of kernels without both INET and INET6
Tweak lltable_sysctl_dumparp
- Rename lltable_sysctl_dumparp to lltable_sysctl_dump
  because it's not only for ARP
- Enable it not only for INET but also for INET6
Fix usage of routing messages on arp -d and ndp -d
It didn't work as we expected; we should set RTA_GATEWAY not
RTA_IFP on RTM_GET to return an if_index and the kernel should
use it on RTM_DELETE.
Improve backward compatibility of (fake) routing messages on adding an ARP/NDP entry
A message originally included only DST and GATEWAY. Restore it.
Fix ifdef; care about a case w/ INET6 and w/o INET
Drop RTF_UP from a routing message of a deleted ARP/NDP entry
Check existence of ARP/NDP entries
Checking ARP/NDP entries is valid rather than checking routes.
Fix wrong comment
Drop RTF_LLINFO flag (now it's RTF_LLDATA) from local routes
They don't have llinfo anymore. And also the change fixes unexpected
behavior of ARP proxy.
Restore ARP/NDP entries to route show and netstat -r
Requested by dyoung@ some time ago
Enable to remove multiple ARP/NDP entries for one destination
The kernel can have multiple ARP/NDP entries which have an indentical
destination on different interfaces. This is normal and can be
reproduce easily by ping -I or ping6 -S. We should be able to remove
such entries.
arp -d <ip> and ndp -d <ip> are changed to fetch all ARP/NDP entries
and remove matched entries. So we can remove multiple entries
described above. This fetch all and selective removal behavior is
the same as arp <ip> and ndp <ip>; they also do fetch all entries
and show only matched entries.
Related to PR 51179
Check if ARP/NDP entries are purged when a related route is deleted

Revision 1.197 / (download) - annotate - [select for diffs], Wed Jun 28 04:10:47 2017 UTC (6 years, 9 months ago) by ozaki-r
Branch: MAIN
CVS Tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825
Changes since 1.196: +2 -4 lines
Diff to previous 1.196 (colored) to selected 1.139 (colored)

Drop RTF_LLINFO flag (now it's RTF_LLDATA) from local routes

They don't have llinfo anymore. And also the change fixes unexpected
behavior of ARP proxy.

Revision 1.194.6.1 / (download) - annotate - [select for diffs], Sun Jun 25 06:31:58 2017 UTC (6 years, 9 months ago) by snj
Branch: netbsd-8
Changes since 1.194: +12 -7 lines
Diff to previous 1.194 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #57):
	sys/net/route.c: revision 1.195
Fix locking in rtalloc1 (affected only if NET_MPSAFE)

Revision 1.196 / (download) - annotate - [select for diffs], Thu Jun 22 09:56:48 2017 UTC (6 years, 9 months ago) by ozaki-r
Branch: MAIN
Changes since 1.195: +9 -2 lines
Diff to previous 1.195 (colored) to selected 1.139 (colored)

Purge all related L2 caches on removing a route

The change addresses situations similar to PR 51179.

Revision 1.195 / (download) - annotate - [select for diffs], Thu Jun 22 08:31:54 2017 UTC (6 years, 9 months ago) by ozaki-r
Branch: MAIN
Changes since 1.194: +12 -7 lines
Diff to previous 1.194 (colored) to selected 1.139 (colored)

Fix locking in rtalloc1 (affected only if NET_MPSAFE)

Revision 1.132.2.1 / (download) - annotate - [select for diffs], Fri May 12 05:44:10 2017 UTC (6 years, 10 months ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-2-RELEASE
Changes since 1.132: +22 -5 lines
Diff to previous 1.132 (colored) next main 1.133 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by skrll/ozaki-r in ticket #1402):
	sys/net/route.c: revision 1.170 via patch
	sys/netinet/ip_flow.c: revision 1.73 via patch
	sys/netinet6/ip6_flow.c: revision 1.28 via patch
	sys/netinet6/nd6.c: revision 1.203 via patch
Run timers in workqueue
Timers (such as nd6_timer) typically free/destroy some data in callout
(softint). If we apply psz/psref for such data, we cannot do free/destroy
process in there because synchronization of psz/psref cannot be used in
softint. So run timer callbacks in workqueue works (normal LWP context).
Doing workqueue_enqueue a work twice (i.e., call workqueue_enqueue before
a previous task is scheduled) isn't allowed. For nd6_timer and
rt_timer_timer, this doesn't happen because callout_reset is called only
from workqueue's work. OTOH, ip{,6}flow_slowtimo's callout can be called
before its work starts and completes because the callout is periodically
called regardless of completion of the work. To avoid such a situation,
add a flag for each protocol; the flag is set true when a work is
enqueued and set false after the work finished. workqueue_enqueue is
called only if the flag is false.
Proposed on tech-net and tech-kern.

Revision 1.171.2.6 / (download) - annotate - [select for diffs], Wed Apr 26 02:53:29 2017 UTC (6 years, 11 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.171.2.5: +10 -5 lines
Diff to previous 1.171.2.5 (colored) to branchpoint 1.171 (colored) next main 1.172 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.186.2.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:54:05 2017 UTC (6 years, 11 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.186: +70 -23 lines
Diff to previous 1.186 (colored) next main 1.187 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.194 / (download) - annotate - [select for diffs], Fri Mar 24 03:45:02 2017 UTC (7 years ago) by ozaki-r
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, netbsd-8-base, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Branch point for: netbsd-8
Changes since 1.193: +8 -4 lines
Diff to previous 1.193 (colored) to selected 1.139 (colored)

Forbit installing a route which its gateway is unreachable

This change needs a tweak in route_output_change to unbreak route
change commands (e.g., route change -inet6 default -reject).

PR kern/52077 (s-yamaguchi@IIJ and ozaki-r@)

Revision 1.193 / (download) - annotate - [select for diffs], Wed Mar 22 07:14:18 2017 UTC (7 years ago) by ozaki-r
Branch: MAIN
Changes since 1.192: +4 -3 lines
Diff to previous 1.192 (colored) to selected 1.139 (colored)

Tweak and KNF some functions

Revision 1.171.2.5 / (download) - annotate - [select for diffs], Mon Mar 20 06:57:50 2017 UTC (7 years ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.171.2.4: +64 -23 lines
Diff to previous 1.171.2.4 (colored) to branchpoint 1.171 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.192 / (download) - annotate - [select for diffs], Mon Feb 20 04:23:11 2017 UTC (7 years, 1 month ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20170320
Changes since 1.191: +25 -13 lines
Diff to previous 1.191 (colored) to selected 1.139 (colored)

Make updating a rtentry in rtinit MP-safe

Revision 1.191 / (download) - annotate - [select for diffs], Fri Feb 17 04:31:34 2017 UTC (7 years, 1 month ago) by ozaki-r
Branch: MAIN
Changes since 1.190: +3 -3 lines
Diff to previous 1.190 (colored) to selected 1.139 (colored)

Make NOMPSAFE comments informative

Revision 1.190 / (download) - annotate - [select for diffs], Fri Feb 10 13:48:06 2017 UTC (7 years, 1 month ago) by ozaki-r
Branch: MAIN
Changes since 1.189: +21 -9 lines
Diff to previous 1.189 (colored) to selected 1.139 (colored)

Ensure that nobody references a rtentry that is passed to rt_setgate

Revision 1.189 / (download) - annotate - [select for diffs], Fri Feb 10 13:44:47 2017 UTC (7 years, 1 month ago) by ozaki-r
Branch: MAIN
Changes since 1.188: +7 -3 lines
Diff to previous 1.188 (colored) to selected 1.139 (colored)

Fix locking against myself in ifa_ifwithroute_psref

It happened on the path: rtrequest1 => rt_getifa => ifa_ifwithroute_psref.

Reported by ryo@

Revision 1.133.2.10 / (download) - annotate - [select for diffs], Sun Feb 5 13:40:58 2017 UTC (7 years, 1 month ago) by skrll
Branch: nick-nhusb
Changes since 1.133.2.9: +691 -94 lines
Diff to previous 1.133.2.9 (colored) to branchpoint 1.133 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.188 / (download) - annotate - [select for diffs], Thu Jan 19 06:58:55 2017 UTC (7 years, 2 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20170204
Changes since 1.187: +16 -2 lines
Diff to previous 1.187 (colored) to selected 1.139 (colored)

Disable rt_update mechanism by default

This is a workaround for PR kern/51877. Enable again once the issue
is fixed.

Revision 1.187 / (download) - annotate - [select for diffs], Tue Jan 17 07:53:06 2017 UTC (7 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.186: +4 -4 lines
Diff to previous 1.186 (colored) to selected 1.139 (colored)

Fix typo in comments

Revision 1.186 / (download) - annotate - [select for diffs], Wed Jan 11 13:08:29 2017 UTC (7 years, 2 months ago) by ozaki-r
Branch: MAIN
CVS Tags: bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.185: +2 -3 lines
Diff to previous 1.185 (colored) to selected 1.139 (colored)

Get rid of unnecessary header inclusions

Revision 1.171.2.4 / (download) - annotate - [select for diffs], Sat Jan 7 08:56:50 2017 UTC (7 years, 2 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.171.2.3: +713 -90 lines
Diff to previous 1.171.2.3 (colored) to branchpoint 1.171 (colored) to selected 1.139 (colored)

Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.185 / (download) - annotate - [select for diffs], Wed Dec 21 04:01:57 2016 UTC (7 years, 3 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20170107
Changes since 1.184: +4 -2 lines
Diff to previous 1.184 (colored) to selected 1.139 (colored)

Don't call psref_target_destroy unless NET_MPSAFE

We don't need it if NET_MPSAFE off and also it causes lockup
sometimes because of calling it with holding softnet_lock.

Revision 1.184 / (download) - annotate - [select for diffs], Wed Dec 21 00:33:49 2016 UTC (7 years, 3 months ago) by ozaki-r
Branch: MAIN
Changes since 1.183: +3 -3 lines
Diff to previous 1.183 (colored) to selected 1.139 (colored)

Fix kernel build with RT_DEBUG and !NET_MPSAFE

Revision 1.183 / (download) - annotate - [select for diffs], Mon Dec 12 03:55:57 2016 UTC (7 years, 3 months ago) by ozaki-r
Branch: MAIN
Changes since 1.182: +675 -93 lines
Diff to previous 1.182 (colored) to selected 1.139 (colored)

Make the routing table and rtcaches MP-safe

See the following descriptions for details.

Proposed on tech-kern and tech-net


Overview
--------

We protect the routing table with a rwock and protect
rtcaches with another rwlock. Each rtentry is protected
from being freed or updated via reference counting and psref.

Global rwlocks
--------------

There are two rwlocks; one for the routing table (rt_lock) and
the other for rtcaches (rtcache_lock). rtcache_lock covers
all existing rtcaches; there may have room for optimizations
(future work).

The locking order is rtcache_lock first and rt_lock is next.

rtentry references
------------------

References to an rtentry is managed with reference counting
and psref. Either of the two mechanisms is used depending on
where a rtentry is obtained. Reference counting is used when
we obtain a rtentry from the routing table directly via
rtalloc1 and rtrequest{,1} while psref is used when we obtain
a rtentry from a rtcache via rtcache_* APIs. In both cases,
a caller can sleep/block with holding an obtained rtentry.

The reasons why we use two different mechanisms are (i) only
using reference counting hurts the performance due to atomic
instructions (rtcache case) (ii) ease of implementation;
applying psref to APIs such rtaloc1 and rtrequest{,1} requires
additional works (adding a local variable and an argument).

We will finally migrate to use only psref but we can do it
when we have a lockless routing table alternative.

Reference counting for rtentry
------------------------------

rt_refcnt now doesn't count permanent references such as for
rt_timers and rtcaches, instead it is used only for temporal
references when obtaining a rtentry via rtalloc1 and rtrequest{,1}.
We can do so because destroying a rtentry always involves
removing references of rt_timers and rtcaches to the rtentry
and we don't need to track such references. This also makes
it easy to wait for readers to release references on deleting
or updating a rtentry, i.e., we can simply wait until the
reference counter is 0 or 1. (If there are permanent references
the counter can be arbitrary.)

rt_ref increments a reference counter of a rtentry and rt_unref
decrements it. rt_ref is called inside APIs (rtalloc1 and
rtrequest{,1} so users don't need to care about it while
users must call rt_unref to an obtained rtentry after using it.

rtfree is removed and we use rt_unref and rt_free instead.
rt_unref now just decrements the counter of a given rtentry
and rt_free just tries to destroy a given rtentry.

See the next section for destructions of rtentries by rt_free.

Destructions of rtentries
-------------------------

We destroy a rtentry only when we call rtrequst{,1}(RTM_DELETE);
the original implementation can destroy in any rtfree where it's
the last reference. If we use reference counting or psref, it's
easy to understand if the place that a rtentry is destroyed is
fixed.

rt_free waits for references to a given rtentry to be released
before actually destroying the rtentry. rt_free uses a condition
variable (cv_wait) (and psref_target_destroy for psref) to wait.

Unfortunately rtrequst{,1}(RTM_DELETE) can be called in softint
that we cannot use cv_wait. In that case, we have to defer the
destruction to a workqueue.

rtentry#rt_cv, rtentry#rt_psref and global variables
(see rt_free_global) are added to conduct the procedure.

Updates of rtentries
--------------------

One difficulty to use refcnt/psref instead of rwlock for rtentry
is updates of rtentries. We need an additional mechanism to
prevent readers from seeing inconsistency of a rtentry being
updated.

We introduce RTF_UPDATING flag to rtentries that are updating.
While the flag is set to a rtentry, users cannot acquire the
rtentry. By doing so, we avoid users to see inconsistent
rtentries.

There are two options when a user tries to acquire a rtentry
with the RTF_UPDATING flag; if a user runs in softint context
the user fails to acquire a rtentry (NULL is returned).
Otherwise a user waits until the update completes by waiting
on cv.

The procedure of a updater is simpler to destruction of
a rtentry. Wait on cv (and psref) and after all readers left,
proceed with the update.

Global variables (see rt_update_global) are added to conduct
the procedure.

Currently we apply the mechanism to only RTM_CHANGE in
rtsock.c. We would have to apply other codes. See
"Known issues" section.

psref for rtentry
-----------------

When we obtain a rtentry from a rtcache via rtcache_* APIs,
psref is used to reference to the rtentry.

rtcache_ref acquires a reference to a rtentry with psref
and rtcache_unref releases the reference after using it.
rtcache_ref is called inside rtcache_* APIs and users don't
need to take care of it while users must call rtcache_unref
to release the reference.

struct psref and int bound that is needed for psref is
embedded into struct route. By doing so we don't need to
add local variables and additional argument to APIs.

However this adds another constraint to psref other than
reference counting one's; holding a reference of an rtentry
via a rtcache is allowed by just one caller at the same time.
So we must not acquire a rtentry via a rtcache twice and
avoid a recursive use of a rtcache. And also a rtcache must
be arranged to be used by a LWP/softint at the same time
somehow. For IP forwarding case, we have per-CPU rtcaches
used in softint so the constraint is guaranteed. For a h
rtcache of a PCB case, the constraint is guaranteed by the
solock of each PCB. Any other cases (pf, ipf, stf and ipsec)
are currently guaranteed by only the existence of the global
locks (softnet_lock and/or KERNEL_LOCK). If we've found the
cases that we cannot guarantee the constraint, we would need
to introduce other rtcache APIs that use simple reference
counting.

psref of rtcache is created with IPL_SOFTNET and so rtcache
shouldn't used at an IPL higher than IPL_SOFTNET.

Note that rtcache_free is used to invalidate a given rtcache.
We don't need another care by my change; just keep them as
they are.

Performance impact
------------------

When NET_MPSAFE is disabled the performance drop is 3% while
when it's enabled the drop is increased to 11%. The difference
comes from that currently we don't take any global locks and
don't use psref if NET_MPSAFE is disabled.

We can optimize the performance of the case of NET_MPSAFE
on by reducing lookups of rtcache that uses psref;
currently we do two lookups but we should be able to trim
one of two. This is a future work.

Known issues
------------

There are two known issues to be solved; one is that
a caller of rtrequest(RTM_ADD) may change rtentry (see rtinit).
We need to prevent new references during the update. Or
we may be able to remove the code (perhaps, need more
investigations).

The other is rtredirect that updates a rtentry. We need
to apply our update mechanism, however it's not easy because
rtredirect is called in softint and we cannot apply our
mechanism simply. One solution is to defer rtredirect to
a workqueue but it requires some code restructuring.

Revision 1.133.2.9 / (download) - annotate - [select for diffs], Mon Dec 5 10:55:27 2016 UTC (7 years, 3 months ago) by skrll
Branch: nick-nhusb
Changes since 1.133.2.8: +75 -26 lines
Diff to previous 1.133.2.8 (colored) to branchpoint 1.133 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.182 / (download) - annotate - [select for diffs], Tue Nov 15 01:50:06 2016 UTC (7 years, 4 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20161204
Changes since 1.181: +41 -2 lines
Diff to previous 1.181 (colored) to selected 1.139 (colored)

Don't use rt_walktree to delete routes

Some functions use rt_walktree to scan the routing table and delete
matched routes. However, we shouldn't use rt_walktree to delete
routes because rt_walktree is recursive to the routing table (radix
tree) and isn't friendly to MP-ification. rt_walktree allows a caller
to pass a callback function to delete an matched entry. The callback
function is called from an API of the radix tree (rn_walktree) but
also calls an API of the radix tree to delete an entry.

This change adds a new API of the radix tree, rn_search_matched,
which returns a matched entry that is selected by a callback
function passed by a caller and the caller itself deletes the
entry. By using the API, we can avoid the recursive form.

Revision 1.171.2.3 / (download) - annotate - [select for diffs], Fri Nov 4 14:49:21 2016 UTC (7 years, 4 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.171.2.2: +36 -26 lines
Diff to previous 1.171.2.2 (colored) to branchpoint 1.171 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.181 / (download) - annotate - [select for diffs], Tue Oct 25 02:45:09 2016 UTC (7 years, 5 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20161104
Changes since 1.180: +7 -8 lines
Diff to previous 1.180 (colored) to selected 1.139 (colored)

Remove unnecessary argument

No functional change.

Revision 1.180 / (download) - annotate - [select for diffs], Mon Oct 24 03:19:07 2016 UTC (7 years, 5 months ago) by ozaki-r
Branch: MAIN
Changes since 1.179: +6 -3 lines
Diff to previous 1.179 (colored) to selected 1.139 (colored)

Revert v1.157

We need to hold the rtentry over rtrequest1 for info that dereferences
member variables of the rtentry after rtrequest1.

Revision 1.179 / (download) - annotate - [select for diffs], Fri Oct 21 10:56:35 2016 UTC (7 years, 5 months ago) by ozaki-r
Branch: MAIN
Changes since 1.178: +4 -4 lines
Diff to previous 1.178 (colored) to selected 1.139 (colored)

Delete rt_timers on RTM_DELETE surely

We want to ensure that a rtentry is referenced by nobody after
RTM_DELETE (except for the caller). However, rt_timer could
have a reference to the rtentry after that.

Revision 1.178 / (download) - annotate - [select for diffs], Fri Oct 21 10:52:47 2016 UTC (7 years, 5 months ago) by ozaki-r
Branch: MAIN
Changes since 1.177: +5 -7 lines
Diff to previous 1.177 (colored) to selected 1.139 (colored)

Remove unnecessary argument

No functional change.

Revision 1.177 / (download) - annotate - [select for diffs], Fri Oct 21 09:01:44 2016 UTC (7 years, 5 months ago) by ozaki-r
Branch: MAIN
Changes since 1.176: +13 -8 lines
Diff to previous 1.176 (colored) to selected 1.139 (colored)

Make some rt_timer functions and variables static

No functional change.

Revision 1.176 / (download) - annotate - [select for diffs], Fri Oct 21 03:04:33 2016 UTC (7 years, 5 months ago) by ozaki-r
Branch: MAIN
Changes since 1.175: +11 -7 lines
Diff to previous 1.175 (colored) to selected 1.139 (colored)

Avoid temporal dangling reference

Revision 1.175 / (download) - annotate - [select for diffs], Tue Oct 18 07:30:30 2016 UTC (7 years, 5 months ago) by ozaki-r
Branch: MAIN
Changes since 1.174: +5 -4 lines
Diff to previous 1.174 (colored) to selected 1.139 (colored)

Don't hold global locks if NET_MPSAFE is enabled

If NET_MPSAFE is enabled, don't hold KERNEL_LOCK and softnet_lock in
part of the network stack such as IP forwarding paths. The aim of the
change is to make it easy to test the network stack without the locks
and reduce our local diffs.

By default (i.e., if NET_MPSAFE isn't enabled), the locks are held
as they used to be.

Reviewed by knakahara@

Revision 1.133.2.8 / (download) - annotate - [select for diffs], Wed Oct 5 20:56:08 2016 UTC (7 years, 5 months ago) by skrll
Branch: nick-nhusb
Changes since 1.133.2.7: +161 -65 lines
Diff to previous 1.133.2.7 (colored) to branchpoint 1.133 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.171.2.2 / (download) - annotate - [select for diffs], Sat Aug 6 00:19:10 2016 UTC (7 years, 7 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.171.2.1: +138 -59 lines
Diff to previous 1.171.2.1 (colored) to branchpoint 1.171 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.174 / (download) - annotate - [select for diffs], Fri Aug 5 00:52:02 2016 UTC (7 years, 7 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20160806, nick-nhusb-base-20161004, localcount-20160914
Changes since 1.173: +3 -3 lines
Diff to previous 1.173 (colored) to selected 1.139 (colored)

CID 1364759: fix using uninitialized value

Revision 1.173 / (download) - annotate - [select for diffs], Mon Aug 1 03:15:30 2016 UTC (7 years, 7 months ago) by ozaki-r
Branch: MAIN
Changes since 1.172: +138 -59 lines
Diff to previous 1.172 (colored) to selected 1.139 (colored)

Apply pserialize and psref to struct ifaddr and its variants

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

Revision 1.171.2.1 / (download) - annotate - [select for diffs], Tue Jul 26 03:24:23 2016 UTC (7 years, 8 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.171: +4 -4 lines
Diff to previous 1.171 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.172 / (download) - annotate - [select for diffs], Fri Jul 15 09:25:47 2016 UTC (7 years, 8 months ago) by martin
Branch: MAIN
CVS Tags: pgoyette-localcount-20160726
Changes since 1.171: +4 -4 lines
Diff to previous 1.171 (colored) to selected 1.139 (colored)

Mark the rt_timer callout MPSAFE and move the first reset a few lines
down so the the workqueue is properly prepared (the latter being more
a cosmetical change). Ok: ozaki-r@

Revision 1.171 / (download) - annotate - [select for diffs], Wed Jul 13 09:56:20 2016 UTC (7 years, 8 months ago) by hannken
Branch: MAIN
CVS Tags: pgoyette-localcount-base
Branch point for: pgoyette-localcount
Changes since 1.170: +4 -4 lines
Diff to previous 1.170 (colored) to selected 1.139 (colored)

rtcache_clear_rtentry: use LIST_FOREACH_SAFE as the element gets
removed from the list.

Revision 1.170 / (download) - annotate - [select for diffs], Mon Jul 11 07:37:00 2016 UTC (7 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.169: +22 -5 lines
Diff to previous 1.169 (colored) to selected 1.139 (colored)

Run timers in workqueue

Timers (such as nd6_timer) typically free/destroy some data in callout
(softint). If we apply psz/psref for such data, we cannot do free/destroy
process in there because synchronization of psz/psref cannot be used in
softint. So run timer callbacks in workqueue works (normal LWP context).

Doing workqueue_enqueue a work twice (i.e., call workqueue_enqueue before
a previous task is scheduled) isn't allowed. For nd6_timer and
rt_timer_timer, this doesn't happen because callout_reset is called only
from workqueue's work. OTOH, ip{,6}flow_slowtimo's callout can be called
before its work starts and completes because the callout is periodically
called regardless of completion of the work. To avoid such a situation,
add a flag for each protocol; the flag is set true when a work is
enqueued and set false after the work finished. workqueue_enqueue is
called only if the flag is false.

Proposed on tech-net and tech-kern.

Revision 1.133.2.7 / (download) - annotate - [select for diffs], Sat Jul 9 20:25:21 2016 UTC (7 years, 8 months ago) by skrll
Branch: nick-nhusb
Changes since 1.133.2.6: +19 -2 lines
Diff to previous 1.133.2.6 (colored) to branchpoint 1.133 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.169 / (download) - annotate - [select for diffs], Thu Jul 7 06:55:43 2016 UTC (7 years, 8 months ago) by msaitoh
Branch: MAIN
CVS Tags: nick-nhusb-base-20160907
Changes since 1.168: +3 -3 lines
Diff to previous 1.168 (colored) to selected 1.139 (colored)

KNF. Remove extra spaces. No functional change.

Revision 1.168 / (download) - annotate - [select for diffs], Fri Jul 1 05:22:33 2016 UTC (7 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.167: +19 -2 lines
Diff to previous 1.167 (colored) to selected 1.139 (colored)

Make sure to free all interface addresses in if_detach

Addresses of an interface (struct ifaddr) have a (reverse) pointer of an
interface object (ifa->ifa_ifp). If the addresses are surely freed when
their interface is destroyed, the pointer is always valid and we don't
need a tweak of replacing the pointer to if_index like mbuf.

In order to make sure the assumption, the following changes are required:
- Deactivate the interface at the firstish of if_detach. This prevents
  in6_unlink_ifa from saving multicast addresses (wrongly)
- Invalidate rtcache(s) and clear a rtentry referencing an address on
  RTM_DELETE. rtcache(s) may delay freeing an address
- Replace callout_stop with callout_halt of DAD timers to ensure stopping
  such timers in if_detach

Revision 1.133.2.6 / (download) - annotate - [select for diffs], Sun May 29 08:44:38 2016 UTC (7 years, 10 months ago) by skrll
Branch: nick-nhusb
Changes since 1.133.2.5: +50 -39 lines
Diff to previous 1.133.2.5 (colored) to branchpoint 1.133 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.167 / (download) - annotate - [select for diffs], Thu Apr 28 00:16:56 2016 UTC (7 years, 11 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20160529
Changes since 1.166: +4 -4 lines
Diff to previous 1.166 (colored) to selected 1.139 (colored)

Constify rtentry of if_output

We no longer need to change rtentry below if_output.

The change makes it clear where rtentries are changed (or not)
and helps forthcoming locking (os psrefing) rtentries.

Revision 1.166 / (download) - annotate - [select for diffs], Tue Apr 26 09:31:18 2016 UTC (7 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.165: +12 -25 lines
Diff to previous 1.165 (colored) to selected 1.139 (colored)

Stop using rt_gwroute completely

Revision 1.165 / (download) - annotate - [select for diffs], Tue Apr 26 09:30:01 2016 UTC (7 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.164: +20 -2 lines
Diff to previous 1.164 (colored) to selected 1.139 (colored)

Stop using rt_gwroute on packet sending paths

rt_gwroute of rtentry is a reference to a rtentry of the gateway
for a rtentry with RTF_GATEWAY. That was used by L2 (arp and ndp)
to look up L2 addresses. By separating L2 nexthop caches, we don't
need a route for the purpose and we can stop using rt_gwroute.
By doing so, we can reduce referencing and modifying rtentries,
which makes it easy to apply a lock (and/or psref) to the
routing table and rtentries.

One issue to do this is to keep RTF_REJECT behavior. It seems it
was broken when we moved rtalloc1 things from L2 output routines
(e.g., ether_output) to ip_hresolv_output, but (fortunately?)
it works unexpectedly. What we mistook are:
- RTF_REJECT was checked for any routes in L2 output routines,
  but in ip_hresolv_output it is checked only when the route
  is RTF_GATEWAY
- The RTF_REJECT check wasn't copied to IPv6 (nd6_output)

It seems that rt_gwroute checks hid the mistakes and it looked
work (unexpectedly) and removing rt_gwroute checks unveil the
issue. So we need to fix RTF_REJECT checks in ip_hresolv_output
and also add them to nd6_output.

One more point we have to care is returning an errno; we need
to mimic looutput behavior. Originally RTF_REJECT check was
done either in L2 output routines or in looutput. The latter is
applied when a reject route directs to a loopback interface.
However, now RTF_REJECT check is done before looutput so to keep
the original behavior we need to return an errno which looutput
chooses. Added rt_check_reject_route does such tweaks.

Revision 1.164 / (download) - annotate - [select for diffs], Mon Apr 25 14:38:08 2016 UTC (7 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.163: +13 -7 lines
Diff to previous 1.163 (colored) to selected 1.139 (colored)

Check error of rt_setgate and rt_settag

Revision 1.163 / (download) - annotate - [select for diffs], Mon Apr 25 14:30:42 2016 UTC (7 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.162: +10 -10 lines
Diff to previous 1.162 (colored) to selected 1.139 (colored)

Don't rt_setkey twice

Revision 1.133.2.5 / (download) - annotate - [select for diffs], Fri Apr 22 15:44:17 2016 UTC (7 years, 11 months ago) by skrll
Branch: nick-nhusb
Changes since 1.133.2.4: +176 -157 lines
Diff to previous 1.133.2.4 (colored) to branchpoint 1.133 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.162 / (download) - annotate - [select for diffs], Wed Apr 13 00:47:01 2016 UTC (7 years, 11 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20160422
Changes since 1.161: +99 -2 lines
Diff to previous 1.161 (colored) to selected 1.139 (colored)

ddb: rename show arptab to show routes

show arptab command of ddb is now inappropriate because it actually dumps
routes but arp entries aren't routes anymore. So rename it to show routes
and move the code from if_arp.c to route.c.

ok christos@

Revision 1.161 / (download) - annotate - [select for diffs], Mon Apr 11 08:26:33 2016 UTC (7 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.160: +2 -8 lines
Diff to previous 1.160 (colored) to selected 1.139 (colored)

Remove out-dated comments and unnecessary splsoftnet for pool_{get,put}

Revision 1.160 / (download) - annotate - [select for diffs], Thu Apr 7 04:04:47 2016 UTC (7 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.159: +3 -3 lines
Diff to previous 1.159 (colored) to selected 1.139 (colored)

remove useless cast.

Revision 1.159 / (download) - annotate - [select for diffs], Thu Apr 7 03:09:56 2016 UTC (7 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.158: +14 -15 lines
Diff to previous 1.158 (colored) to selected 1.139 (colored)

Don't create an RTM_MISS message for every route allocation.
GC unused code and variables.

Revision 1.158 / (download) - annotate - [select for diffs], Mon Apr 4 07:37:07 2016 UTC (7 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.157: +64 -123 lines
Diff to previous 1.157 (colored) to selected 1.139 (colored)

Separate nexthop caches from the routing table

By this change, nexthop caches (IP-MAC address pair) are not stored
in the routing table anymore. Instead nexthop caches are stored in
each network interface; we already have lltable/llentry data structure
for this purpose. This change also obsoletes the concept of cloning/cloned
routes. Cloned routes no longer exist while cloning routes still exist
with renamed to connected routes.

Noticeable changes are:
- Nexthop caches aren't listed in route show/netstat -r
  - sysctl(NET_RT_DUMP) doesn't return them
  - If RTF_LLDATA is specified, it returns nexthop caches
- Several definitions of routing flags and messages are removed
  - RTF_CLONING, RTF_XRESOLVE, RTF_LLINFO, RTF_CLONED and RTM_RESOLVE
- RTF_CONNECTED is added
  - It has the same value of RTF_CLONING for backward compatibility
- route's -xresolve, -[no]cloned and -llinfo options are removed
  - -[no]cloning remains because it seems there are users
  - -[no]connected is introduced and recommended
    to be used instead of -[no]cloning
- route show/netstat -r drops some flags
  - 'L' and 'c' are not seen anymore
  - 'C' now indicates a connected route
- Gateway value of a route of an interface address is now not
  a L2 address but "link#N" like a connected (cloning) route
- Proxy ARP: "arp -s ... pub" doesn't create a route

You can know details of behavior changes by seeing diffs under tests/.

Proposed on tech-net and tech-kern:
  http://mail-index.netbsd.org/tech-net/2016/03/11/msg005701.html

Revision 1.157 / (download) - annotate - [select for diffs], Fri Apr 1 09:52:39 2016 UTC (7 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.156: +3 -6 lines
Diff to previous 1.156 (colored) to selected 1.139 (colored)

Don't request returning rtentry if not use it

Revision 1.156 / (download) - annotate - [select for diffs], Fri Apr 1 09:00:27 2016 UTC (7 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.155: +6 -15 lines
Diff to previous 1.155 (colored) to selected 1.139 (colored)

Remove unnecessary RTTIMER_CALLOUT macro

rttimer#rtt_func never be NULL.

Revision 1.155 / (download) - annotate - [select for diffs], Fri Apr 1 02:00:14 2016 UTC (7 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.154: +7 -7 lines
Diff to previous 1.154 (colored) to selected 1.139 (colored)

Make some global variables static

Revision 1.154 / (download) - annotate - [select for diffs], Thu Mar 24 06:18:27 2016 UTC (8 years ago) by ozaki-r
Branch: MAIN
Changes since 1.153: +3 -3 lines
Diff to previous 1.153 (colored) to selected 1.139 (colored)

Constify rt_newmsg's arguments

Revision 1.133.2.4 / (download) - annotate - [select for diffs], Sun Dec 27 12:10:07 2015 UTC (8 years, 3 months ago) by skrll
Branch: nick-nhusb
Changes since 1.133.2.3: +28 -54 lines
Diff to previous 1.133.2.3 (colored) to branchpoint 1.133 (colored) to selected 1.139 (colored)

Sync with HEAD (as of 26th Dec)

Revision 1.153 / (download) - annotate - [select for diffs], Tue Dec 22 01:59:21 2015 UTC (8 years, 3 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20160319, nick-nhusb-base-20151226
Changes since 1.152: +4 -3 lines
Diff to previous 1.152 (colored) to selected 1.139 (colored)

Tweak return value handling

rtrequest1 ensures to return an rtentry on success.

Revision 1.152 / (download) - annotate - [select for diffs], Wed Oct 7 09:44:26 2015 UTC (8 years, 5 months ago) by roy
Branch: MAIN
Changes since 1.151: +26 -53 lines
Diff to previous 1.151 (colored) to selected 1.139 (colored)

Remove rt_ifa_localrequest().
In it's place, use rtrequest1() inside rt_ifa_addlocal() and
rtdeletemsg() inside rt_ifa_remlocal().

This removes the need for INET/INET6 specific code and allows
greater control over the creation of the local address route.

Revision 1.133.2.3 / (download) - annotate - [select for diffs], Tue Sep 22 12:06:10 2015 UTC (8 years, 6 months ago) by skrll
Branch: nick-nhusb
Changes since 1.133.2.2: +104 -42 lines
Diff to previous 1.133.2.2 (colored) to branchpoint 1.133 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.151 / (download) - annotate - [select for diffs], Thu Sep 3 02:04:31 2015 UTC (8 years, 6 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20150921
Changes since 1.150: +26 -2 lines
Diff to previous 1.150 (colored) to selected 1.139 (colored)

Add refcnt constraint checks for debugging

It's useful to know where the constraint is violated (by extra rtfree).
It's enabled only if DEBUG because it's heavy (O(n)).

Revision 1.150 / (download) - annotate - [select for diffs], Mon Aug 31 06:25:15 2015 UTC (8 years, 6 months ago) by ozaki-r
Branch: MAIN
Changes since 1.149: +7 -2 lines
Diff to previous 1.149 (colored) to selected 1.139 (colored)

Make rt_refcnt take into account rt_timer

Revision 1.149 / (download) - annotate - [select for diffs], Mon Aug 24 22:21:26 2015 UTC (8 years, 7 months ago) by pooka
Branch: MAIN
Changes since 1.148: +4 -2 lines
Diff to previous 1.148 (colored) to selected 1.139 (colored)

sprinkle _KERNEL_OPT

Revision 1.148 / (download) - annotate - [select for diffs], Thu Aug 13 10:14:26 2015 UTC (8 years, 7 months ago) by ozaki-r
Branch: MAIN
Changes since 1.147: +2 -3 lines
Diff to previous 1.147 (colored) to selected 1.139 (colored)

Remove extra rt_refcnt++ in rtalloc1

rtrequest has already done it. So we don't need to do it once more.

This fixes regressed behavior of ARP cache expiration which an expired
cache doesn't disappear.

Revision 1.147 / (download) - annotate - [select for diffs], Thu Aug 13 07:59:05 2015 UTC (8 years, 7 months ago) by ozaki-r
Branch: MAIN
Changes since 1.146: +3 -5 lines
Diff to previous 1.146 (colored) to selected 1.139 (colored)

Move rtfree to a common place

This change also plugs a missing rtfree on an error path.

Revision 1.146 / (download) - annotate - [select for diffs], Fri Jul 17 02:21:08 2015 UTC (8 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.145: +70 -41 lines
Diff to previous 1.145 (colored) to selected 1.139 (colored)

Reform use of rt_refcnt

rt_refcnt of rtentry was used in bad manners, for example, direct rt_refcnt++
and rt_refcnt-- outside route.c, "rt->rt_refcnt++; rtfree(rt);" idiom, and
touching rt after rt->rt_refcnt--.

These abuses seem to be needed because rt_refcnt manages only references
between rtentry and doesn't take care of references during packet processing
(IOW references from local variables). In order to reduce the above abuses,
the latter cases should be counted by rt_refcnt as well as the former cases.

This change improves consistency of use of rt_refcnt:
- rtentry is always accessed with rt_refcnt incremented
- rtentry's rt_refcnt is decremented after use (rtfree is always used instead
  of rt_refcnt--)
- functions returning rtentry increment its rt_refcnt (and caller rtfree it)

Note that rt_refcnt prevents rtentry from being freed but doesn't prevent
rtentry from being updated. Toward MP-safe, we need to provide another
protection for rtentry, e.g., locks. (Or introduce a better data structure
allowing concurrent readers during updates.)

Revision 1.145 / (download) - annotate - [select for diffs], Mon Jun 8 08:21:49 2015 UTC (8 years, 9 months ago) by roy
Branch: MAIN
Changes since 1.144: +8 -3 lines
Diff to previous 1.144 (colored) to selected 1.139 (colored)

Guard against the possibility the there is no ready address.

Revision 1.133.2.2 / (download) - annotate - [select for diffs], Sat Jun 6 14:40:25 2015 UTC (8 years, 9 months ago) by skrll
Branch: nick-nhusb
Changes since 1.133.2.1: +43 -12 lines
Diff to previous 1.133.2.1 (colored) to branchpoint 1.133 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.144 / (download) - annotate - [select for diffs], Thu Apr 30 09:57:38 2015 UTC (8 years, 11 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20150606
Changes since 1.143: +35 -5 lines
Diff to previous 1.143 (colored) to selected 1.139 (colored)

Make some functions static

- rtflushall
- rtcache_clear
- rtcache_invalidate

And pull these static inline functions in route.c

- rt_destroy
- rt_setkey

Revision 1.143 / (download) - annotate - [select for diffs], Tue Apr 28 02:56:58 2015 UTC (8 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.142: +6 -6 lines
Diff to previous 1.142 (colored) to selected 1.139 (colored)

Fix previous

sockaddr_copy never fail here so we can just return in success.

The previous code worked anyway, so I didn't notice the mistake...

Revision 1.142 / (download) - annotate - [select for diffs], Tue Apr 7 04:36:19 2015 UTC (8 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.141: +11 -10 lines
Diff to previous 1.141 (colored) to selected 1.139 (colored)

Clean up rtcache_setdst

We can assume sockaddr_copy never return NULL when we pass
non-NULL dst (1st argument).

Revision 1.133.2.1 / (download) - annotate - [select for diffs], Mon Apr 6 15:18:22 2015 UTC (8 years, 11 months ago) by skrll
Branch: nick-nhusb
Changes since 1.133: +173 -23 lines
Diff to previous 1.133 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.141 / (download) - annotate - [select for diffs], Mon Apr 6 08:39:06 2015 UTC (8 years, 11 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20150406
Changes since 1.140: +6 -3 lines
Diff to previous 1.140 (colored) to selected 1.139 (colored)

Make rt_maskedcopy static

Revision 1.140 / (download) - annotate - [select for diffs], Mon Apr 6 06:20:27 2015 UTC (8 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.139: +4 -2 lines
Diff to previous 1.139 (colored)

Include sys/sysctl.h ifdef RTFLUSH_DEBUG

Revision 1.139 / (download) - annotate - [selected], Mon Apr 6 06:16:30 2015 UTC (8 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.138: +2 -4 lines
Diff to previous 1.138 (colored)

Remove unnecessary inclusions

Revision 1.138 / (download) - annotate - [select for diffs], Fri Apr 3 05:44:13 2015 UTC (8 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.137: +20 -12 lines
Diff to previous 1.137 (colored) to selected 1.139 (colored)

Restructure rtcache_lookup2 to make it clear what it does

No functional change.

Revision 1.137 / (download) - annotate - [select for diffs], Thu Mar 26 04:38:17 2015 UTC (9 years ago) by ozaki-r
Branch: MAIN
Changes since 1.136: +2 -4 lines
Diff to previous 1.136 (colored) to selected 1.139 (colored)

Remove redundant rtcache_invariants

It's done in rtcache_getdst.

Revision 1.136 / (download) - annotate - [select for diffs], Thu Feb 26 09:54:46 2015 UTC (9 years, 1 month ago) by roy
Branch: MAIN
Changes since 1.135: +126 -5 lines
Diff to previous 1.135 (colored) to selected 1.139 (colored)

Introduce the routing flag RTF_LOCAL to track local address routes.
Add functions rt_ifa_addlocal() and rt_ifa_remlocal() to add and remove
local routes for the address and announce the new address and route
to the routing socket.

Add in_ifaddlocal() and in_ifremlocal() to use these functions.
Rename in6_if{add,rem}loop() to in6_if{add,rem}local() and use these
functions.

rtinit() no longer announces the address, just the network route for the
address. As such, calls to rt_newaddrmsg() have been removed from
in_addprefix() and in_scrubprefix().

This solves the problem of potentially more than one announcement, or no
announcement at all for the address in certain situations.

Revision 1.135 / (download) - annotate - [select for diffs], Wed Feb 25 12:45:34 2015 UTC (9 years, 1 month ago) by roy
Branch: MAIN
Changes since 1.134: +22 -2 lines
Diff to previous 1.134 (colored) to selected 1.139 (colored)

Rename nd6_rtmsg() to rt_newmsg() and move into the generic routing code
as it's not IPv6 specific and will be used elsewhere.

Revision 1.134 / (download) - annotate - [select for diffs], Tue Dec 2 19:57:11 2014 UTC (9 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.133: +5 -5 lines
Diff to previous 1.133 (colored) to selected 1.139 (colored)

zero out the sockaddrs when dup'ing.

Revision 1.133 / (download) - annotate - [select for diffs], Tue Sep 9 20:16:12 2014 UTC (9 years, 6 months ago) by rmind
Branch: MAIN
CVS Tags: nick-nhusb-base
Branch point for: nick-nhusb
Changes since 1.132: +7 -23 lines
Diff to previous 1.132 (colored) to selected 1.139 (colored)

Eliminate IFAREF() and IFAFREE() macros in favour of functions.

Revision 1.126.6.2 / (download) - annotate - [select for diffs], Wed Aug 20 00:04:34 2014 UTC (9 years, 7 months ago) by tls
Branch: tls-maxphys
Changes since 1.126.6.1: +12 -27 lines
Diff to previous 1.126.6.1 (colored) to branchpoint 1.126 (colored) to selected 1.139 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.129.2.1 / (download) - annotate - [select for diffs], Sun Aug 10 06:56:16 2014 UTC (9 years, 7 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.129: +11 -23 lines
Diff to previous 1.129 (colored) next main 1.130 (colored) to selected 1.139 (colored)

Rebase.

Revision 1.132 / (download) - annotate - [select for diffs], Fri Jun 6 01:27:32 2014 UTC (9 years, 9 months ago) by rmind
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0
Branch point for: netbsd-7
Changes since 1.131: +6 -9 lines
Diff to previous 1.131 (colored) to selected 1.139 (colored)

rtfree: let's assert for a non-negative reference count and see what happens.

Revision 1.131 / (download) - annotate - [select for diffs], Fri Jun 6 01:02:47 2014 UTC (9 years, 9 months ago) by rmind
Branch: MAIN
Changes since 1.130: +7 -7 lines
Diff to previous 1.130 (colored) to selected 1.139 (colored)

- Eliminate RTFREE() macro in favour of rtfree() function.
- Make rtcache() function static.

Revision 1.125.4.2 / (download) - annotate - [select for diffs], Thu May 22 11:41:09 2014 UTC (9 years, 10 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.125.4.1: +7 -19 lines
Diff to previous 1.125.4.1 (colored) to branchpoint 1.125 (colored) next main 1.126 (colored) to selected 1.139 (colored)

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.127.2.1 / (download) - annotate - [select for diffs], Sun May 18 17:46:12 2014 UTC (9 years, 10 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.127: +5 -17 lines
Diff to previous 1.127 (colored) next main 1.128 (colored) to selected 1.139 (colored)

sync with head

Revision 1.130 / (download) - annotate - [select for diffs], Sat Apr 26 11:10:10 2014 UTC (9 years, 11 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base
Changes since 1.129: +2 -11 lines
Diff to previous 1.129 (colored) to selected 1.139 (colored)

It's been > 20years since rtioctl() did something.  Let's just
remove that special way of returning EOPNOTSUPP.

Revision 1.129 / (download) - annotate - [select for diffs], Sat Mar 22 07:46:35 2014 UTC (10 years ago) by maxv
Branch: MAIN
CVS Tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
Branch point for: tls-earlyentropy
Changes since 1.128: +4 -3 lines
Diff to previous 1.128 (colored) to selected 1.139 (colored)

'newrt' is not supposed to be NULL. Therefore, the NULL-check in the if()
is pointless; and even if 'newrt' were NULL, 'rt' would be dereferenced
later. This is not a bug.

CID 270855

ok christos@

Revision 1.128 / (download) - annotate - [select for diffs], Tue Feb 25 18:30:12 2014 UTC (10 years, 1 month ago) by pooka
Branch: MAIN
CVS Tags: riastradh-drm2-base3
Changes since 1.127: +3 -7 lines
Diff to previous 1.127 (colored) to selected 1.139 (colored)

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.

Revision 1.126.2.1 / (download) - annotate - [select for diffs], Mon Jul 29 05:43:13 2013 UTC (10 years, 8 months ago) by msaitoh
Branch: netbsd-6
Changes since 1.126: +4 -4 lines
Diff to previous 1.126 (colored) next main 1.127 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by christos in ticket #909):
	sys/net/route.c: revision 1.127
PR/44032: Proxy entries stopped working with pppd. The issue here is that
the route entry was added, but the RTF_LLINFO bit was not set, making arp -a
not showing the entry, but netstat -rn -f inet showing it with the missing
L bit. The order of resolution in ifa_ifwithroute() is that if a destination
address is found, then the interface chosen for the route is that of the
destination. This does not work for link-level addresses since the ppp
interface does not arp (uses link_rtrequest, not arp_rtrequest), so the
bit is never set. The easy solution here is to check that the gateway is
a link address, and use the interface which we chose for the link address
as opposed to the interface that routes to the destination. This restores
the previous behavior, but is it correct?

Revision 1.126.6.1 / (download) - annotate - [select for diffs], Sun Jun 23 06:20:25 2013 UTC (10 years, 9 months ago) by tls
Branch: tls-maxphys
Changes since 1.126: +4 -4 lines
Diff to previous 1.126 (colored) to selected 1.139 (colored)

resync from head

Revision 1.127 / (download) - annotate - [select for diffs], Sat Jun 8 02:42:56 2013 UTC (10 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Branch point for: rmind-smpnet
Changes since 1.126: +4 -4 lines
Diff to previous 1.126 (colored) to selected 1.139 (colored)

PR/44032: Proxy entries stopped working with pppd. The issue here is that
the route entry was added, but the RTF_LLINFO bit was not set, making arp -a
not showing the entry, but netstat -rn -f inet showing it with the missing
L bit. The order of resolution in ifa_ifwithroute() is that if a destination
address is found, then the interface chosen for the route is that of the
destination. This does not work for link-level addresses since the ppp
interface does not arp (uses link_rtrequest, not arp_rtrequest), so the
bit is never set. The easy solution here is to check that the gateway is
a link address, and use the interface which we chose for the link address
as opposed to the interface that routes to the destination. This restores
the previous behavior, but is it correct?

Revision 1.125.4.1 / (download) - annotate - [select for diffs], Tue Apr 17 00:08:38 2012 UTC (11 years, 11 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.125: +4 -4 lines
Diff to previous 1.125 (colored) to selected 1.139 (colored)

sync with head

Revision 1.125.8.1 / (download) - annotate - [select for diffs], Sat Feb 18 07:35:38 2012 UTC (12 years, 1 month ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.125: +4 -4 lines
Diff to previous 1.125 (colored) next main 1.126 (colored) to selected 1.139 (colored)

merge to -current.

Revision 1.113.4.1.6.1 / (download) - annotate - [select for diffs], Sun Feb 5 12:35:15 2012 UTC (12 years, 1 month ago) by bouyer
Branch: netbsd-5-1
CVS Tags: netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE
Changes since 1.113.4.1: +4 -4 lines
Diff to previous 1.113.4.1 (colored) next main 1.113.4.2 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by christos in ticket #1721):
	sys/net/route.c: revision 1.126
Count length from the beginning of the structure not the sa_data portion.
=46rom skrll@

Revision 1.113.4.1.2.1 / (download) - annotate - [select for diffs], Sun Feb 5 12:35:10 2012 UTC (12 years, 1 month ago) by bouyer
Branch: netbsd-5-0
Changes since 1.113.4.1: +4 -4 lines
Diff to previous 1.113.4.1 (colored) next main 1.113.4.2 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by christos in ticket #1721):
	sys/net/route.c: revision 1.126
Count length from the beginning of the structure not the sa_data portion.
=46rom skrll@

Revision 1.113.4.2 / (download) - annotate - [select for diffs], Sun Feb 5 12:34:55 2012 UTC (12 years, 1 month ago) by bouyer
Branch: 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
Changes since 1.113.4.1: +4 -4 lines
Diff to previous 1.113.4.1 (colored) to branchpoint 1.113 (colored) next main 1.114 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by christos in ticket #1721):
	sys/net/route.c: revision 1.126
Count length from the beginning of the structure not the sa_data portion.
=46rom skrll@

Revision 1.126 / (download) - annotate - [select for diffs], Mon Jan 30 20:01:08 2012 UTC (12 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, 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-1, 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, netbsd-6-0, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, khorben-n900, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10, agc-symver-base, agc-symver
Branch point for: tls-maxphys, netbsd-6
Changes since 1.125: +4 -4 lines
Diff to previous 1.125 (colored) to selected 1.139 (colored)

Count length from the beginning of the structure not the sa_data portion.
From skrll@

Revision 1.123.2.1 / (download) - annotate - [select for diffs], Mon Jun 6 09:09:53 2011 UTC (12 years, 9 months ago) by jruoho
Branch: jruoho-x86intr
Changes since 1.123: +20 -67 lines
Diff to previous 1.123 (colored) next main 1.124 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.121.4.4 / (download) - annotate - [select for diffs], Thu Apr 21 01:42:13 2011 UTC (12 years, 11 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.121.4.3: +17 -62 lines
Diff to previous 1.121.4.3 (colored) to branchpoint 1.121 (colored) next main 1.122 (colored) to selected 1.139 (colored)

sync with head

Revision 1.125 / (download) - annotate - [select for diffs], Thu Mar 31 19:40:52 2011 UTC (13 years ago) by dyoung
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, rmind-uvmplock-nbase, rmind-uvmplock-base, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3, cherry-xenmp-base, cherry-xenmp
Branch point for: yamt-pagecache, jmcneill-usbmp
Changes since 1.124: +19 -64 lines
Diff to previous 1.124 (colored) to selected 1.139 (colored)

Hide the radix-trie implementation of the forwarding table so that we
will have an easier time replacing it with something different, even if
it is a second radix-trie implementation.

sys/net/route.c and sys/net/rtsock.c no longer operate directly on
radix_nodes or radix_node_heads.

Hopefully this will reduce the temptation to implement multipath or
source-based routing using grotty hacks to the grotty old radix-trie
code, too. :-)

Revision 1.121.4.3 / (download) - annotate - [select for diffs], Sat Mar 5 20:55:54 2011 UTC (13 years ago) by rmind
Branch: rmind-uvmplock
Changes since 1.121.4.2: +3 -5 lines
Diff to previous 1.121.4.2 (colored) to branchpoint 1.121 (colored) to selected 1.139 (colored)

sync with head

Revision 1.123.4.1 / (download) - annotate - [select for diffs], Tue Feb 8 16:20:01 2011 UTC (13 years, 1 month ago) by bouyer
Branch: bouyer-quota2
Changes since 1.123: +3 -5 lines
Diff to previous 1.123 (colored) next main 1.124 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.124 / (download) - annotate - [select for diffs], Tue Feb 1 01:39:20 2011 UTC (13 years, 1 month ago) by matt
Branch: MAIN
CVS Tags: bouyer-quota2-nbase, bouyer-quota2-base
Changes since 1.123: +3 -5 lines
Diff to previous 1.123 (colored) to selected 1.139 (colored)

Add a new AF/PF_ROUTE which is 64-bit clean which makes the routing socket
interface (and its associated sysctls) act identically for both 32 and 64 bit
programs.  The old unclean one remains for backward compatibility.

Revision 1.121.2.1 / (download) - annotate - [select for diffs], Tue Aug 17 06:47:45 2010 UTC (13 years, 7 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.121: +29 -4 lines
Diff to previous 1.121 (colored) next main 1.122 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.113.4.1.4.1 / (download) - annotate - [select for diffs], Mon Aug 16 18:42:58 2010 UTC (13 years, 7 months ago) by matt
Branch: matt-nb5-mips64
CVS Tags: matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-k15
Changes since 1.113.4.1: +3 -3 lines
Diff to previous 1.113.4.1 (colored) next main 1.113.4.2 (colored) to selected 1.139 (colored)

Use uint64_t instead of u_quad_t

Revision 1.107.4.4 / (download) - annotate - [select for diffs], Wed Aug 11 22:54:55 2010 UTC (13 years, 7 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.107.4.3: +29 -4 lines
Diff to previous 1.107.4.3 (colored) to branchpoint 1.107 (colored) next main 1.108 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.121.4.2 / (download) - annotate - [select for diffs], Sat Jul 3 01:19:59 2010 UTC (13 years, 8 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.121.4.1: +21 -2 lines
Diff to previous 1.121.4.1 (colored) to branchpoint 1.121 (colored) to selected 1.139 (colored)

sync with head

Revision 1.123 / (download) - annotate - [select for diffs], Sat Jun 26 14:24:28 2010 UTC (13 years, 9 months ago) by kefren
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, matt-mips64-premerge-20101231, jruoho-x86intr-base
Branch point for: jruoho-x86intr, bouyer-quota2
Changes since 1.122: +21 -2 lines
Diff to previous 1.122 (colored) to selected 1.139 (colored)

Add MPLS support, proposed on tech-net@ a couple of days ago

Welcome to 5.99.33

Revision 1.121.4.1 / (download) - annotate - [select for diffs], Sun May 30 05:18:01 2010 UTC (13 years, 10 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.121: +10 -4 lines
Diff to previous 1.121 (colored) to selected 1.139 (colored)

sync with head

Revision 1.122 / (download) - annotate - [select for diffs], Sun May 2 19:17:56 2010 UTC (13 years, 10 months ago) by kefren
Branch: MAIN
Changes since 1.121: +10 -4 lines
Diff to previous 1.121 (colored) to selected 1.139 (colored)

Permit the existence of a route with unlinked ifp and ifa,
enabling this way the posibility to send a packet on an interface with
source address from another interface.

Revision 1.107.4.3 / (download) - annotate - [select for diffs], Thu Mar 11 15:04:27 2010 UTC (14 years ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.107.4.2: +35 -4 lines
Diff to previous 1.107.4.2 (colored) to branchpoint 1.107 (colored) to selected 1.139 (colored)

sync with head

Revision 1.121 / (download) - annotate - [select for diffs], Tue Nov 3 00:30:11 2009 UTC (14 years, 4 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, uebayasi-xip-base1, uebayasi-xip-base, matt-premerge-20091211
Branch point for: uebayasi-xip, rmind-uvmplock
Changes since 1.120: +3 -3 lines
Diff to previous 1.120 (colored) to selected 1.139 (colored)

s/u_quad_t/uint64_t/

Revision 1.120 / (download) - annotate - [select for diffs], Sat Oct 3 02:22:22 2009 UTC (14 years, 5 months ago) by elad
Branch: MAIN
CVS Tags: jym-xensuspend-nbase
Changes since 1.119: +5 -2 lines
Diff to previous 1.119 (colored) to selected 1.139 (colored)

We only care about KAUTH_NETWORK_ROUTE.

Revision 1.119 / (download) - annotate - [select for diffs], Fri Oct 2 23:16:21 2009 UTC (14 years, 5 months ago) by elad
Branch: MAIN
Changes since 1.118: +24 -2 lines
Diff to previous 1.118 (colored) to selected 1.139 (colored)

Move routing socket security policy back to the subsystem.

Revision 1.118 / (download) - annotate - [select for diffs], Wed Sep 16 15:23:04 2009 UTC (14 years, 6 months ago) by pooka
Branch: MAIN
Changes since 1.117: +9 -3 lines
Diff to previous 1.117 (colored) to selected 1.139 (colored)

Replace a large number of link set based sysctl node creations with
calls from subsystem constructors.  Benefits both future kernel
modules and rump.

no change to sysctl nodes on i386/MONOLITHIC & build tested i386/ALL

Revision 1.114.4.1 / (download) - annotate - [select for diffs], Wed May 13 17:22:20 2009 UTC (14 years, 10 months ago) by jym
Branch: jym-xensuspend
Changes since 1.114: +55 -13 lines
Diff to previous 1.114 (colored) next main 1.115 (colored) to selected 1.139 (colored)

Sync with HEAD.

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

Revision 1.107.4.2 / (download) - annotate - [select for diffs], Mon May 4 08:14:15 2009 UTC (14 years, 10 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.107.4.1: +125 -30 lines
Diff to previous 1.107.4.1 (colored) to branchpoint 1.107 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.113.2.3 / (download) - annotate - [select for diffs], Tue Apr 28 07:37:17 2009 UTC (14 years, 11 months ago) by skrll
Branch: nick-hppapmap
Changes since 1.113.2.2: +54 -6 lines
Diff to previous 1.113.2.2 (colored) to branchpoint 1.113 (colored) next main 1.114 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.113.4.1 / (download) - annotate - [select for diffs], Fri Apr 3 17:59:03 2009 UTC (14 years, 11 months ago) by snj
Branch: netbsd-5
CVS Tags: netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20091211, matt-nb4-mips64-k7-u2a-k9b
Branch point for: netbsd-5-1, netbsd-5-0, matt-nb5-mips64
Changes since 1.113: +2 -4 lines
Diff to previous 1.113 (colored) to selected 1.139 (colored)

Pull up following revision(s) (requested by christos in ticket #650):
	sys/net/route.c: revision 1.117
	sys/net/route.h: revision 1.73
	sys/net/rtsock.c: revision 1.125
	usr.sbin/arp/arp.c: revision 1.48
	usr.sbin/pppd/pppd/sys-bsd.c: revision 1.59
Centralize the ROUNDUP and ADVANCE macro in a header file, give them an
RT_ prefix and use them appropriately, instead of making copies. Make
pppd use the RT_ROUNDUP macro; fixes proxyarp setting on 64 bit hosts.

Revision 1.117 / (download) - annotate - [select for diffs], Thu Apr 2 21:02:06 2009 UTC (14 years, 11 months ago) by christos
Branch: 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-base
Changes since 1.116: +2 -4 lines
Diff to previous 1.116 (colored) to selected 1.139 (colored)

Centralize the ROUNDUP and ADVANCE macro in a header file, give them an
RT_ prefix and use them appropriately, instead of making copies. Make
pppd use the RT_ROUNDUP macro; fixes proxyarp setting on 64 bit hosts.

XXX: All this should be pulled up to 5.0

Revision 1.116 / (download) - annotate - [select for diffs], Tue Mar 24 16:36:52 2009 UTC (15 years ago) by roy
Branch: MAIN
Changes since 1.115: +54 -4 lines
Diff to previous 1.115 (colored) to selected 1.139 (colored)

When a route is deleted or it's ifa changed and it's the connected route
for the ifa we should ensure the IFA_ROUTE flag is removed from the ifa
and if applicable, added to the new ifa.

Revision 1.113.2.2 / (download) - annotate - [select for diffs], Tue Mar 3 18:33:38 2009 UTC (15 years ago) by skrll
Branch: nick-hppapmap
Changes since 1.113.2.1: +3 -9 lines
Diff to previous 1.113.2.1 (colored) to branchpoint 1.113 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.115 / (download) - annotate - [select for diffs], Fri Feb 20 10:57:19 2009 UTC (15 years, 1 month ago) by yamt
Branch: MAIN
CVS Tags: nick-hppapmap-base2
Changes since 1.114: +3 -9 lines
Diff to previous 1.114 (colored) to selected 1.139 (colored)

- rtredirect: use sockaddr_cmp directly.
- remove now unused equal.

Revision 1.113.2.1 / (download) - annotate - [select for diffs], Mon Jan 19 13:20:12 2009 UTC (15 years, 2 months ago) by skrll
Branch: nick-hppapmap
Changes since 1.113: +65 -15 lines
Diff to previous 1.113 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.105.6.4 / (download) - annotate - [select for diffs], Sat Jan 17 13:29:31 2009 UTC (15 years, 2 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.105.6.3: +63 -13 lines
Diff to previous 1.105.6.3 (colored) to branchpoint 1.105 (colored) next main 1.106 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.112.4.2 / (download) - annotate - [select for diffs], Sat Dec 13 01:15:26 2008 UTC (15 years, 3 months ago) by haad
Branch: haad-dm
Changes since 1.112.4.1: +65 -15 lines
Diff to previous 1.112.4.1 (colored) to branchpoint 1.112 (colored) next main 1.113 (colored) to selected 1.139 (colored)

Update haad-dm branch to haad-dm-base2.

Revision 1.114 / (download) - annotate - [select for diffs], Fri Nov 7 00:20:13 2008 UTC (15 years, 4 months ago) by dyoung
Branch: MAIN
CVS Tags: mjf-devfs2-base, haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Branch point for: jym-xensuspend
Changes since 1.113: +65 -15 lines
Diff to previous 1.113 (colored) to selected 1.139 (colored)

*** Summary ***

When a link-layer address changes (e.g., ifconfig ex0 link
02:de:ad:be:ef:02 active), send a gratuitous ARP and/or a Neighbor
Advertisement to update the network-/link-layer address bindings
on our LAN peers.

Refuse a change of ethernet address to the address 00:00:00:00:00:00
or to any multicast/broadcast address.  (Thanks matt@.)

Reorder ifnet ioctl operations so that driver ioctls may inherit
the functions of their "class"---ether_ioctl(), fddi_ioctl(), et
cetera---and the class ioctls may inherit from the generic ioctl,
ifioctl_common(), but both driver- and class-ioctls may override
the generic behavior.  Make network drivers share more code.

Distinguish a "factory" link-layer address from others for the
purposes of both protecting that address from deletion and computing
EUI64.

Return consistent, appropriate error codes from network drivers.

Improve readability.  KNF.

*** Details ***

In if_attach(), always initialize the interface ioctl routine,
ifnet->if_ioctl, if the driver has not already initialized it.
Delete if_ioctl == NULL tests everywhere else, because it cannot
happen.

In the ioctl routines of network interfaces, inherit common ioctl
behaviors by calling either ifioctl_common() or whichever ioctl
routine is appropriate for the class of interface---e.g., ether_ioctl()
for ethernets.

Stop (ab)using SIOCSIFADDR and start to use SIOCINITIFADDR.  In
the user->kernel interface, SIOCSIFADDR's argument was an ifreq,
but on the protocol->ifnet interface, SIOCSIFADDR's argument was
an ifaddr.  That was confusing, and it would work against me as I
make it possible for a network interface to overload most ioctls.
On the protocol->ifnet interface, replace SIOCSIFADDR with
SIOCINITIFADDR.  In ifioctl(), return EPERM if userland tries to
invoke SIOCINITIFADDR.

In ifioctl(), give the interface the first shot at handling most
interface ioctls, and give the protocol the second shot, instead
of the other way around. Finally, let compatibility code (COMPAT_OSOCK)
take a shot.

Pull device initialization out of switch statements under
SIOCINITIFADDR.  For example, pull ..._init() out of any switch
statement that looks like this:

        switch (...->sa_family) {
        case ...:
                ..._init();
                ...
                break;
        ...
        default:
                ..._init();
                ...
                break;
        }

Rewrite many if-else clauses that handle all permutations of IFF_UP
and IFF_RUNNING to use a switch statement,

        switch (x & (IFF_UP|IFF_RUNNING)) {
        case 0:
                ...
                break;
        case IFF_RUNNING:
                ...
                break;
        case IFF_UP:
                ...
                break;
        case IFF_UP|IFF_RUNNING:
                ...
                break;
        }

unifdef lots of code containing #ifdef FreeBSD, #ifdef NetBSD, and
#ifdef SIOCSIFMTU, especially in fwip(4) and in ndis(4).

In ipw(4), remove an if_set_sadl() call that is out of place.

In nfe(4), reuse the jumbo MTU logic in ether_ioctl().

Let ethernets register a callback for setting h/w state such as
promiscuous mode and the multicast filter in accord with a change
in the if_flags: ether_set_ifflags_cb() registers a callback that
returns ENETRESET if the caller should reset the ethernet by calling
if_init(), 0 on success, != 0 on failure.  Pull common code from
ex(4), gem(4), nfe(4), sip(4), tlp(4), vge(4) into ether_ioctl(),
and register if_flags callbacks for those drivers.

Return ENOTTY instead of EINVAL for inappropriate ioctls.  In
zyd(4), use ENXIO instead of ENOTTY to indicate that the device is
not any longer attached.

Add to if_set_sadl() a boolean 'factory' argument that indicates
whether a link-layer address was assigned by the factory or some
other source.  In a comment, recommend using the factory address
for generating an EUI64, and update in6_get_hw_ifid() to prefer a
factory address to any other link-layer address.

Add a routing message, RTM_LLINFO_UPD, that tells protocols to
update the binding of network-layer addresses to link-layer addresses.
Implement this message in IPv4 and IPv6 by sending a gratuitous
ARP or a neighbor advertisement, respectively.  Generate RTM_LLINFO_UPD
messages on a change of an interface's link-layer address.

In ether_ioctl(), do not let SIOCALIFADDR set a link-layer address
that is broadcast/multicast or equal to 00:00:00:00:00:00.

Make ether_ioctl() call ifioctl_common() to handle ioctls that it
does not understand.

In gif(4), initialize if_softc and use it, instead of assuming that
the gif_softc and ifp overlap.

Let ifioctl_common() handle SIOCGIFADDR.

Sprinkle rtcache_invariants(), which checks on DIAGNOSTIC kernels
that certain invariants on a struct route are satisfied.

In agr(4), rewrite agr_ioctl_filter() to be a bit more explicit
about the ioctls that we do not allow on an agr(4) member interface.

bzero -> memset.  Delete unnecessary casts to void *.  Use
sockaddr_in_init() and sockaddr_in6_init().  Compare pointers with
NULL instead of "testing truth".  Replace some instances of (type
*)0 with NULL.  Change some K&R prototypes to ANSI C, and join
lines.

Revision 1.112.4.1 / (download) - annotate - [select for diffs], Sun Oct 19 22:17:42 2008 UTC (15 years, 5 months ago) by haad
Branch: haad-dm
Changes since 1.112: +9 -6 lines
Diff to previous 1.112 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.108.2.2 / (download) - annotate - [select for diffs], Fri Oct 10 22:35:43 2008 UTC (15 years, 5 months ago) by skrll
Branch: wrstuden-revivesa
Changes since 1.108.2.1: +9 -6 lines
Diff to previous 1.108.2.1 (colored) next main 1.109 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.105.6.3 / (download) - annotate - [select for diffs], Sun Oct 5 20:11:32 2008 UTC (15 years, 5 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.105.6.2: +7 -4 lines
Diff to previous 1.105.6.2 (colored) to branchpoint 1.105 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.113 / (download) - annotate - [select for diffs], Sat Oct 4 00:09:34 2008 UTC (15 years, 5 months ago) by pooka
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, netbsd-5-base, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, matt-mips64-base2, haad-dm-base1
Branch point for: nick-hppapmap, netbsd-5
Changes since 1.112: +9 -6 lines
Diff to previous 1.112 (colored) to selected 1.139 (colored)

POOL_INIT -> pool_init

Revision 1.108.2.1 / (download) - annotate - [select for diffs], Mon Jun 23 04:31:58 2008 UTC (15 years, 9 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.108: +22 -41 lines
Diff to previous 1.108 (colored) to selected 1.139 (colored)

Sync w/ -current. 34 merge conflicts to follow.

Revision 1.105.6.2 / (download) - annotate - [select for diffs], Mon Jun 2 13:24:23 2008 UTC (15 years, 9 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.105.6.1: +25 -47 lines
Diff to previous 1.105.6.1 (colored) to branchpoint 1.105 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.107.2.1 / (download) - annotate - [select for diffs], Sun May 18 12:35:28 2008 UTC (15 years, 10 months ago) by yamt
Branch: yamt-pf42
Changes since 1.107: +22 -48 lines
Diff to previous 1.107 (colored) next main 1.108 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.107.4.1 / (download) - annotate - [select for diffs], Fri May 16 02:25:41 2008 UTC (15 years, 10 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.107: +22 -48 lines
Diff to previous 1.107 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.112 / (download) - annotate - [select for diffs], Tue May 13 20:49:33 2008 UTC (15 years, 10 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-nfs-mp-base2, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl, hpcarm-cleanup-nbase
Branch point for: haad-dm
Changes since 1.111: +3 -3 lines
Diff to previous 1.111 (colored) to selected 1.139 (colored)

rtinit() should pass RTM_ADD to ifa->ifa_rtrequest instead of cmd,
after all.

Revision 1.111 / (download) - annotate - [select for diffs], Tue May 13 20:21:09 2008 UTC (15 years, 10 months ago) by dyoung
Branch: MAIN
Changes since 1.110: +3 -3 lines
Diff to previous 1.110 (colored) to selected 1.139 (colored)

In rtinit(), when cmd == RTM_ADD, pass cmd instead of RTM_ADD to
ifa->ifa_rtrequest(), in preparation for handling rtinit(RTM_CHANGE)
in the RTM_ADD branch.

Revision 1.110 / (download) - annotate - [select for diffs], Tue May 13 20:18:11 2008 UTC (15 years, 10 months ago) by dyoung
Branch: MAIN
Changes since 1.109: +20 -38 lines
Diff to previous 1.109 (colored) to selected 1.139 (colored)

Simplify the RT_DPRINTF() calls.

Revision 1.109 / (download) - annotate - [select for diffs], Sun May 11 20:14:41 2008 UTC (15 years, 10 months ago) by dyoung
Branch: MAIN
Changes since 1.108: +4 -5 lines
Diff to previous 1.108 (colored) to selected 1.139 (colored)

Use memset, memmove, and memcmp instead of Bzero, Bcopy, and Bcmp,
respectively.

Revision 1.108 / (download) - annotate - [select for diffs], Mon Apr 28 20:24:09 2008 UTC (15 years, 11 months ago) by martin
Branch: MAIN
Branch point for: wrstuden-revivesa
Changes since 1.107: +2 -9 lines
Diff to previous 1.107 (colored) to selected 1.139 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.107 / (download) - annotate - [select for diffs], Thu Apr 10 18:12:02 2008 UTC (15 years, 11 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, yamt-nfs-mp-base
Branch point for: yamt-pf42, yamt-nfs-mp
Changes since 1.106: +7 -3 lines
Diff to previous 1.106 (colored) to selected 1.139 (colored)

Add some assertions that will catch any exception to
ro->ro_sa == NULL implies ro->_ro_rt == NULL.

Revision 1.105.6.1 / (download) - annotate - [select for diffs], Thu Apr 3 12:43:07 2008 UTC (15 years, 11 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.105: +4 -3 lines
Diff to previous 1.105 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.106 / (download) - annotate - [select for diffs], Wed Mar 26 14:54:19 2008 UTC (16 years ago) by ad
Branch: MAIN
CVS Tags: ad-socklock-base1
Changes since 1.105: +4 -3 lines
Diff to previous 1.105 (colored) to selected 1.139 (colored)

Defer processing of routing messages to a soft interrupt. These can be
generated at IPL_VM and it's not safe to call directly into the socket
layer at that level. Reviewed by matt@.

Revision 1.95.6.3 / (download) - annotate - [select for diffs], Sun Mar 23 02:05:05 2008 UTC (16 years ago) by matt
Branch: matt-armv6
Changes since 1.95.6.2: +54 -41 lines
Diff to previous 1.95.6.2 (colored) to branchpoint 1.95 (colored) next main 1.96 (colored) to selected 1.139 (colored)

sync with HEAD

Revision 1.98.4.1 / (download) - annotate - [select for diffs], Mon Feb 18 21:07:02 2008 UTC (16 years, 1 month ago) by mjf
Branch: mjf-devfs
Changes since 1.98: +53 -109 lines
Diff to previous 1.98 (colored) next main 1.99 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.66.2.7 / (download) - annotate - [select for diffs], Mon Feb 4 09:24:37 2008 UTC (16 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.66.2.6: +30 -24 lines
Diff to previous 1.66.2.6 (colored) to branchpoint 1.66 (colored) next main 1.67 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.98.10.5 / (download) - annotate - [select for diffs], Wed Jan 23 19:27:44 2008 UTC (16 years, 2 months ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.98.10.4: +28 -22 lines
Diff to previous 1.98.10.4 (colored) to branchpoint 1.98 (colored) next main 1.99 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.66.2.6 / (download) - annotate - [select for diffs], Mon Jan 21 09:47:07 2008 UTC (16 years, 2 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.66.2.5: +42 -147 lines
Diff to previous 1.66.2.5 (colored) to branchpoint 1.66 (colored) to selected 1.139 (colored)

sync with head

Revision 1.105 / (download) - annotate - [select for diffs], Mon Jan 21 09:11:24 2008 UTC (16 years, 2 months ago) by dyoung
Branch: 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, keiichi-mipv6, hpcarm-cleanup-base, bouyer-xeni386-nbase
Branch point for: mjf-devfs2
Changes since 1.104: +30 -24 lines
Diff to previous 1.104 (colored) to selected 1.139 (colored)

In rtflushall(), do not clear a route cache by removing its rtentry
reference, but mark the cache 'invalid'.  Let the next user of the
route cache check to whether or not the cache is valid, and update
the rtentry reference if necessary.  In this way, avoid hairy
splnet()/splx() protection of route caches, which I never did trust.

Revision 1.98.10.4 / (download) - annotate - [select for diffs], Sat Jan 19 12:15:30 2008 UTC (16 years, 2 months ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.98.10.3: +19 -13 lines
Diff to previous 1.98.10.3 (colored) to branchpoint 1.98 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.104 / (download) - annotate - [select for diffs], Mon Jan 14 05:00:18 2008 UTC (16 years, 2 months ago) by dyoung
Branch: MAIN
CVS Tags: bouyer-xeni386-base
Changes since 1.103: +9 -8 lines
Diff to previous 1.103 (colored) to selected 1.139 (colored)

Use rtcache_validate() instead of rtcache_getrt().  Delete rtcache_getrt().

In rtcache_lookup2(), use the return values of rtcache_validate()
and _rtcache_init() instead of looking at _ro_rt.  Also, check the
return code of rtcache_setdst() for an error.

Revision 1.103 / (download) - annotate - [select for diffs], Sat Jan 12 02:56:30 2008 UTC (16 years, 2 months ago) by dyoung
Branch: MAIN
Changes since 1.102: +15 -10 lines
Diff to previous 1.102 (colored) to selected 1.139 (colored)

_rtcache_init(): shorten this by getting out immediately if rtalloc1()
    returns NULL.
rtcache_copy(): re-order operations a bit.  KASSERT() that we are
    not copying a route over itself.

Revision 1.98.10.3 / (download) - annotate - [select for diffs], Thu Jan 10 23:44:35 2008 UTC (16 years, 2 months ago) by bouyer
Branch: bouyer-xeni386
CVS Tags: bouyer-xeni386-merge1
Changes since 1.98.10.2: +9 -8 lines
Diff to previous 1.98.10.2 (colored) to branchpoint 1.98 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.102 / (download) - annotate - [select for diffs], Thu Jan 10 08:03:22 2008 UTC (16 years, 2 months ago) by dyoung
Branch: MAIN
Changes since 1.101: +11 -10 lines
Diff to previous 1.101 (colored) to selected 1.139 (colored)

Make many void rtcache_X() routines return struct rtentry *, so
that we can make many back-to-back rtcache_X();rtcache_getrt()
calls into one rtcache_X() call.

Revision 1.95.6.2 / (download) - annotate - [select for diffs], Wed Jan 9 01:57:15 2008 UTC (16 years, 2 months ago) by matt
Branch: matt-armv6
Changes since 1.95.6.1: +24 -136 lines
Diff to previous 1.95.6.1 (colored) to branchpoint 1.95 (colored) to selected 1.139 (colored)

sync with HEAD

Revision 1.98.10.2 / (download) - annotate - [select for diffs], Tue Jan 8 22:11:49 2008 UTC (16 years, 2 months ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.98.10.1: +2 -2 lines
Diff to previous 1.98.10.1 (colored) to branchpoint 1.98 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.101 / (download) - annotate - [select for diffs], Tue Jan 8 03:37:45 2008 UTC (16 years, 2 months ago) by dyoung
Branch: MAIN
CVS Tags: matt-armv6-base
Changes since 1.100: +3 -3 lines
Diff to previous 1.100 (colored) to selected 1.139 (colored)

Delete an unnecessary cast.

Revision 1.100 / (download) - annotate - [select for diffs], Fri Jan 4 23:26:44 2008 UTC (16 years, 2 months ago) by dyoung
Branch: MAIN
Changes since 1.99: +3 -3 lines
Diff to previous 1.99 (colored) to selected 1.139 (colored)

Replace rtcache_down() with rtcache_validate() and update rtcache_down()
uses.

Revision 1.98.10.1 / (download) - annotate - [select for diffs], Wed Jan 2 21:57:11 2008 UTC (16 years, 2 months ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.98: +22 -134 lines
Diff to previous 1.98 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.98.6.1 / (download) - annotate - [select for diffs], Wed Dec 26 19:57:34 2007 UTC (16 years, 3 months ago) by ad
Branch: vmlocking2
Changes since 1.98: +22 -134 lines
Diff to previous 1.98 (colored) next main 1.99 (colored) to selected 1.139 (colored)

Sync with head.

Revision 1.99 / (download) - annotate - [select for diffs], Thu Dec 20 19:53:30 2007 UTC (16 years, 3 months ago) by dyoung
Branch: MAIN
CVS Tags: vmlocking2-base3
Changes since 1.98: +22 -134 lines
Diff to previous 1.98 (colored) to selected 1.139 (colored)

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.95.6.1 / (download) - annotate - [select for diffs], Tue Nov 6 23:33:38 2007 UTC (16 years, 4 months ago) by matt
Branch: matt-armv6
CVS Tags: matt-armv6-prevmlocking
Changes since 1.95: +15 -16 lines
Diff to previous 1.95 (colored) to selected 1.139 (colored)

sync with HEAD

Revision 1.66.2.5 / (download) - annotate - [select for diffs], Sat Oct 27 11:36:05 2007 UTC (16 years, 5 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.66.2.4: +2 -9 lines
Diff to previous 1.66.2.4 (colored) to branchpoint 1.66 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.95.4.2 / (download) - annotate - [select for diffs], Fri Oct 26 15:49:04 2007 UTC (16 years, 5 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.95.4.1: +2 -9 lines
Diff to previous 1.95.4.1 (colored) to branchpoint 1.95 (colored) next main 1.96 (colored) to selected 1.139 (colored)

Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.

Revision 1.97.2.1 / (download) - annotate - [select for diffs], Sun Oct 14 11:49:00 2007 UTC (16 years, 5 months ago) by yamt
Branch: yamt-x86pmap
Changes since 1.97: +2 -9 lines
Diff to previous 1.97 (colored) next main 1.98 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.87.2.7 / (download) - annotate - [select for diffs], Fri Oct 12 17:03:21 2007 UTC (16 years, 5 months ago) by ad
Branch: vmlocking
Changes since 1.87.2.6: +2 -9 lines
Diff to previous 1.87.2.6 (colored) next main 1.88 (colored) to selected 1.139 (colored)

Sync with head.

Revision 1.98 / (download) - annotate - [select for diffs], Wed Oct 10 22:14:38 2007 UTC (16 years, 5 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, 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, jmcneill-pm-base, jmcneill-base, cube-autoconf-base, cube-autoconf, bouyer-xenamd64-base2, bouyer-xenamd64-base, bouyer-xenamd64
Branch point for: vmlocking2, mjf-devfs, bouyer-xeni386
Changes since 1.97: +2 -9 lines
Diff to previous 1.97 (colored) to selected 1.139 (colored)

Delete dead code.

Revision 1.87.2.6 / (download) - annotate - [select for diffs], Tue Oct 9 13:44:43 2007 UTC (16 years, 5 months ago) by ad
Branch: vmlocking
Changes since 1.87.2.5: +15 -9 lines
Diff to previous 1.87.2.5 (colored) to selected 1.139 (colored)

Sync with head.

Revision 1.95.4.1 / (download) - annotate - [select for diffs], Mon Sep 3 16:48:59 2007 UTC (16 years, 6 months ago) by jmcneill
Branch: jmcneill-pm
Changes since 1.95: +15 -9 lines
Diff to previous 1.95 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.66.2.4 / (download) - annotate - [select for diffs], Mon Sep 3 14:42:24 2007 UTC (16 years, 6 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.66.2.3: +296 -120 lines
Diff to previous 1.66.2.3 (colored) to branchpoint 1.66 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.93.2.2 / (download) - annotate - [select for diffs], Mon Sep 3 10:23:13 2007 UTC (16 years, 6 months ago) by skrll
Branch: nick-csl-alignment
Changes since 1.93.2.1: +15 -9 lines
Diff to previous 1.93.2.1 (colored) to branchpoint 1.93 (colored) next main 1.94 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.97 / (download) - annotate - [select for diffs], Thu Aug 30 02:22:29 2007 UTC (16 years, 7 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-x86pmap-base2, yamt-x86pmap-base, nick-csl-alignment-base5
Branch point for: yamt-x86pmap
Changes since 1.96: +7 -2 lines
Diff to previous 1.96 (colored) to selected 1.139 (colored)

Make rtcache() and rtflush() block IPL_NET while they add/remove
a route from the cached routes list, so that the list won't change
out from under them.

Revision 1.96 / (download) - annotate - [select for diffs], Thu Aug 30 02:17:35 2007 UTC (16 years, 7 months ago) by dyoung
Branch: MAIN
Changes since 1.95: +10 -9 lines
Diff to previous 1.95 (colored) to selected 1.139 (colored)

Use malloc(9) for sockaddrs instead of pool(9), and remove dom_sa_pool
and dom_sa_len members from struct domain.  Pools of fixed-size
objects are too rigid for sockaddr_dls, whose size can vary over
a wide range.

Return sockaddr_dl to its "historical" size.  Now that I'm using
malloc(9) instead of pool(9) to allocate sockaddr_dl, I can create
a sockaddr_dl of any size in the kernel, so expanding sockaddr_dl
is useless.

Avoid using sizeof(struct sockaddr_dl) in the kernel.

Introduce sockaddr_dl_alloc() for allocating & initializing an
arbitrary sockaddr_dl on the heap.

Add an argument, the sockaddr length, to sockaddr_alloc(),
sockaddr_copy(), and sockaddr_dl_setaddr().

Constify: LLADDR() -> CLLADDR().

Where the kernel overwrites LLADDR(), use sockaddr_dl_setaddr(),
instead.  Used properly, sockaddr_dl_setaddr() will not overrun
the end of the sockaddr.

Revision 1.87.2.5 / (download) - annotate - [select for diffs], Mon Aug 20 21:27:55 2007 UTC (16 years, 7 months ago) by ad
Branch: vmlocking
Changes since 1.87.2.4: +115 -73 lines
Diff to previous 1.87.2.4 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.93.2.1 / (download) - annotate - [select for diffs], Wed Aug 15 13:49:41 2007 UTC (16 years, 7 months ago) by skrll
Branch: nick-csl-alignment
Changes since 1.93: +115 -73 lines
Diff to previous 1.93 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.95.8.2 / (download) - annotate - [select for diffs], Sat Jul 21 03:12:11 2007 UTC (16 years, 8 months ago) by dyoung
Branch: matt-mips64
Changes since 1.95.8.1: +1404 -0 lines
Diff to previous 1.95.8.1 (colored) to branchpoint 1.95 (colored) next main 1.96 (colored) to selected 1.139 (colored)

Cosmetic: remove superfluous parentheses.  Compare pointers with
NULL instead of testing "truth."  Remove unnecessary casts to void*
in memset() calls.

Revision 1.95.8.1, Sat Jul 21 03:12:10 2007 UTC (16 years, 8 months ago) by dyoung
Branch: matt-mips64
Changes since 1.95: +0 -1404 lines
FILE REMOVED

file route.c was added on branch matt-mips64 on 2007-07-21 03:12:11 +0000

Revision 1.95 / (download) - annotate - [select for diffs], Sat Jul 21 03:12:10 2007 UTC (16 years, 8 months ago) by dyoung
Branch: MAIN
CVS Tags: matt-mips64-base, hpcarm-cleanup
Branch point for: matt-mips64, matt-armv6, jmcneill-pm
Changes since 1.94: +13 -13 lines
Diff to previous 1.94 (colored) to selected 1.139 (colored)

Cosmetic: remove superfluous parentheses.  Compare pointers with
NULL instead of testing "truth."  Remove unnecessary casts to void*
in memset() calls.

Revision 1.94 / (download) - annotate - [select for diffs], Thu Jul 19 20:48:53 2007 UTC (16 years, 8 months ago) by dyoung
Branch: MAIN
Changes since 1.93: +104 -62 lines
Diff to previous 1.93 (colored) to selected 1.139 (colored)

Take steps to hide the radix_node implementation of the forwarding table
from the forwarding table's users:

        Introduce rt_walktree() for walking the routing table and
        applying a function to each rtentry.  Replace most
        rn_walktree() calls with it.

        Use rt_getkey()/rt_setkey() to get/set a route's destination.
        Keep a pointer to the sockaddr key in the rtentry, so that
        rtentry users do not have to grovel in the radix_node for
        the key.

        Add a RTM_GET method to rtrequest.  Use that instead of
        radix_node lookups in, e.g., carp(4).

Add sys/net/link_proto.c, which supplies sockaddr routines for
link-layer socket addresses (sockaddr_dl).

Cosmetic:

        Constify.  KNF.  Stop open-coding LIST_FOREACH, TAILQ_FOREACH,
        et cetera.  Use NULL instead of 0 for null pointers.  Use
        __arraycount().  Reduce gratuitous parenthesization.

        Stop using variadic arguments for rip6_output(), it is
        unnecessary.

        Remove the unnecessary rtentry member rt_genmask and the
        code to maintain it, since nothing actually used it.

        Make rt_maskedcopy() easier to read by using meaningful variable
        names.

        Extract a subroutine intern_netmask() for looking up a netmask in
        the masks table.

        Start converting backslash-ridden IPv6 macros in
        sys/netinet6/in6_var.h into inline subroutines that one
        can read without special eyeglasses.

One functional change: when the kernel serves an RTM_GET, RTM_LOCK,
or RTM_CHANGE request, it applies the netmask (if supplied) to a
destination before searching for it in the forwarding table.

I have changed sys/netinet/ip_carp.c, carp_setroute(), to remove
the unlawful radix_node knowledge.

Apart from the changes to carp(4), netiso, ATM, and strip(4), I
have run the changes on three nodes in my wireless routing testbed,
which involves IPv4 + IPv6 dynamic routing acrobatics, and it's
working beautifully so far.

Revision 1.87.2.4 / (download) - annotate - [select for diffs], Sun Jul 15 13:27:55 2007 UTC (16 years, 8 months ago) by ad
Branch: vmlocking
Changes since 1.87.2.3: +43 -13 lines
Diff to previous 1.87.2.3 (colored) to selected 1.139 (colored)

Sync with head.

Revision 1.88.2.1 / (download) - annotate - [select for diffs], Wed Jul 11 20:11:02 2007 UTC (16 years, 8 months ago) by mjf
Branch: mjf-ufs-trans
Changes since 1.88: +171 -45 lines
Diff to previous 1.88 (colored) next main 1.89 (colored) to selected 1.139 (colored)

Sync with head.

Revision 1.93 / (download) - annotate - [select for diffs], Mon Jul 9 21:11:01 2007 UTC (16 years, 8 months ago) by ad
Branch: MAIN
CVS Tags: nick-csl-alignment-base, mjf-ufs-trans-base
Branch point for: nick-csl-alignment
Changes since 1.92: +3 -3 lines
Diff to previous 1.92 (colored) to selected 1.139 (colored)

Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements

Revision 1.87.2.3 / (download) - annotate - [select for diffs], Sun Jul 1 21:50:46 2007 UTC (16 years, 9 months ago) by ad
Branch: vmlocking
Changes since 1.87.2.2: +3 -3 lines
Diff to previous 1.87.2.2 (colored) to selected 1.139 (colored)

Adapt to callout API change.

Revision 1.92 / (download) - annotate - [select for diffs], Sat Jun 9 03:07:21 2007 UTC (16 years, 9 months ago) by dyoung
Branch: MAIN
Changes since 1.91: +43 -13 lines
Diff to previous 1.91 (colored) to selected 1.139 (colored)

Get rid of radix_node_head.rnh_walktree, because it is only ever
set to rn_walktree.

Introduce rt_walktree(), which applies a subroutine to every route
in a particular address family.  Use it instead of rn_walktree()
virtually everywhere.  This helps to hide the routing table
implementation.

Revision 1.87.2.2 / (download) - annotate - [select for diffs], Fri Jun 8 14:17:37 2007 UTC (16 years, 9 months ago) by ad
Branch: vmlocking
Changes since 1.87.2.1: +129 -33 lines
Diff to previous 1.87.2.1 (colored) to selected 1.139 (colored)

Sync with head.

Revision 1.85.2.5 / (download) - annotate - [select for diffs], Mon May 7 10:55:54 2007 UTC (16 years, 10 months ago) by yamt
Branch: yamt-idlelwp
Changes since 1.85.2.4: +129 -33 lines
Diff to previous 1.85.2.4 (colored) next main 1.86 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.91 / (download) - annotate - [select for diffs], Sun May 6 02:17:54 2007 UTC (16 years, 10 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-idlelwp-base8
Changes since 1.90: +9 -6 lines
Diff to previous 1.90 (colored) to selected 1.139 (colored)

Factor rtcache_lookup2() out of rtcache_lookup1(), for re-use in
the IPv6 stack.  rtcache_lookup2() takes an int * argument that it
writes with 1 if we had a cache 'hit', 0 if there was a cache
'miss'.

Revision 1.90 / (download) - annotate - [select for diffs], Wed May 2 20:40:23 2007 UTC (16 years, 11 months ago) by dyoung
Branch: MAIN
Changes since 1.89: +125 -32 lines
Diff to previous 1.89 (colored) to selected 1.139 (colored)

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.89 / (download) - annotate - [select for diffs], Sun Apr 22 13:05:21 2007 UTC (16 years, 11 months ago) by xtraeme
Branch: MAIN
Changes since 1.88: +3 -3 lines
Diff to previous 1.88 (colored) to selected 1.139 (colored)

rtcache_clear is defined as static void in route.c, but it's used
in netinet/in_route.c. Move the prototype into route.h to fix
the build.

Revision 1.85.2.4 / (download) - annotate - [select for diffs], Sat Mar 24 14:56:08 2007 UTC (17 years ago) by yamt
Branch: yamt-idlelwp
Changes since 1.85.2.3: +6 -4 lines
Diff to previous 1.85.2.3 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.87.2.1 / (download) - annotate - [select for diffs], Tue Mar 13 16:52:00 2007 UTC (17 years ago) by ad
Branch: vmlocking
Changes since 1.87: +6 -4 lines
Diff to previous 1.87 (colored) to selected 1.139 (colored)

Sync with head.

Revision 1.88 / (download) - annotate - [select for diffs], Mon Mar 12 18:18:35 2007 UTC (17 years ago) by ad
Branch: MAIN
CVS Tags: thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup
Branch point for: mjf-ufs-trans
Changes since 1.87: +6 -4 lines
Diff to previous 1.87 (colored) to selected 1.139 (colored)

Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.

Revision 1.85.2.3 / (download) - annotate - [select for diffs], Mon Mar 12 05:59:15 2007 UTC (17 years ago) by rmind
Branch: yamt-idlelwp
Changes since 1.85.2.2: +8 -8 lines
Diff to previous 1.85.2.2 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.87 / (download) - annotate - [select for diffs], Sun Mar 4 06:03:18 2007 UTC (17 years ago) by christos
Branch: MAIN
Branch point for: vmlocking
Changes since 1.86: +8 -8 lines
Diff to previous 1.86 (colored) to selected 1.139 (colored)

Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.

Revision 1.85.2.2 / (download) - annotate - [select for diffs], Tue Feb 27 16:54:46 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-idlelwp
Changes since 1.85.2.1: +1234 -0 lines
Diff to previous 1.85.2.1 (colored) to selected 1.139 (colored)

- sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.

Revision 1.66.2.3 / (download) - annotate - [select for diffs], Mon Feb 26 09:11:37 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.66.2.2: +154 -56 lines
Diff to previous 1.66.2.2 (colored) to branchpoint 1.66 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.86 / (download) - annotate - [select for diffs], Sat Feb 17 22:34:10 2007 UTC (17 years, 1 month ago) by dyoung
Branch: MAIN
CVS Tags: ad-audiomp-base, ad-audiomp
Changes since 1.85: +41 -24 lines
Diff to previous 1.85 (colored) to selected 1.139 (colored)

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.85.2.1, Sat Feb 17 07:50:49 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-idlelwp
Changes since 1.85: +0 -1217 lines
FILE REMOVED

file route.c was added on branch yamt-idlelwp on 2007-02-27 16:54:46 +0000

Revision 1.85 / (download) - annotate - [select for diffs], Sat Feb 17 07:50:49 2007 UTC (17 years, 1 month ago) by dyoung
Branch: MAIN
Branch point for: yamt-idlelwp
Changes since 1.84: +26 -29 lines
Diff to previous 1.84 (colored) to selected 1.139 (colored)

Cosmetic: don't open-code LIST_FOREACH().  Remove extraneous
parentheses.  Bzero -> memset.  Shorten staircase in rt_timer_add().

Revision 1.71.2.2 / (download) - annotate - [select for diffs], Fri Jan 12 01:04:12 2007 UTC (17 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.71.2.1: +227 -12 lines
Diff to previous 1.71.2.1 (colored) to branchpoint 1.71 (colored) next main 1.72 (colored) to selected 1.139 (colored)

Sync with head.

Revision 1.84 / (download) - annotate - [select for diffs], Fri Jan 5 16:40:08 2007 UTC (17 years, 2 months ago) by joerg
Branch: MAIN
CVS Tags: post-newlock2-merge, newlock2-nbase, newlock2-base
Changes since 1.83: +97 -13 lines
Diff to previous 1.83 (colored) to selected 1.139 (colored)

Add a debug option for the route cache to help tracing down issues
like PR 35272 and 35318. When the kernel is compiled with
-DRTCACHE_DEBUG, all rtcache entries are logged to a list with the place
they got initialised. This allows overwrites, double inits and other
manual messing to be detected.

Revision 1.66.2.2 / (download) - annotate - [select for diffs], Sat Dec 30 20:50:20 2006 UTC (17 years, 3 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.66.2.1: +165 -29 lines
Diff to previous 1.66.2.1 (colored) to branchpoint 1.66 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.71.4.3 / (download) - annotate - [select for diffs], Mon Dec 18 11:42:16 2006 UTC (17 years, 3 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.71.4.2: +52 -2 lines
Diff to previous 1.71.4.2 (colored) to branchpoint 1.71 (colored) next main 1.72 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.83 / (download) - annotate - [select for diffs], Fri Dec 15 21:18:53 2006 UTC (17 years, 3 months ago) by joerg
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4
Changes since 1.82: +52 -2 lines
Diff to previous 1.82 (colored) to selected 1.139 (colored)

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.71.4.2 / (download) - annotate - [select for diffs], Sun Dec 10 07:19:00 2006 UTC (17 years, 3 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.71.4.1: +109 -27 lines
Diff to previous 1.71.4.1 (colored) to branchpoint 1.71 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.82 / (download) - annotate - [select for diffs], Sat Dec 9 05:33:06 2006 UTC (17 years, 3 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-splraiseipl-base3
Changes since 1.81: +43 -4 lines
Diff to previous 1.81 (colored) to selected 1.139 (colored)

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.81 / (download) - annotate - [select for diffs], Thu Dec 7 19:37:08 2006 UTC (17 years, 3 months ago) by joerg
Branch: MAIN
Changes since 1.80: +22 -2 lines
Diff to previous 1.80 (colored) to selected 1.139 (colored)

Deinline rt_get_ifa. Keep it in route.c as it is part of the routing
API, even though rtsock.c is the only user right now.

Revision 1.80 / (download) - annotate - [select for diffs], Thu Dec 7 19:20:14 2006 UTC (17 years, 3 months ago) by joerg
Branch: MAIN
Changes since 1.79: +25 -2 lines
Diff to previous 1.79 (colored) to selected 1.139 (colored)

Deinline rt_replace_ifa and move rt_set_ifa and rt_set_ifa1 to
route.c as they are not used outside that file.

Revision 1.79 / (download) - annotate - [select for diffs], Mon Dec 4 00:56:44 2006 UTC (17 years, 3 months ago) by dyoung
Branch: MAIN
Changes since 1.78: +7 -9 lines
Diff to previous 1.78 (colored) to selected 1.139 (colored)

Replace the temporary variable ndst with rt_key(rt).  This will
simplify the application of RADIX_MPATH patches.

No functional change intended.

Revision 1.78 / (download) - annotate - [select for diffs], Mon Dec 4 00:52:47 2006 UTC (17 years, 3 months ago) by dyoung
Branch: MAIN
Changes since 1.77: +4 -2 lines
Diff to previous 1.77 (colored) to selected 1.139 (colored)

Paranoid protection against use after free: in rtfree(), set rt_ifa
and rt_ifp to NULL.

Revision 1.77 / (download) - annotate - [select for diffs], Mon Dec 4 00:48:59 2006 UTC (17 years, 3 months ago) by dyoung
Branch: MAIN
Changes since 1.76: +2 -3 lines
Diff to previous 1.76 (colored) to selected 1.139 (colored)

Cosmetic: remove extra empty line.

Revision 1.71.2.1 / (download) - annotate - [select for diffs], Sat Nov 18 21:39:30 2006 UTC (17 years, 4 months ago) by ad
Branch: newlock2
Changes since 1.71: +25 -16 lines
Diff to previous 1.71 (colored) to selected 1.139 (colored)

Sync with head.

Revision 1.76 / (download) - annotate - [select for diffs], Thu Nov 16 01:33:40 2006 UTC (17 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, matt-nb4-arm-base, matt-nb4-arm
Changes since 1.75: +4 -4 lines
Diff to previous 1.75 (colored) to selected 1.139 (colored)

__unused removal on arguments; approved by core.

Revision 1.75 / (download) - annotate - [select for diffs], Mon Nov 13 17:51:02 2006 UTC (17 years, 4 months ago) by dyoung
Branch: MAIN
Changes since 1.74: +8 -4 lines
Diff to previous 1.74 (colored) to selected 1.139 (colored)

In rtalloc(), release our reference to the prior rtentry before
referencing a new rtentry.

Revision 1.74 / (download) - annotate - [select for diffs], Mon Nov 13 05:13:40 2006 UTC (17 years, 4 months ago) by dyoung
Branch: MAIN
Changes since 1.73: +11 -14 lines
Diff to previous 1.73 (colored) to selected 1.139 (colored)

Add a source-address selection policy mechanism to the kernel.

Also, add ioctls SIOCGIFADDRPREF/SIOCSIFADDRPREF to get/set preference
numbers for addresses.  Make ifconfig(8) set/display preference
numbers.

To activate source-address selection policies in your kernel, add
'options IPSELSRC' to your kernel configuration.

Miscellaneous changes in support of source-address selection:

        1 Factor out some common code, producing rt_replace_ifa().

        2 Abbreviate a for-loop with TAILQ_FOREACH().

        3 Add the predicates on IPv4 addresses IN_LINKLOCAL() and
          IN_PRIVATE(), that are true for link-local unicast
          (169.254/16) and RFC1918 private addresses, respectively.
          Add the predicate IN_ANY_LOCAL() that is true for link-local
          unicast and multicast.

        4 Add IPv4-specific interface attach/detach routines,
          in_domifattach and in_domifdetach, which build #ifdef
          IPSELSRC.

See in_getifa(9) for a more thorough description of source-address
selection policy.

Revision 1.71.4.1 / (download) - annotate - [select for diffs], Sun Oct 22 06:07:25 2006 UTC (17 years, 5 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.71: +12 -4 lines
Diff to previous 1.71 (colored) to selected 1.139 (colored)

sync with head

Revision 1.73 / (download) - annotate - [select for diffs], Thu Oct 12 01:32:30 2006 UTC (17 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2
Changes since 1.72: +4 -4 lines
Diff to previous 1.72 (colored) to selected 1.139 (colored)

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386

Revision 1.72 / (download) - annotate - [select for diffs], Thu Oct 5 17:35:19 2006 UTC (17 years, 5 months ago) by tls
Branch: MAIN
Changes since 1.71: +10 -2 lines
Diff to previous 1.71 (colored) to selected 1.139 (colored)

Protect calls to pool_put/pool_get that may occur in interrupt context
with spl used to protect other allocations and frees, or datastructure
element insertion and removal, in adjacent code.

It is almost unquestionably the case that some of the spl()/splx() calls
added here are superfluous, but it really seems wrong to see:

	s=splfoo();
	/* frob data structure */
	splx(s);
	pool_put(x);

and if we think we need to protect the first operation, then it is hard
to see why we should not think we need to protect the next.  "Better
safe than sorry".

It is also almost unquestionably the case that I missed some pool
gets/puts from interrupt context with my strategy for finding these
calls; use of PR_NOWAIT is a strong hint that a pool may be used from
interrupt context but many callers in the kernel pass a "can wait/can't
wait" flag down such that my searches might not have found them.  One
notable area that needs to be looked at is pf.

See also:

http://mail-index.netbsd.org/tech-kern/2006/07/19/0003.html
http://mail-index.netbsd.org/tech-kern/2006/07/19/0009.html

Revision 1.67.8.4 / (download) - annotate - [select for diffs], Thu Sep 14 12:31:55 2006 UTC (17 years, 6 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.67.8.3: +2 -6 lines
Diff to previous 1.67.8.3 (colored) to branchpoint 1.67 (colored) next main 1.68 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.67.4.1 / (download) - annotate - [select for diffs], Sat Sep 9 02:58:06 2006 UTC (17 years, 6 months ago) by rpaulo
Branch: rpaulo-netinet-merge-pcb
Changes since 1.67: +46 -71 lines
Diff to previous 1.67 (colored) next main 1.68 (colored) to selected 1.139 (colored)

sync with head

Revision 1.71 / (download) - annotate - [select for diffs], Thu Sep 7 02:40:33 2006 UTC (17 years, 6 months ago) by dogcow
Branch: MAIN
CVS Tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, rpaulo-netinet-merge-pcb-base
Branch point for: yamt-splraiseipl, newlock2
Changes since 1.70: +2 -6 lines
Diff to previous 1.70 (colored) to selected 1.139 (colored)

remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP.

Revision 1.67.8.3 / (download) - annotate - [select for diffs], Mon Jun 26 12:53:39 2006 UTC (17 years, 9 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.67.8.2: +4 -15 lines
Diff to previous 1.67.8.2 (colored) to branchpoint 1.67 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.66.2.1 / (download) - annotate - [select for diffs], Wed Jun 21 15:10:27 2006 UTC (17 years, 9 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.66: +47 -68 lines
Diff to previous 1.66 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.69.2.1 / (download) - annotate - [select for diffs], Mon Jun 19 04:09:12 2006 UTC (17 years, 9 months ago) by chap
Branch: chap-midi
Changes since 1.69: +4 -15 lines
Diff to previous 1.69 (colored) next main 1.70 (colored) to selected 1.139 (colored)

Sync with head.

Revision 1.70 / (download) - annotate - [select for diffs], Wed Jun 7 22:33:43 2006 UTC (17 years, 9 months ago) by kardel
Branch: MAIN
CVS Tags: yamt-pdpolicy-base8, yamt-pdpolicy-base7, yamt-pdpolicy-base6, gdamore-uart-base, gdamore-uart, chap-midi-nbase, chap-midi-base, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.69: +4 -15 lines
Diff to previous 1.69 (colored) to selected 1.139 (colored)

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.67.12.1 / (download) - annotate - [select for diffs], Wed May 24 15:50:44 2006 UTC (17 years, 10 months ago) by tron
Branch: peter-altq
Changes since 1.67: +44 -54 lines
Diff to previous 1.67 (colored) next main 1.68 (colored) to selected 1.139 (colored)

Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.

Revision 1.67.8.2 / (download) - annotate - [select for diffs], Wed May 24 10:58:56 2006 UTC (17 years, 10 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.67.8.1: +3 -2 lines
Diff to previous 1.67.8.1 (colored) to branchpoint 1.67 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.67.6.2 / (download) - annotate - [select for diffs], Sat Apr 22 11:40:07 2006 UTC (17 years, 11 months ago) by simonb
Branch: simonb-timecounters
CVS Tags: simonb-timcounters-final
Changes since 1.67.6.1: +44 -54 lines
Diff to previous 1.67.6.1 (colored) to branchpoint 1.67 (colored) next main 1.68 (colored) to selected 1.139 (colored)

Sync with head.

Revision 1.67.10.1 / (download) - annotate - [select for diffs], Wed Apr 19 04:46:10 2006 UTC (17 years, 11 months ago) by elad
Branch: elad-kernelauth
Changes since 1.67: +44 -54 lines
Diff to previous 1.67 (colored) next main 1.68 (colored) to selected 1.139 (colored)

sync with head.

Revision 1.69 / (download) - annotate - [select for diffs], Sat Apr 15 02:19:00 2006 UTC (17 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pdpolicy-base5, simonb-timecounters-base, elad-kernelauth-base
Branch point for: chap-midi
Changes since 1.68: +3 -2 lines
Diff to previous 1.68 (colored) to selected 1.139 (colored)

Coverity CID 855: Add a KASSERT for null route from successful rtrequest.

Revision 1.67.8.1 / (download) - annotate - [select for diffs], Tue Apr 11 11:55:48 2006 UTC (17 years, 11 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.67: +43 -54 lines
Diff to previous 1.67 (colored) to selected 1.139 (colored)

sync with head

Revision 1.68 / (download) - annotate - [select for diffs], Mon Apr 10 19:06:37 2006 UTC (17 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pdpolicy-base4
Changes since 1.67: +43 -54 lines
Diff to previous 1.67 (colored) to selected 1.139 (colored)

PR/33231: Anraud Degroote: Miscellaneous cleanups in the route code:
    - use of 0 instead of NULL
    - questionnable macros

Revision 1.67.6.1 / (download) - annotate - [select for diffs], Sat Feb 4 14:18:52 2006 UTC (18 years, 1 month ago) by simonb
Branch: simonb-timecounters
Changes since 1.67: +4 -15 lines
Diff to previous 1.67 (colored) to selected 1.139 (colored)

Adapt for timecounters: mostly use get*time(), use bintime's for timeout
calculations and use "time_second" instead of "time.tv_sec".

Revision 1.67 / (download) - annotate - [select for diffs], Sun Dec 11 12:24:52 2005 UTC (18 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-uio_vmspace, yamt-pdpolicy-base3, yamt-pdpolicy-base2, yamt-pdpolicy-base, peter-altq-base
Branch point for: yamt-pdpolicy, simonb-timecounters, rpaulo-netinet-merge-pcb, peter-altq, elad-kernelauth
Changes since 1.66: +3 -3 lines
Diff to previous 1.66 (colored) to selected 1.139 (colored)

merge ktrace-lwp.

Revision 1.57.2.8 / (download) - annotate - [select for diffs], Thu Nov 10 14:10:33 2005 UTC (18 years, 4 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.57.2.7: +11 -12 lines
Diff to previous 1.57.2.7 (colored) next main 1.58 (colored) to selected 1.139 (colored)

Sync with HEAD. Here we go again...

Revision 1.66 / (download) - annotate - [select for diffs], Sun May 29 21:22:53 2005 UTC (18 years, 10 months ago) by christos
Branch: 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
Changes since 1.65: +11 -12 lines
Diff to previous 1.65 (colored) to selected 1.139 (colored)

- sprinkle const
- remove unneeded casts
- use more mem*() instead of b*() funcs.

Revision 1.63.4.1 / (download) - annotate - [select for diffs], Fri Apr 29 11:29:32 2005 UTC (18 years, 11 months ago) by kent
Branch: kent-audio2
Changes since 1.63: +15 -15 lines
Diff to previous 1.63 (colored) next main 1.64 (colored) to selected 1.139 (colored)

sync with -current

Revision 1.64.2.1 / (download) - annotate - [select for diffs], Sat Mar 19 08:36:32 2005 UTC (19 years ago) by yamt
Branch: yamt-km
Changes since 1.64: +14 -14 lines
Diff to previous 1.64 (colored) next main 1.65 (colored) to selected 1.139 (colored)

sync with head.  xen and whitespace.  xen part is not finished.

Revision 1.57.2.7 / (download) - annotate - [select for diffs], Fri Mar 4 16:53:00 2005 UTC (19 years ago) by skrll
Branch: ktrace-lwp
Changes since 1.57.2.6: +14 -14 lines
Diff to previous 1.57.2.6 (colored) to selected 1.139 (colored)

Sync with HEAD.

Hi Perry!

Revision 1.65 / (download) - annotate - [select for diffs], Sat Feb 26 22:45:09 2005 UTC (19 years, 1 month ago) by perry
Branch: 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
Changes since 1.64: +14 -14 lines
Diff to previous 1.64 (colored) to selected 1.139 (colored)

nuke trailing whitespace

Revision 1.57.2.6 / (download) - annotate - [select for diffs], Mon Jan 24 08:35:53 2005 UTC (19 years, 2 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.57.2.5: +3 -3 lines
Diff to previous 1.57.2.5 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.64 / (download) - annotate - [select for diffs], Sun Jan 23 18:41:56 2005 UTC (19 years, 2 months ago) by matt
Branch: MAIN
CVS Tags: yamt-km-base2, yamt-km-base
Branch point for: yamt-km
Changes since 1.63: +3 -3 lines
Diff to previous 1.63 (colored) to selected 1.139 (colored)

Change initialzie of domains to use link sets.  Switch to using STAILQ.
Add a convenience macro DOMAIN_FOREACH to interate through the domain.

Revision 1.57.2.5 / (download) - annotate - [select for diffs], Tue Oct 19 15:58:10 2004 UTC (19 years, 5 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.57.2.4: +7 -2 lines
Diff to previous 1.57.2.4 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.63 / (download) - annotate - [select for diffs], Thu Sep 30 00:14:05 2004 UTC (19 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Branch point for: kent-audio2
Changes since 1.62: +7 -4 lines
Diff to previous 1.62 (colored) to selected 1.139 (colored)

Fix problem in previous commit; we need to create a new sockaddr.

Revision 1.62 / (download) - annotate - [select for diffs], Wed Sep 29 21:19:33 2004 UTC (19 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.61: +4 -2 lines
Diff to previous 1.61 (colored) to selected 1.139 (colored)

PR/22849: Sean Boudreau: rtrequest() w/ RTM_DELETE not honouring netmask
as it does w/ RTM_ADD.

Revision 1.57.2.4 / (download) - annotate - [select for diffs], Tue Sep 21 13:36:42 2004 UTC (19 years, 6 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.57.2.3: +3 -3 lines
Diff to previous 1.57.2.3 (colored) to selected 1.139 (colored)

Fix the sync with head I botched.

Revision 1.57.2.3 / (download) - annotate - [select for diffs], Sat Sep 18 14:54:16 2004 UTC (19 years, 6 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.57.2.2: +3 -3 lines
Diff to previous 1.57.2.2 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.57.2.2 / (download) - annotate - [select for diffs], Tue Aug 3 10:54:19 2004 UTC (19 years, 7 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.57.2.1: +60 -107 lines
Diff to previous 1.57.2.1 (colored) to selected 1.139 (colored)

Sync with HEAD

Revision 1.61 / (download) - annotate - [select for diffs], Sun Apr 25 16:42:42 2004 UTC (19 years, 11 months ago) by simonb
Branch: MAIN
Changes since 1.60: +4 -10 lines
Diff to previous 1.60 (colored) to selected 1.139 (colored)

Initialise (most) pools from a link set instead of explicit calls
to pool_init.  Untouched pools are ones that either in arch-specific
code, or aren't initialiased during initial system startup.

 Convert struct session, ucred and lockf to pools.

Revision 1.60 / (download) - annotate - [select for diffs], Wed Apr 21 21:03:43 2004 UTC (19 years, 11 months ago) by matt
Branch: MAIN
Changes since 1.59: +51 -90 lines
Diff to previous 1.59 (colored) to selected 1.139 (colored)

ANSI-fy and some additional de-__P and constification.

Revision 1.59 / (download) - annotate - [select for diffs], Wed Apr 21 04:17:28 2004 UTC (19 years, 11 months ago) by matt
Branch: MAIN
Changes since 1.58: +16 -14 lines
Diff to previous 1.58 (colored) to selected 1.139 (colored)

Constify if.c radix.c and route.c (and fix related fallout).

Revision 1.58 / (download) - annotate - [select for diffs], Thu Aug 7 16:32:57 2003 UTC (20 years, 7 months ago) by agc
Branch: 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
Changes since 1.57: +3 -7 lines
Diff to previous 1.57 (colored) to selected 1.139 (colored)

Move UCB-licensed code from 4-clause to 3-clause licence.

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

Revision 1.57.2.1 / (download) - annotate - [select for diffs], Wed Jul 2 15:26:57 2003 UTC (20 years, 9 months ago) by darrenr
Branch: ktrace-lwp
Changes since 1.57: +4 -4 lines
Diff to previous 1.57 (colored) to selected 1.139 (colored)

Apply the aborted ktrace-lwp changes to a specific branch.  This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it.  This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.

Revision 1.57 / (download) - annotate - [select for diffs], Sun Jun 29 22:31:52 2003 UTC (20 years, 9 months ago) by fvdl
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.56: +2 -2 lines
Diff to previous 1.56 (colored) to selected 1.139 (colored)

Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.

Revision 1.56 / (download) - annotate - [select for diffs], Sat Jun 28 14:22:07 2003 UTC (20 years, 9 months ago) by darrenr
Branch: MAIN
Changes since 1.55: +4 -4 lines
Diff to previous 1.55 (colored) to selected 1.139 (colored)

Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V

Revision 1.52.4.2 / (download) - annotate - [select for diffs], Tue Jun 17 11:55:08 2003 UTC (20 years, 9 months ago) by msaitoh
Branch: 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
Changes since 1.52.4.1: +14 -4 lines
Diff to previous 1.52.4.1 (colored) to branchpoint 1.52 (colored) next main 1.53 (colored) to selected 1.139 (colored)

Pullup rev. 1.55 (requested by itojun in ticket #984):
 remove all entries in rt timer queue on ip_mtudisc change, instead of
 destroying the queue.

Revision 1.52.4.1 / (download) - annotate - [select for diffs], Wed Dec 11 18:14:47 2002 UTC (21 years, 3 months ago) by he
Branch: netbsd-1-6
CVS Tags: netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001
Changes since 1.52: +7 -4 lines
Diff to previous 1.52 (colored) to selected 1.139 (colored)

Pull up revision 1.54 (requested by itojun in ticket #982):
  Add an argument to rt_timer_remove_all(), to specify if we
  need to call timeout routine on removal.

Revision 1.43.2.7 / (download) - annotate - [select for diffs], Wed Dec 11 06:46:33 2002 UTC (21 years, 3 months ago) by thorpej
Branch: nathanw_sa
CVS Tags: nathanw_sa_end
Changes since 1.43.2.6: +17 -4 lines
Diff to previous 1.43.2.6 (colored) to branchpoint 1.43 (colored) next main 1.44 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.36.4.3 / (download) - annotate - [select for diffs], Wed Nov 13 00:35:00 2002 UTC (21 years, 4 months ago) by itojun
Branch: netbsd-1-5
Changes since 1.36.4.2: +16 -4 lines
Diff to previous 1.36.4.2 (colored) to branchpoint 1.36 (colored) next main 1.37 (colored) to selected 1.139 (colored)

sys/net/route.c                                 1.55 via patch
sys/net/route.h                                 1.32
sys/netinet/ip_input.c                          1.163

  Remove all entries on rt timer queue on ip_mtudisc change, instead
  of destroying the queue.

(itojun, redo)

Revision 1.55 / (download) - annotate - [select for diffs], Tue Nov 12 02:10:13 2002 UTC (21 years, 4 months ago) by itojun
Branch: MAIN
CVS Tags: nathanw_sa_before_merge, nathanw_sa_base, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Changes since 1.54: +14 -4 lines
Diff to previous 1.54 (colored) to selected 1.139 (colored)

remove all entries in rt timer queue on ip_mtudisc change, instead of
destroying the queue.

Revision 1.54 / (download) - annotate - [select for diffs], Tue Nov 12 01:37:30 2002 UTC (21 years, 4 months ago) by itojun
Branch: MAIN
Changes since 1.53: +7 -4 lines
Diff to previous 1.53 (colored) to selected 1.139 (colored)

add an argument to rt_timer_remove_all(), to specify if we need to call
timeout routine on removal.

Revision 1.43.4.5 / (download) - annotate - [select for diffs], Fri Sep 6 08:49:02 2002 UTC (21 years, 6 months ago) by jdolecek
Branch: kqueue
Changes since 1.43.4.4: +3 -3 lines
Diff to previous 1.43.4.4 (colored) to branchpoint 1.43 (colored) next main 1.44 (colored) to selected 1.139 (colored)

sync kqueue branch with HEAD

Revision 1.52.2.1 / (download) - annotate - [select for diffs], Thu Aug 29 00:56:43 2002 UTC (21 years, 7 months ago) by gehenna
Branch: gehenna-devsw
Changes since 1.52: +3 -3 lines
Diff to previous 1.52 (colored) next main 1.53 (colored) to selected 1.139 (colored)

catch up with -current.

Revision 1.43.2.6 / (download) - annotate - [select for diffs], Tue Aug 27 23:47:54 2002 UTC (21 years, 7 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.43.2.5: +3 -3 lines
Diff to previous 1.43.2.5 (colored) to branchpoint 1.43 (colored) to selected 1.139 (colored)

Catch up to -current.

Revision 1.53 / (download) - annotate - [select for diffs], Mon Aug 26 01:42:28 2002 UTC (21 years, 7 months ago) by thorpej
Branch: MAIN
CVS Tags: kqueue-beforemerge, kqueue-base, kqueue-aftermerge, gehenna-devsw-base
Changes since 1.52: +3 -3 lines
Diff to previous 1.52 (colored) to selected 1.139 (colored)

Fix a signed/unsigned comparison warning from GCC 3.3.

Revision 1.43.4.4 / (download) - annotate - [select for diffs], Sun Jun 23 17:50:33 2002 UTC (21 years, 9 months ago) by jdolecek
Branch: kqueue
Changes since 1.43.4.3: +6 -2 lines
Diff to previous 1.43.4.3 (colored) to branchpoint 1.43 (colored) to selected 1.139 (colored)

catch up with -current on kqueue branch

Revision 1.43.2.5 / (download) - annotate - [select for diffs], Thu Jun 20 03:48:22 2002 UTC (21 years, 9 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.43.2.4: +6 -2 lines
Diff to previous 1.43.2.4 (colored) to branchpoint 1.43 (colored) to selected 1.139 (colored)

Catch up to -current.

Revision 1.52 / (download) - annotate - [select for diffs], Sun May 12 20:40:12 2002 UTC (21 years, 10 months ago) by matt
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1
Branch point for: netbsd-1-6, gehenna-devsw
Changes since 1.51: +6 -2 lines
Diff to previous 1.51 (colored) to selected 1.139 (colored)

Eliminate more commons.

Revision 1.43.2.4 / (download) - annotate - [select for diffs], Mon Apr 1 07:48:26 2002 UTC (22 years ago) by nathanw
Branch: nathanw_sa
Changes since 1.43.2.3: +2 -2 lines
Diff to previous 1.43.2.3 (colored) to branchpoint 1.43 (colored) to selected 1.139 (colored)

Catch up to -current.
(CVS: It's not just a program. It's an adventure!)

Revision 1.43.4.3 / (download) - annotate - [select for diffs], Sat Mar 16 16:02:09 2002 UTC (22 years ago) by jdolecek
Branch: kqueue
Changes since 1.43.4.2: +4 -4 lines
Diff to previous 1.43.4.2 (colored) to branchpoint 1.43 (colored) to selected 1.139 (colored)

Catch up with -current.

Revision 1.51 / (download) - annotate - [select for diffs], Fri Mar 8 20:48:43 2002 UTC (22 years ago) by thorpej
Branch: MAIN
CVS Tags: newlock-base, newlock, eeh-devprop-base, eeh-devprop
Changes since 1.50: +4 -4 lines
Diff to previous 1.50 (colored) to selected 1.139 (colored)

Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.

Revision 1.43.4.2 / (download) - annotate - [select for diffs], Thu Jan 10 20:02:21 2002 UTC (22 years, 2 months ago) by thorpej
Branch: kqueue
Changes since 1.43.4.1: +9 -2 lines
Diff to previous 1.43.4.1 (colored) to branchpoint 1.43 (colored) to selected 1.139 (colored)

Sync kqueue branch with -current.

Revision 1.43.2.3 / (download) - annotate - [select for diffs], Wed Nov 14 19:17:30 2001 UTC (22 years, 4 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.43.2.2: +5 -2 lines
Diff to previous 1.43.2.2 (colored) to branchpoint 1.43 (colored) to selected 1.139 (colored)

Catch up to -current.

Revision 1.36.4.2 / (download) - annotate - [select for diffs], Tue Nov 13 21:17:07 2001 UTC (22 years, 4 months ago) by he
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-PATCH003
Changes since 1.36.4.1: +5 -1 lines
Diff to previous 1.36.4.1 (colored) to branchpoint 1.36 (colored) to selected 1.139 (colored)

Pull up revision 1.48 (requested by itojun):
  Avoid memory leak on RTM_DELETE.

Revision 1.50 / (download) - annotate - [select for diffs], Mon Nov 12 23:49:48 2001 UTC (22 years, 4 months ago) by lukem
Branch: MAIN
CVS Tags: ifpoll-base
Changes since 1.49: +4 -1 lines
Diff to previous 1.49 (colored) to selected 1.139 (colored)

add RCSIDs

Revision 1.48.2.1 / (download) - annotate - [select for diffs], Mon Nov 12 21:19:20 2001 UTC (22 years, 4 months ago) by thorpej
Branch: thorpej-mips-cache
Changes since 1.48: +2 -2 lines
Diff to previous 1.48 (colored) next main 1.49 (colored) to selected 1.139 (colored)

Sync the thorpej-mips-cache branch with -current.

Revision 1.49 / (download) - annotate - [select for diffs], Mon Nov 5 18:02:16 2001 UTC (22 years, 4 months ago) by matt
Branch: MAIN
CVS Tags: thorpej-mips-cache-base
Changes since 1.48: +2 -2 lines
Diff to previous 1.48 (colored) to selected 1.139 (colored)

Switch to using queue access macros instead of refering to the member
fields explicitly.

Revision 1.43.2.2 / (download) - annotate - [select for diffs], Mon Oct 22 20:41:54 2001 UTC (22 years, 5 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.43.2.1: +5 -1 lines
Diff to previous 1.43.2.1 (colored) to branchpoint 1.43 (colored) to selected 1.139 (colored)

Catch up to -current.

Revision 1.48 / (download) - annotate - [select for diffs], Tue Oct 16 02:42:36 2001 UTC (22 years, 5 months ago) by itojun
Branch: MAIN
Branch point for: thorpej-mips-cache
Changes since 1.47: +5 -1 lines
Diff to previous 1.47 (colored) to selected 1.139 (colored)

on RTM_DELETE, reduce refcnt on rt->rt_parent, to avoid leaks.
from IIJ seil team

Revision 1.43.2.1 / (download) - annotate - [select for diffs], Fri Aug 24 00:12:18 2001 UTC (22 years, 7 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.43: +17 -21 lines
Diff to previous 1.43 (colored) to selected 1.139 (colored)

Catch up with -current.

Revision 1.43.4.1 / (download) - annotate - [select for diffs], Fri Aug 3 04:13:53 2001 UTC (22 years, 8 months ago) by lukem
Branch: kqueue
Changes since 1.43: +17 -21 lines
Diff to previous 1.43 (colored) to selected 1.139 (colored)

update to -current

Revision 1.47 / (download) - annotate - [select for diffs], Thu Jul 26 05:47:37 2001 UTC (22 years, 8 months ago) by itojun
Branch: MAIN
CVS Tags: thorpej-devvp-base3, thorpej-devvp-base2, thorpej-devvp-base, thorpej-devvp, pre-chs-ubcperf, post-chs-ubcperf
Changes since 1.46: +7 -6 lines
Diff to previous 1.46 (colored) to selected 1.139 (colored)

do not initialize rmx_mtu on RTM_ADD.

on gateway change, copy rmx_mtu from gateway only under the following condition:
- current MTU is not locked
- current MTU was discovered via PMTUD

XXX if gateway has MTU == 0, current MTU is set to 0 and we are going to
rediscover PMTU again.  is it good or bad?

Revision 1.46 / (download) - annotate - [select for diffs], Wed Jul 25 07:13:44 2001 UTC (22 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.45: +1 -8 lines
Diff to previous 1.45 (colored) to selected 1.139 (colored)

do not copy rmx_mtu on RTM_ADD/RESOLVE.  the fragment was mistakenly
introduced on 1.25, from other *bsd via kame.  from thorpej

Revision 1.45 / (download) - annotate - [select for diffs], Fri Jul 20 18:52:18 2001 UTC (22 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.44: +4 -2 lines
Diff to previous 1.44 (colored) to selected 1.139 (colored)

validate sa_len on equal() macro. without the change we may touch the content
of a2 beyond a2->sa_len mistakelnly.  sync with kame

Revision 1.44 / (download) - annotate - [select for diffs], Wed Jul 18 16:43:10 2001 UTC (22 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.43: +8 -8 lines
Diff to previous 1.43 (colored) to selected 1.139 (colored)

bzero -> memset

Revision 1.36.4.1 / (download) - annotate - [select for diffs], Thu Apr 5 12:43:22 2001 UTC (22 years, 11 months ago) by he
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-PATCH002, netbsd-1-5-PATCH001
Changes since 1.36: +105 -12 lines
Diff to previous 1.36 (colored) to selected 1.139 (colored)

Pull up revisions 1.40-1.41 (via patch, requested by itojun):
  Mark cloned routes with RTF_CLONED.  Present it in ``netstat -r''
  output by ``c''.

  Let static routes overwrite cloned routes, as cloned routes can
  come back again if necessary.  Should fix PR#11916 and maybe some
  other PRs with ARP behavior.

  Cleanup cloned route when parent route (RTF_CLONING) goes away.
  Adds rt_parent to link parent from child (like NRL did, ours do
  refcnt rt_refcnt properly).

Revision 1.29.2.5 / (download) - annotate - [select for diffs], Mon Mar 12 13:31:48 2001 UTC (23 years ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.29.2.4: +2 -2 lines
Diff to previous 1.29.2.4 (colored) to branchpoint 1.29 (colored) next main 1.30 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.43 / (download) - annotate - [select for diffs], Wed Feb 21 05:45:11 2001 UTC (23 years, 1 month ago) by itojun
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Branch point for: nathanw_sa, kqueue
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored) to selected 1.139 (colored)

use u_quad_t for rtstat.
not sure if it really matters, but short (32K) looks way too small given
recent fat pipes connecting *BSD boxes, and our great uptime :-).

Revision 1.29.2.4 / (download) - annotate - [select for diffs], Sun Feb 11 19:17:10 2001 UTC (23 years, 1 month ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.29.2.3: +105 -12 lines
Diff to previous 1.29.2.3 (colored) to branchpoint 1.29 (colored) to selected 1.139 (colored)

Sync with HEAD.

Revision 1.42 / (download) - annotate - [select for diffs], Sat Jan 27 11:07:59 2001 UTC (23 years, 2 months ago) by itojun
Branch: MAIN
Changes since 1.41: +4 -4 lines
Diff to previous 1.41 (colored) to selected 1.139 (colored)

change non-intuitive function name.  s/rtflushit/rtflushclone1/

Revision 1.41 / (download) - annotate - [select for diffs], Sat Jan 27 10:39:33 2001 UTC (23 years, 2 months ago) by itojun
Branch: MAIN
Changes since 1.40: +47 -1 lines
Diff to previous 1.40 (colored) to selected 1.139 (colored)

cleanup cloned route when parent route (RTF_CLONING) goes away.
adds rt_parent to link parent from child (like NRL did, ours do refcnt
rt_refcnt properly).

bsdi rt_walkbranch would speedup the processing, but since the code will not
be visited too frequently, the current code (with rt_walktree) should be okay.

Revision 1.40 / (download) - annotate - [select for diffs], Sat Jan 27 04:49:31 2001 UTC (23 years, 2 months ago) by itojun
Branch: MAIN
Changes since 1.39: +59 -12 lines
Diff to previous 1.39 (colored) to selected 1.139 (colored)

mark cloned routes with RTF_CLONED.  present it with netstat -r by "c".

let static routes overwrite cloned routes, as cloned routes can come back again
if necessary.  behavior same as freebsd/bsdi, code partially from bsdi42.
(NRL rt->rt_parent was not added)
should fix PR 11916 and maybe some other PRs with ARP behavior.

recompilation of usr.sbin/route6d is suggested.

Revision 1.29.2.3 / (download) - annotate - [select for diffs], Thu Jan 18 09:23:54 2001 UTC (23 years, 2 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.29.2.2: +114 -11 lines
Diff to previous 1.29.2.2 (colored) to branchpoint 1.29 (colored) to selected 1.139 (colored)

Sync with head (for UBC+NFS fixes, mostly).

Revision 1.39 / (download) - annotate - [select for diffs], Wed Jan 17 04:05:42 2001 UTC (23 years, 2 months ago) by itojun
Branch: MAIN
Changes since 1.38: +115 -12 lines
Diff to previous 1.38 (colored) to selected 1.139 (colored)

pull post-4.4BSD change to sys/net/route.c from BSD/OS 4.2 (UCB copyrighted).

have sys/net/route.c:rtrequest1(), which takes rt_addrinfo * as the argument.
pass rt_addrinfo all the way down to rtrequest, and ifa->ifa_rtrequest.
3rd arg of ifa->ifa_rtrequest is now rt_addrinfo * instead of sockaddr *
(almost noone is using it anyways).

benefit: the follwoing command now works.  previously we need two route(8)
invocations, "add" then "change".
# route add -inet6 default ::1 -ifp gif0

remove unsafe typecast in rtrequest(), from rtentry * to sockaddr *.  it was
introduced by 4.3BSD-reno and never corrected.

XXX is eon_rtrequest() change correct regarding to 3rd arg?
eon_rtrequest() and rtrequest() were incorrect since 4.3BSD-reno,
so i do not have correct answer in the source code.
someone with more clue about netiso-over-ip, please help.

Revision 1.29.2.2 / (download) - annotate - [select for diffs], Wed Dec 13 15:50:34 2000 UTC (23 years, 3 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.29.2.1: +27 -2 lines
Diff to previous 1.29.2.1 (colored) to branchpoint 1.29 (colored) to selected 1.139 (colored)

Sync with HEAD (for UBC fixes).

Revision 1.38 / (download) - annotate - [select for diffs], Mon Dec 11 07:52:48 2000 UTC (23 years, 3 months ago) by itojun
Branch: MAIN
Changes since 1.37: +3 -3 lines
Diff to previous 1.37 (colored) to selected 1.139 (colored)

do not touch region after free

Revision 1.37 / (download) - annotate - [select for diffs], Sat Dec 9 01:29:45 2000 UTC (23 years, 3 months ago) by itojun
Branch: MAIN
Changes since 1.36: +27 -2 lines
Diff to previous 1.36 (colored) to selected 1.139 (colored)

update icmp6 too big validation.  the change is necessary since pmtud is
mandatory for IPv6 (so we can't just validate by using connected pcb - we need
to allow traffic from unconnected pcb to do pmtud).
- if the traffic is validated by xx_ctlinput, allow up to "hiwat" pmtud
  route entries.
- if the traffic was not validated by xx_ctlinput, allow up to "lowat" pmtud
  route entries (there's upper limit, so bad guys cannot blow up our routing
  table).
sync with kame

XXX need to think again about default hiwat/lowat value.
XXX victim selection to help starvation case

Revision 1.29.2.1 / (download) - annotate - [select for diffs], Mon Nov 20 18:10:11 2000 UTC (23 years, 4 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.29: +43 -36 lines
Diff to previous 1.29 (colored) to selected 1.139 (colored)

Update thorpej_scsipi to -current as of a month ago

Revision 1.36 / (download) - annotate - [select for diffs], Thu Mar 30 09:45:40 2000 UTC (24 years ago) by augustss
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, minoura-xpg4dl-base, minoura-xpg4dl
Branch point for: netbsd-1-5
Changes since 1.35: +21 -21 lines
Diff to previous 1.35 (colored) to selected 1.139 (colored)

Kill some more register declarations.

Revision 1.35 / (download) - annotate - [select for diffs], Thu Mar 23 07:03:26 2000 UTC (24 years ago) by thorpej
Branch: MAIN
Changes since 1.34: +7 -3 lines
Diff to previous 1.34 (colored) to selected 1.139 (colored)

New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.

Revision 1.34 / (download) - annotate - [select for diffs], Wed Mar 22 16:51:03 2000 UTC (24 years ago) by itojun
Branch: MAIN
Changes since 1.33: +1 -6 lines
Diff to previous 1.33 (colored) to selected 1.139 (colored)

remove bogus comment

Revision 1.33 / (download) - annotate - [select for diffs], Mon Mar 13 23:52:39 2000 UTC (24 years ago) by soren
Branch: MAIN
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored) to selected 1.139 (colored)

Fix doubled 'the's in comments.

Revision 1.32 / (download) - annotate - [select for diffs], Fri Mar 10 14:47:12 2000 UTC (24 years ago) by itojun
Branch: MAIN
Changes since 1.31: +4 -1 lines
Diff to previous 1.31 (colored) to selected 1.139 (colored)

do not touch radix_node with RNF_ROOT on route_output().  this can
cause kernel panic (by non-root invocation of route(8)) on certain
routing table setup.
KAME PR: 217

Revision 1.31 / (download) - annotate - [select for diffs], Wed Feb 2 18:02:08 2000 UTC (24 years, 2 months ago) by thorpej
Branch: MAIN
CVS Tags: chs-ubc2-newbase
Changes since 1.30: +4 -2 lines
Diff to previous 1.30 (colored) to selected 1.139 (colored)

Wrap a debugging printf in IFAREF_DEBUG.

Revision 1.30 / (download) - annotate - [select for diffs], Tue Feb 1 22:52:05 2000 UTC (24 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.29: +11 -8 lines
Diff to previous 1.29 (colored) to selected 1.139 (colored)

First-draft if_detach() implementation, originally from Bill Studnemund,
although this version has been changed somewhat:
- reference counting on ifaddrs isn't as complete as Bill's original
  work was.  This is hard to get right, and we should attack one
  protocol at a time.
- This doesn't do reference counting or dynamic allocation of ifnets yet.
- This version introduces a new PRU -- PRU_PURGEADDR, which is used to
  purge an ifaddr from a protocol.  The old method Bill used didn't work
  on all protocols, and it only worked on some because it was Very Lucky.

This mostly works ... i.e. works for my USB Ethernet, except for a dangling
ifaddr reference left by the IPv6 code; have not yet tracked this down.

Revision 1.27.2.1 / (download) - annotate - [select for diffs], Mon Dec 27 18:36:11 1999 UTC (24 years, 3 months ago) by wrstuden
Branch: wrstuden-devbsize
Changes since 1.27: +10 -16 lines
Diff to previous 1.27 (colored) next main 1.28 (colored) to selected 1.139 (colored)

Pull up to last week's -current.

Revision 1.24.6.2 / (download) - annotate - [select for diffs], Tue Nov 30 13:35:15 1999 UTC (24 years, 4 months ago) by itojun
Branch: kame
CVS Tags: kame_141_19991130
Changes since 1.24.6.1: +3 -13 lines
Diff to previous 1.24.6.1 (colored) to branchpoint 1.24 (colored) next main 1.25 (colored) to selected 1.139 (colored)

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.24.2.1 / (download) - annotate - [select for diffs], Sun Oct 10 20:22:17 1999 UTC (24 years, 5 months ago) by cgd
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH003, netbsd-1-4-PATCH002
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored) next main 1.25 (colored) to selected 1.139 (colored)

pull up rev 1.28 from trunk (requested by erh):
  Avoid duplicate free() calls if a route's gateway points to itself,
  by marking a route down (~RTF_UP) _after_ calling RTFREE on its
  gateway.  Partial fix for PR#4561 and PR#4827 (the looped route can
  still occur, but it won't cause a panic).

Revision 1.29 / (download) - annotate - [select for diffs], Sat Oct 9 18:55:30 1999 UTC (24 years, 5 months ago) by sommerfeld
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, fvdl-softdep-base, fvdl-softdep, comdex-fall-1999-base, comdex-fall-1999
Branch point for: thorpej_scsipi
Changes since 1.28: +9 -15 lines
Diff to previous 1.28 (colored) to selected 1.139 (colored)

Fix PR7946 (neighbor discovery tries to block at interrupt level).
stack-allocate a sockaddr_storage for the temporary sockaddr rather
than putting it in an mbuf.

neighbor discovery wants to delete expired ifa's from a timeout
handler.  allowing rtinit(RTM_DELETE, ...) to run at interrupt level
allows this to work.
i think we can afford the extra ~128 bytes of stack depth ..

Revision 1.28 / (download) - annotate - [select for diffs], Sat Oct 9 08:13:00 1999 UTC (24 years, 5 months ago) by erh
Branch: MAIN
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored) to selected 1.139 (colored)

Delay clearing of RTF_UP until after deleting rt_gwroute.  Otherwise, if rt_gwroute is the same as the original route it will get freed twice.  It can end up the same because of unusual "route" commands (PR4561) or certain icmp redirects (PR4827).

Revision 1.27 / (download) - annotate - [select for diffs], Sat Aug 21 03:46:35 1999 UTC (24 years, 7 months ago) by matt
Branch: MAIN
Branch point for: wrstuden-devbsize
Changes since 1.26: +21 -5 lines
Diff to previous 1.26 (colored) to selected 1.139 (colored)

Cleanup a little kludge in mtu handling in route.c.  Bring down FDDI
mtu to legal IP max but don't affect other protocols.

Revision 1.24.4.2 / (download) - annotate - [select for diffs], Mon Aug 2 22:32:29 1999 UTC (24 years, 8 months ago) by thorpej
Branch: chs-ubc2
Changes since 1.24.4.1: +1 -13 lines
Diff to previous 1.24.4.1 (colored) to branchpoint 1.24 (colored) next main 1.25 (colored) to selected 1.139 (colored)

Update from trunk.

Revision 1.26 / (download) - annotate - [select for diffs], Fri Jul 30 10:35:39 1999 UTC (24 years, 8 months ago) by itojun
Branch: MAIN
CVS Tags: chs-ubc2-base
Changes since 1.25: +1 -13 lines
Diff to previous 1.25 (colored) to selected 1.139 (colored)

remove reference to in6_systm.h (file itself will be removed afterwords)

Revision 1.24.4.1 / (download) - annotate - [select for diffs], Thu Jul 1 23:45:20 1999 UTC (24 years, 9 months ago) by thorpej
Branch: chs-ubc2
Changes since 1.24: +51 -1 lines
Diff to previous 1.24 (colored) to selected 1.139 (colored)

Sync w/ -current.

Revision 1.25 / (download) - annotate - [select for diffs], Thu Jul 1 08:12:49 1999 UTC (24 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.24: +51 -1 lines
Diff to previous 1.24 (colored) to selected 1.139 (colored)

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.24.6.1 / (download) - annotate - [select for diffs], Mon Jun 28 06:36:57 1999 UTC (24 years, 9 months ago) by itojun
Branch: kame
CVS Tags: kame_14_19990705, kame_14_19990628
Changes since 1.24: +51 -1 lines
Diff to previous 1.24 (colored) to selected 1.139 (colored)

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.24 / (download) - annotate - [select for diffs], Sun Dec 27 18:27:48 1998 UTC (25 years, 3 months ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH001
Branch point for: netbsd-1-4, kame, chs-ubc2
Changes since 1.23: +46 -63 lines
Diff to previous 1.23 (colored) to selected 1.139 (colored)

Simplify the rttimer code somewhat; use TAILQs instead of CIRCLEQs (we
didn't really need to traverse the queues backwards anyhow), and other
minor code simplification.

Revision 1.23 / (download) - annotate - [select for diffs], Sun Dec 27 11:44:41 1998 UTC (25 years, 3 months ago) by veego
Branch: MAIN
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored) to selected 1.139 (colored)

Fix kern/6658 from Martin Husemann:
After booting a current kernel and receiving a few arp requests on the
network it panics (data modified on free list). The panic message is wrong,
as code inspection shows the memory pool for routing entries is intialized
twice, while the routing timer memory pool is never initialized.

Revision 1.22 / (download) - annotate - [select for diffs], Tue Dec 22 02:27:06 1998 UTC (25 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.21: +27 -13 lines
Diff to previous 1.21 (colored) to selected 1.139 (colored)

Use pools for rtentry and rttimer structures.

Revision 1.21.4.1 / (download) - annotate - [select for diffs], Fri Dec 11 04:53:06 1998 UTC (25 years, 3 months ago) by kenh
Branch: kenh-if-detach
Changes since 1.21: +31 -16 lines
Diff to previous 1.21 (colored) next main 1.22 (colored) to selected 1.139 (colored)

The beginnings of interface detach support.  Still some bugs, but mostly
works for me.

This work was originally by Bill Studenmund, and cleaned up by me.

Revision 1.21 / (download) - annotate - [select for diffs], Wed Oct 28 05:01:11 1998 UTC (25 years, 5 months ago) by kml
Branch: MAIN
CVS Tags: kenh-if-detach-base, chs-ubc-base, chs-ubc
Branch point for: kenh-if-detach
Changes since 1.20: +8 -5 lines
Diff to previous 1.20 (colored) to selected 1.139 (colored)

Add call to splsoftnet() in rt_timer_timer to avoid possible race
condition in deleting timer queue (PMTU) entries.

Revision 1.20 / (download) - annotate - [select for diffs], Sat Aug 15 03:17:21 1998 UTC (25 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored) to selected 1.139 (colored)

Explicitly dereference the route timer expiration function pointer.

Revision 1.19 / (download) - annotate - [select for diffs], Sun Jul 5 06:49:17 1998 UTC (25 years, 8 months ago) by jonathan
Branch: MAIN
CVS Tags: eeh-paddr_t-base, eeh-paddr_t
Changes since 1.18: +3 -1 lines
Diff to previous 1.18 (colored) to selected 1.139 (colored)

defopt NS, NSIP.

Revision 1.17.8.1 / (download) - annotate - [select for diffs], Sat May 9 03:32:59 1998 UTC (25 years, 10 months ago) by mycroft
Branch: netbsd-1-3
CVS Tags: netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002
Changes since 1.17: +227 -1 lines
Diff to previous 1.17 (colored) next main 1.18 (colored) to selected 1.139 (colored)

Pull up patch from kml.

Revision 1.18 / (download) - annotate - [select for diffs], Wed Apr 29 03:41:49 1998 UTC (25 years, 11 months ago) by kml
Branch: MAIN
Changes since 1.17: +227 -1 lines
Diff to previous 1.17 (colored) to selected 1.139 (colored)

Add generic route timeout functionality;  used by path MTU discovery code

Revision 1.1.1.3 / (download) - annotate - [select for diffs] (vendor branch), Sun Mar 1 02:13:23 1998 UTC (26 years, 1 month ago) by fvdl
Branch: WFJ-920714, CSRG
CVS Tags: lite-2
Changes since 1.1.1.2: +2 -2 lines
Diff to previous 1.1.1.2 (colored) to selected 1.139 (colored)

Import 4.4BSD-Lite2

Revision 1.1.1.2 / (download) - annotate - [select for diffs] (vendor branch), Sun Mar 1 02:10:10 1998 UTC (26 years, 1 month ago) by fvdl
Branch: WFJ-920714, CSRG
CVS Tags: lite-1, date-03-may-96
Changes since 1.1.1.1: +194 -163 lines
Diff to previous 1.1.1.1 (colored) to selected 1.139 (colored)

Import 4.4BSD-Lite for reference

Revision 1.17 / (download) - annotate - [select for diffs], Wed Apr 2 21:17:28 1997 UTC (27 years ago) by christos
Branch: MAIN
CVS Tags: thorpej-signal-base, thorpej-signal, netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH001, netbsd-1-3-BETA, marc-pcmcia-bp, marc-pcmcia-base, marc-pcmcia, bouyer-scsipi
Branch point for: netbsd-1-3
Changes since 1.16: +5 -4 lines
Diff to previous 1.16 (colored) to selected 1.139 (colored)

Sync with Lite2.

Revision 1.16 / (download) - annotate - [select for diffs], Sun Oct 13 02:11:10 1996 UTC (27 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: thorpej-setroot, mrg-vm-swap, is-newarp-before-merge, is-newarp-base, is-newarp
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored) to selected 1.139 (colored)

backout previous kprintf change

Revision 1.15 / (download) - annotate - [select for diffs], Thu Oct 10 22:59:55 1996 UTC (27 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.14: +4 -4 lines
Diff to previous 1.14 (colored) to selected 1.139 (colored)

- printf -> kprintf, sprintf -> ksprintf

Revision 1.14 / (download) - annotate - [select for diffs], Tue Feb 13 22:00:46 1996 UTC (28 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-PATCH001, netbsd-1-2-BETA, netbsd-1-2
Changes since 1.13: +6 -6 lines
Diff to previous 1.13 (colored) to selected 1.139 (colored)

Net prototypes

Revision 1.13 / (download) - annotate - [select for diffs], Sat Aug 12 23:59:25 1995 UTC (28 years, 7 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Changes since 1.12: +4 -4 lines
Diff to previous 1.12 (colored) to selected 1.139 (colored)

splnet --> splsoftnet

Revision 1.12 / (download) - annotate - [select for diffs], Wed Mar 8 02:57:11 1995 UTC (29 years ago) by cgd
Branch: MAIN
Changes since 1.11: +2 -3 lines
Diff to previous 1.11 (colored) to selected 1.139 (colored)

fixed sized types, where appropriate.  when casting pointers to
integers to do math on them, cast to long.  ioctl commands are
u_longs.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Jun 29 06:36:42 1994 UTC (29 years, 9 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-1-0-base, netbsd-1-0-RELEASE, netbsd-1-0-PATCH1, netbsd-1-0-PATCH06, netbsd-1-0-PATCH05, netbsd-1-0-PATCH04, netbsd-1-0-PATCH03, netbsd-1-0-PATCH02, netbsd-1-0-PATCH0, netbsd-1-0
Changes since 1.10: +3 -2 lines
Diff to previous 1.10 (colored) to selected 1.139 (colored)

New RCS ID's, take two.  they're more aesthecially pleasant, and use 'NetBSD'

Revision 1.10 / (download) - annotate - [select for diffs], Fri May 13 06:03:16 1994 UTC (29 years, 10 months ago) by mycroft
Branch: MAIN
Changes since 1.9: +158 -143 lines
Diff to previous 1.9 (colored) to selected 1.139 (colored)

Update to 4.4-Lite networking code, with a few local changes.

Revision 1.9 / (download) - annotate - [select for diffs], Wed May 11 09:26:49 1994 UTC (29 years, 10 months ago) by mycroft
Branch: MAIN
Changes since 1.8: +12 -4 lines
Diff to previous 1.8 (colored) to selected 1.139 (colored)

Update to RTM version 3.  Add prototypes.  Add some new constants which are
not used yet.

Revision 1.8 / (download) - annotate - [select for diffs], Wed Mar 23 05:05:03 1994 UTC (30 years ago) by cgd
Branch: MAIN
Changes since 1.7: +16 -9 lines
Diff to previous 1.7 (colored) to selected 1.139 (colored)

two reference count fixes, and minor cleanup (to offset the added goto! 8-).

Revision 1.7 / (download) - annotate - [select for diffs], Thu Feb 10 17:25:05 1994 UTC (30 years, 1 month ago) by mycroft
Branch: MAIN
Changes since 1.6: +1 -2 lines
Diff to previous 1.6 (colored) to selected 1.139 (colored)

Deprecate af.h.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Jan 16 02:22:56 1994 UTC (30 years, 2 months ago) by cgd
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored) to selected 1.139 (colored)

include <machine/cpu.h> not <machine/mtpr.h>

Revision 1.5 / (download) - annotate - [select for diffs], Sat Dec 18 00:41:03 1993 UTC (30 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.4: +20 -19 lines
Diff to previous 1.4 (colored) to selected 1.139 (colored)

Canonicalize all #includes.

Revision 1.4.4.3 / (download) - annotate - [select for diffs], Mon Nov 8 20:37:41 1993 UTC (30 years, 4 months ago) by mycroft
Branch: magnum
Changes since 1.4.4.2: +19 -20 lines
Diff to previous 1.4.4.2 (colored) to branchpoint 1.4 (colored) next main 1.5 (colored) to selected 1.139 (colored)

Remove references to af.h.

Revision 1.4.4.2 / (download) - annotate - [select for diffs], Sat Oct 16 10:49:32 1993 UTC (30 years, 5 months ago) by mycroft
Branch: magnum
Changes since 1.4.4.1: +1 -2 lines
Diff to previous 1.4.4.1 (colored) to branchpoint 1.4 (colored) to selected 1.139 (colored)

Nuke references to machine/mtpr.h.

Revision 1.4.4.1 / (download) - annotate - [select for diffs], Fri Sep 24 08:54:05 1993 UTC (30 years, 6 months ago) by mycroft
Branch: magnum
Changes since 1.4: +4 -2 lines
Diff to previous 1.4 (colored) to selected 1.139 (colored)

Make all files using spl*() #include cpu.h.  Changes from trunk.

Revision 1.4 / (download) - annotate - [select for diffs], Sat May 22 11:42:19 1993 UTC (30 years, 10 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-0-9-patch-001, netbsd-0-9-base, netbsd-0-9-RELEASE, netbsd-0-9-BETA, netbsd-0-9-ALPHA2, netbsd-0-9-ALPHA, netbsd-0-9, magnum-base
Branch point for: magnum
Changes since 1.3: +1 -2 lines
Diff to previous 1.3 (colored) to selected 1.139 (colored)

add include of select.h if necessary for protos, or delete if extraneous

Revision 1.3 / (download) - annotate - [select for diffs], Tue May 18 18:20:01 1993 UTC (30 years, 10 months ago) by cgd
Branch: MAIN
Changes since 1.2: +3 -9 lines
Diff to previous 1.2 (colored) to selected 1.139 (colored)

make kernel select interface be one-stop shopping & clean it all up.

Revision 1.2 / (download) - annotate - [select for diffs], Sun Mar 21 18:04:42 1993 UTC (31 years ago) by cgd
Branch: MAIN
CVS Tags: patchkit-0-2-2, netbsd-alpha-1, netbsd-0-8
Changes since 1.1: +10 -1 lines
Diff to previous 1.1 (colored) to selected 1.139 (colored)

after 0.2.2 "stable" patches applied

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Sun Mar 21 09:45:37 1993 UTC (31 years ago) by cgd
Branch: WFJ-920714, CSRG
CVS Tags: WFJ-386bsd-01
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored) to selected 1.139 (colored)

initial import of 386bsd-0.1 sources

Revision 1.1 / (download) - annotate - [select for diffs], Sun Mar 21 09:45:37 1993 UTC (31 years ago) by cgd
Branch: MAIN
Diff to selected 1.139 (colored)

Initial revision

This form allows you to request diff's 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.




CVSweb <webmaster@jp.NetBSD.org>