Age | Commit message (Collapse) | Author |
|
rtable_walk(9) now passes a routing entry back to the caller when
a non zero value is returned and if it asked for it.
This allows us to call rtdeletemsg()/rtrequest_delete() from the
caller without creating a recursion because of rtflushclone().
Multicast code hasn't been adapted and is still possibly creating
recursions. However multicast route entries aren't cloned so if
a recursion exists it isn't because of rtflushclone().
Fix stack exhaustion triggered by the use of "-msave-args".
Issue reported by Dániel Lévai on bugs@ confirmed by and ok bluhm@.
|
|
ok claudio@ deraadt@
Reported-by: syzbot+8e29400e09a351f17884@syzkaller.appspotmail.com
|
|
the network mask. This saves converting the prefixlen to a mask and back.
OK phessler@, benno@
|
|
that the mask is contiguous and not longer then the prefixlen is not
bigger then the maximum. Make the function behave a bit more like the
similar netmask handling code in the old patricia codebase.
Fixes a problem reyk@ reported regarding IPv6 masks and the fact that
sin6_scope_id is after sin6_addr.
OK mpi@
|
|
It was used by the original patricia tree.
OK mpi@
|
|
ok bluhm
|
|
ok jmatthew@
|
|
no entry are missed.
While here do not re-ordered or send messages for route entries that are
already in the expected state.
Make rttest30 pass.
ok gerhard@
|
|
OK mpi
|
|
Prompted by a bugreport by naddy that IPv6 autoconfiguration is broken
in the installer.
OK mpi, "go for it" deraadt
|
|
entry on the multipath list.
Fix a NULL dereference triggered by a CPU doing a lookup when another one
is updating the priorities of some routes. By not doing a remove/insert
we ensure that ``an_rtlist'' is never empty and do not need a conditional
in the fast path.
Problem reported by and ok markus@
|
|
If an ART node is linked to multiple route entries, in the MPATH case,
it is not safe to dereference ``an_dst''. This non-refcounted pointer
can be changed at any time by another CPU.
So get rid of the pointer and use the first destination of a route entry
when comparing sockaddrs.
This allows us so remove a pointer from 'struct art_node' and save 5Mb of
memory in an IPv4 fullfeed.
ok jmatthew@, claudio@, dlg@
|
|
rectification.
|
|
ok dlg@, jmatthew@
|
|
This allows us to introduce SRPL_NEXT() that can be used to start
iterating on an arbitrary member of an srp list, hence without calling
SRPL_ENTER().
ok dlg@, jmatthew@
|
|
In order to stop abusing lo0 for all rdomains, a new loopback interface
will be created every time a rdomain is created. The unit number will
be the same as the rdomain, i.e. lo1 will be attached to rdomain 1.
If this loopback interface is already in use it wont be possible to create
the corresponding rdomain.
In order to know which lo(4) interface is attached to a rdomain, its index
is stored in the rtable/rdomain map.
This is a long overdue since the introduction of rtable/rdomain. It also
fixes a recent regression due to resetting the rdomain of an incoming
packet reported by semarie@, Andreas Bartelt and Nils Frohberg.
ok claudio@
|
|
This code insn't used since ART is the default.
ok vgross@
|
|
reference count.
rtable_iterate() frees the passed ``rt'' and returns the next one on the
multipath list or NULL if there's none.
ok dlg@
|
|
taking the kernel lock.
ok mpi@ dlg@
|
|
function has been fixed.
Functions passed to rtable_walk() must return EAGAIN if they delete an
entry from the tree, no matter if it is a leaf or not.
|
|
prevent an off-by-one when removing entries from the mpath list.
Fix a regression introduced by the refactoring needed to serialize
rtable_walk() with create/delete.
ok jca@
|
|
art_walk now explicitly takes the same lock used to serialise change
made via rtable_insert and _delete, so it can safely adjust the
refcnts on tables while it recurses into them. they need to still
exist when returning out of the recursion.
it uses srps to access nodes and drops the lock before calling the
callback function. this is because some callbacks sleep (eg, copyout
in the sysctl code that dumps an rtable to userland), which you
shouldnt hold a lock accross. other callbacks attempt to modify
the rtable (eg, marking routes as down when then interface theyre
on goes down), which tries to take the lock again, which probably
wont work in the future.
ok jmatthew@ mpi@
|
|
art_lookup and art_match now return an active srp_ref, which the caller must
leave when it's done with the returned route (if any). This allows lookups
to be done without holding any locks.
The art_table and art_node garbage collectors are still responsible for
freeing items removed from the routing table, so they now use srp_finalize
to wait out any active references, and updates are done using srp_swap
operations.
ok dlg@ mpi@
|
|
ok mglocker
|
|
this makes the node usable as soon as it is in the tree, rather
than after it inserts the rtentry on the node.
ok mpi@
|
|
operations cant drop the refcount to 0.
ok mpi@
|
|
ok mpi@
|
|
the srp_ref struct is used to track the location of the callers
hazard pointer so later calls to srp_follow and srp_enter already
know what to clear. this in turn means most of the caveats around
using srps go away. specifically, you can now:
- switch cpus while holding an srp ref
- ie, you can sleep while holding an srp ref
- you can take and release srp refs in any order
the original intent was to simplify use of the api when dealing
with complicated data structures. the caller now no longer has to
track the location of the srp a value was fetched from, the srp_ref
effectively does that for you.
srp lists have been refactored to use srp_refs instead of srpl_iter
structs.
this is in preparation of using srps inside the ART code. ART is a
complicated data structure, and lookups require overlapping holds
of srp references.
ok mpi@ jmatthew@
|
|
callbacks return EAGAIN if they modify the routing table. While we're here,
simplify life for rtable_walk callers by moving the loop that restarts the
walk on EAGAIN into rtable_walk itself.
Flushing cloned routes on interface state changes becomes a bit more
inefficient, but this can be improved later.
ok mpi@ dlg@
|
|
ok jmatthew@
|
|
hash routine.
Bug reported and fix analysed by Jean-Daniel Dupas <jddupas AT xooloo DOT net>
ok deraadt@
|
|
offset of the address in the sockaddr to initialize the stride lengths.
|
|
entry.
This pointer hasn't been used for some time and without it no external
reference count is needed to turn art_lookup() mpsafe.
|
|
use ``rt_node'' with ART.
|
|
This allow us to get rid of one more "rt_node" usage with ART.
ok jmatthew@
|
|
Reported by bluhm@, ok jmatthew@
|
|
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@
|
|
OK 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@
|
|
to a SRP list.
This turns the rtable_* layer mpsafe. We now only need to protect the
ART implementation itself.
Note that route(8) regress tests will now fail due to a supplementary
reference taken by the SRPL_INIT(9) API.
ok dlg@
|
|
and kill rtable_put() because we're not going to use it.
The overhead of keeping a "struct art_root/radix_node_head" around is
very small compared to the added complexity needed to reference count
such structures.
|
|
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@
|
|
While here initialize pools in art_init().
|
|
pool(9) to not waste most of the memory allocated.
This reduces the memory overhead of our ART routing table from 80M
to 70M compared to the existing radix-tree when loading ~550K IPv4
routes.
ART can now be used for huge tables without exhausting malloc(9)'s
limit.
claudio@ agrees with the direction, inputs from and ok dlg@
|
|
exhaustion.
Reported by benno@ and found thanks to his bgpd(8) test setup.
|
|
implementation for ART based on the singly-linked list of route
entries.
|
|
|
|
does not find a matching node.
This currently never happens because we always do a route lookup before
calling rtable_delete(). Yes this is odd & due to the way multipath is
implemented in the radix tree.
|