Age | Commit message (Collapse) | Author |
|
OK claudio@, henning@
|
|
Requested by and OK mpi@
|
|
|
|
This means that no protection is needed to guarantee that the next hop
route wont be modified by CPU1 while CPU0 is dereferencing it in a L2
resolution functions.
While here also fix an ``ifa'' leak resulting in RTF_GATEWAY being always
invalid.
dlg@ likes it, inputs and ok bluhm@
|
|
instead of abusing RTF_CLONING.
Fix a leak reporeted by Aaron Riekenberg on misc@, ok sthen@
|
|
to create and change the dynamic route. This behavior was introduced
in net/route.c rev 1.269 when the gateway route allocation was moved
from rt_setgateway() to _rtalloc(). So rtrequest(RTM_ADD) could
return a route without a valid gateway route. To fix this, call
rt_setgwroute() from _rtalloc() and rt_setgateway().
OK mpi@
|
|
Being able to add route entries without configured addresses is a nice
feature but this is not my fight. So I'd rather no add another pointer
to ``struct rtentry'' if I'm not removing another one.
|
|
``rt->rt_ifa'' later.
|
|
memory.
This will allow to unlink 'sruct rtentry' and 'struct ifaddr' to be able
to add route entries without needing an address.
ok sthen@, visa@, florian@
|
|
time_second is unix time so it can be affected by clock changes.
time_uptime is monotonic so it isnt affected by clock changes. that
in turn means route expiries wont jump with clock changes if set
against time_uptime.
the expiry is translated into unix time for export to userland though.
ok mpi@
|
|
Since the rtalloc(9) rewrite no route lookup is done in this function so
there's no need for a destination or a rtable ID.
|
|
Since mpath is not enabled in RAMDISK, proxy ARP won't work there either.
ok bluhm@
|
|
From Florian Riehm, ok bluhm@
|
|
hash routine.
Bug reported and fix analysed by Jean-Daniel Dupas <jddupas AT xooloo DOT net>
ok deraadt@
|
|
entry.
This pointer hasn't been used for some time and without it no external
reference count is needed to turn art_lookup() mpsafe.
|
|
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@
|
|
fallback to a SLIST.
ok dlg@, jasper@
|
|
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@
|
|
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@
|
|
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@
|
|
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@
|
|
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
|
|
implementation for ART based on the singly-linked list of route
entries.
|
|
|
|
OK mpi@
|
|
function to take an interface index.
discussed with mpi@; OK claudio@
|
|
getting rid of interface pointers in route entries.
ok bluhm@
|
|
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@
|
|
ok deraadt@
|
|
ok sthen@, claudio@
|
|
entry.
ok bluhm@, claudio@
|
|
can be used or should be released by rtfree(9).
It currently checks if the route is UP and is not attached to a stall
ifa.
ok bluhm@, claudio@
|
|
ART implementation.
ART (Allotment Routing Table) is a multibit-trie algorithm invented by
D. Knuth while reviewing Yoichi's SMART [0] (Smart Multi-Array Routing
Table) paper.
This implementation, unlike the one from the KAME project, supports
variable stride lengths which makes it easier to adapt the consumed
memory/speed trade-off. It also let you use a bigger first-level
table, what other algorithms such as POPTRIE [1] need to implement
separately.
Adaptation to the OpenBSD kernel has been done with two different data
structures. ART nodes and route entries are managed separately which
makes the algorithm implementation free of any MULTIPATH logic.
This implementation does not include Path Compression.
[0] http://www.hariguchi.org/art/smart.pdf
[1] http://conferences.sigcomm.org/sigcomm/2015/pdf/papers/p57.pdf
ok dlg@, reyk@
|
|
Code abusing the radix internals for the routing table should now
includes <net/rtable.h> and only deal with "struct rtentry".
Code using a radix tree for another purpose can still include
<net/radix.h>.
Inputs from and ok claudio@, mikeb@
|
|
Recent changes to support multiple interface routes broke the
assumption made by all our userland routing daemons concerning
interface routes. Historically such routes had a "gateway"
sockaddr of type AF_LINK. But to be able to support multiple
interface routes as any other multipath routes, they now have
a unique "gateway" sockaddr containing their corresponding IP
address.
This self-describing flag should avoid ambiguity when dealing
with interface routes.
Issue reported by <mxb AT alumni DOT chalmers DOT se> and benno@
ok claudio@, benno@
|
|
Note that current code is safe because an explicit check exists
in route_output().
Pointed out by claudio@ while reviewing another diff.
|
|
This makes ND6 and ARP layers happy since they both check for this flag,
but is was redundant to provide route(8)'s "-llinfo" option when adding
a l2 route.
RTF_LLINFO is clearly redundant for userland tools, so only allow the
kernel to set it.
ok benno@, claudio@
|
|
of memory.
The key (destination) is only set once, when the route is inserted in
the routing table, and does not need to change afterward. The gateway
might change and rt_setgate() will do all the checks for you.
ok claudio@
|
|
route created/deleted with rt_ifa_add(9)/rt_ifa_del(9), not only for
RTF_LOCAL routes.
Regression introduced in r1.172 when restoring the original behavior
of RTM_NEWADDR/RTM_RTM_DELADDR reported by Florian Riehm.
Joint work with Florian Riehm, with input from and ok bluhm@.
|
|
such that there's no size change on, at least, amd64.
This will allow us to simplify some APIs and deprecate the remaining
flavors of "struct route".
ok claudio@, phessler@
|
|
for the validity of a given outgoing route entry into a single function.
This change is inspired from FreeBSD r111767. The function introduced
here, rt_checkgate(), should hopefully die in a near future. Why should
it die? Well, it is way too late to do such validity checks: if your
kernel can ends up in ether_output() with an invalid route, please do
not let it try to find a new one that might do the job.
Go read this function if you're wondering why you're getting messages
like:
"arpresolve: X.X.X.X: route without link local address"
Since this horrible logic has survived 20 years of copy & past and small
modifications for workarounds without a single clear commit message, let's
assume it is full of dragons and try to play safe. This factorization is
not intended to change any behavior.
With much inputs from bluhm@, tested by weerd@ and florian@ on setups
with p2p IPv6 interfaces.
ok bluhm@, benno@, florian@
|
|
error code on failure (unchecked for the moment).
ok mikeb@, jmc@
|
|
functionnality instead of a mix of enable/disable.
ok bluhm@, jca@
|
|
kill the macro.
ok mikeb@, henning@
|
|
ok henning@, phessler@
|
|
rely on "struct route" that should die.
ok claudio@
|
|
|