Age | Commit message (Collapse) | Author |
|
ok mpi@ millert@
|
|
a regression introduced during 5.7 and 5.8 as reported by Jean-Daniel
Dupas on misc@
diff provided by mpi, ok claudio
|
|
hash routine.
Bug reported and fix analysed by Jean-Daniel Dupas <jddupas AT xooloo DOT net>
ok deraadt@
|
|
use ``rt_node'' with ART.
|
|
ok visa@
|
|
exist and we get another matching one instead.
This bug has been here since the KAME area and recently exposed by a
refactoring at n2k15. The problem is that rtrequest(9) does not check
on which interface the route entry is attached when issuing a RTM_DELETE.
So the kernel would end up deleting the route attached on a different ifp
when in_ifinit() fails.
This fix is currently a workaround, a better fix is in the pipeline.
Reported by Laurence Tratt <laurie AT tratt DOT net>, thanks!
|
|
RTF_CLONED routes attached.
In thise case if_get(9) can return NULL inside rtflushclone1() because
ifdetach() starts by clearing the interface pointer in the index map.
So it is perfectly correct to bail and we're not going to leak any route
entry because we're garbage collecting all of them.
Reported by daniel@ and Aaron Miller <aaron DOT miller04 AT gmail DOT com>
|
|
|
|
ok claudio@
|
|
route entry in ART.
rt_plen() now represents the prefix length of a route entry and should
be used instead.
For now use a "struct sockaddr_in6" to represent the mask when needed,
this should be then replaced by the prefix length and RTA_NETMASK only
used for compatibility with userland.
ok claudio@
|
|
required.
ok bluhm@ mpi@.
|
|
This reduces the size of the structure by 8 bytes on amd64 now that
we are using an index instead of a pointer for reaching interfaces.
|
|
These indexes are unique and should be used with if_get() to get a
pointer to the corresponding ``ifp''. Such pointer is guaranteed to
be valid in a MP environment until if_put() is called.
ok claudio@, sthen@
|
|
OK mpi@
|
|
are not used anymore. This has to be done before any interface
fields become invalid.
As the route delete request cannot call if_get() anymore, pass down
the interface. Split rtrequest_delete() into a separate function
that may take an existing inteface.
OK mpi@
|
|
for failed route lookups. This is something that was maybe useful in the
90is but in this modern times it is just annoying and nothing expect it
anyway. OK mpi@, sthen@
|
|
ok claudio@, mpi@
|
|
This will helps for unlocking the routing table and will prevent further
mistake by keeping the multipath logic inside the rtable_* API.
ok dlg@, claudio@
|
|
ok bluhm@
|
|
with SRPs.
This is a simplified version of the dynamically sizeable array of
pointers used by if_get() because routing table heads are never
freed.
ok dlg@
|
|
This has been masked because <sys/srp.h> is pulled unconditionally.
ok dlg@
|
|
ifidx uninitialised for the gateway not directly reachable case.
ok mpi@
|
|
This only happens under KERNEL_LOCK() so we know for sure that the
interface attached to a route entry is valid.
|
|
fixed.
ok sthen@, dlg@
|
|
Fix a regression introduced by rtalloc(9) rewrite where only the
first route of a multipath chain had a valid next hop and could
be used.
ok sthen@, dlg@
|
|
When multiple gateways are in use, the next-hop entrie might not be
on the same interface. This is due to the fact that ARP entries are
unique and attached to their cloning interface.
Found the hard way by and ok dlg@
|
|
as rt_ifa->ifa_ifp.
|
|
hop route as invalid.
Previously when such entrie was returned by rtalloc(9) a second route
lookup was done in rt_checkgate() very late in the journey of a packet.
In other words a single rtalloc(9) call can now result in multiple
route lookups if a RTF_GATEWAY entry is returned.
This is a step towards always calling L2 output functions with valid
destination information.
Tested by various including jmc@, naddy@, Hrvoje Popovski
|
|
|
|
ok bluhm@
|
|
OK mpi@
|
|
|
|
ok claudio@
|
|
ok claudio@
|
|
L2 resolution depends on the protocol (encoded in the route entry) and
an ``ifp''. Not having to care about an ``ifa'' makes our life easier
in our MP effort. Fewer dependencies between data structures implies
fewer headaches.
Discussed with bluhm@, ok claudio@
|
|
function to take an interface index.
discussed with mpi@; OK claudio@
|
|
ok bluhm@
|
|
This allows us to only grab the KERNEL_LOCK when the last reference
of an entry has been dropped.
For symmetry also grab the KERNEL_LOCK inside rtalloc(9).
ok dlg@, bluhm@
|
|
ok bluhm@, dlg@, claudio@
|
|
ok millert@, bluhm@
|
|
ok bluhm@
|
|
Instead of casts they check wether the incoming object has the
expected type. So introduce satosdl() and sdltosa() in the kernel.
OK mpi@
|
|
|
|
simply use it.
In most of the cases doing a route lookup at this point is a noop as
it will return you the same DOWN entry you already have.
The exception is the case where the route has been removed from tree
since your kernel looked for it. So what? It's just a blue packet.
Note that this "exception" can only happen if your sending path does
not run under the KERNEL_LOCK.
ok mikeb@
|
|
While here check for RTF_CLONED insted of RTM_RESOLVE when adding an
entry.
Found while debugging naddy@'s NFS vs em(4) vs rtisvalid(9) issue.
|
|
turning rtable_get(9) MP-safe.
Use only one per-AF array, as suggested by claudio@, pointing to an
array of pointers to the routing table heads.
Routing tables are now allocated/initialized per-AF. This will let
us allocate routing table on-demand instead of always having an
AF_INET, AF_MPLS and AF_INET table as soon as a new rtableID is used.
This also get rid of the "void ***" madness.
ok dlg@, jmatthew@
|
|
This is required to maintain the original BSD behavior of locally
configured addresses being always reacheable.
Some interfaces are^w^W^Wem(4) is special and generally has a DOWN
link state when configured by netstart(8). As a result all the
route entries cloned/added before its link state goes to UP are also
marked as DOWN.
Note that this problem was not present when local addresses were
attached to lo0.
ok mikeb@
|
|
The routing table is not an optional component of the network stack
and initializing it inside the "routing domain" requires some ugly
introspection in the domain interface.
This put the rtable* layer at the same level of the if* level. These
two subsystem are organized around the two global data structure used
in the network stack:
- the global &ifnet list, to be used in process context only, and
- the routing table which can be read in interrupt context.
This change makes the rtable_* layer domain-aware and extends the
"struct domain" such that INET, INET6 and MPLS can specify the length
of the binary key used in lookups. This allows us to keep, or move
towards, AF-free route and rtable layers.
While here stop the madness and pass the size of the maximum key length
in *byte* to rn_inithead0().
ok claudio@, mikeb@
|
|
|
|
rtable_insert().
inputs and ok bluhm@
|