summaryrefslogtreecommitdiffstats
path: root/sys/net/radix_mpath.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use the radix API directly and get rid of the function pointers. Therempi2015-10-081-3/+3
| | | | | | is no point in keeping an unused level of abstraction. ok mikeb@, claudio@
* Factors ou the route hashing code to implement Equal-Cost Multi-Pathmpi2015-09-281-115/+1
| | | | | | | | for ART. While here sync the two remaining mix() macros. ok chris@, dlg@
* Replace sockaddr casts with the proper satosin(), ... calls.bluhm2015-09-011-3/+3
| | | | From David Hill; OK mpi@; tested kspillner@; tweaks bluhm@
* Abstract the routing table internals behind an rtable_* API.mpi2015-07-181-23/+4
| | | | | | | | | | 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@
* Fix rn_match and there for the expoerted lookup functions in radix.cclaudio2015-07-161-2/+2
| | | | | | to never return the internal RNF_ROOT nodes. This removes the checks in the callee to verify that not an RNF_ROOT node was returned. OK mpi@
* Make sure that rn_mpath_adj_mpflag() is called with the correct pointerclaudio2015-03-041-1/+4
| | | | | | | to the multipath chain when removing routes. This fixes the sbin/route testcases 17-19 and fixes an annoying opsfd bug because of routes wrongly marked as multipath ones. OK deraadt, mpi, sthen, benno, phessler
* Change rt_mpath_conflict() to not rely on an initialized rtentry whenmpi2015-02-061-10/+9
| | | | | | checking for actual conflict. ok claudio@, henning@
* unifdef INET in net code as a precursor to removing the pretend option.tedu2014-12-191-9/+1
| | | | | long live the one true internet. ok henning mikeb
* move arc4random prototype to systm.h. more appropriate for most codetedu2014-11-181-2/+1
| | | | to include that than rdnvar.h. ok deraadt dlg
* Rename rtalloc1() into rtalloc(9) and convert its flags to only enablempi2014-11-011-2/+2
| | | | | | functionnality instead of a mix of enable/disable. ok bluhm@, jca@
* Kill rtalloc() and update rtalloc1() and rtalloc_mpath() to no longermpi2014-09-271-28/+24
| | | | | | rely on "struct route" that should die. ok claudio@
* Big refactoring of the radix code (mainly rn_addroute but also partclaudio2014-05-271-156/+169
| | | | | | | | of rn_delete was changed). The mpath code gets a much better rn_mpath_next() function that allows looping through the dupedkey list based on prio, any or only active routes. This solves the issues seen with failed deletes of down routes. Commit this now so that it gets tested. Both sthen@ and blambert@ agree.
* Kill the RN_DEBUG code it is broken since rev 1.1 and not worth fixing.claudio2014-01-221-14/+1
| | | | OK mpi@ and krw@
* Rename rn_mpath_count() to rn_mpath_active_count() since it will onlyclaudio2013-10-201-4/+4
| | | | return the number of active aka RTF_UP multipath routes. OK grep & gcc
* In rt_mpath_conflict() there is no need to check the priority in the loopclaudio2013-10-201-5/+1
| | | | | | since rt_mpath_prio() and rt_mpath_next() ensure that this is always the case. OK henning@
* Remove various external variable declaration from sources files andmpi2013-04-101-3/+6
| | | | | | | move them to the corresponding header with an appropriate comment if necessary. ok guenther@
* Start cleaning up the mess called rtalloc*. Kill rtalloc2, make rtalloc1claudio2010-05-071-3/+3
| | | | | | | | accept flags for report and nocloning. Move the rtableid into struct route (with a minor twist for now) and make a few more codepathes rdomain aware. Appart from the pf.c and route.c bits the diff is mostly mechanical. More to come... OK michele, henning
* Make sure rt_gateway is not NULL in rt_mpath_matchgate(). It is possible toclaudio2009-03-021-2/+3
| | | | | hit this case with a root node that comes with no real rtentry attached to it. Problem found by Mischa Diehm, OK henning@
* Fix a crash found by bluhm@ in rn_mpath_reprio(). The rn_mklist handling wasclaudio2009-01-291-7/+7
| | | | | | wrong which resulted in a NULL rm_leaf which caussed a NULL deref a bit later. Check against the right route nodes to figure out if the rm_leaf needs to be updated. Tested by bluhm@, OK dlg@
* Change the way way rn_mklists work (especially the RNF_NORMAL ones).claudio2009-01-061-7/+30
| | | | | | | | | | | | Until now RNF_NORMAL masks did not use the refcount because only one route in a particular subtree could have this mask. With multipath routing this is no longer correct. The result was wrong backtracking information beeing stored in the radix tree and so cretain lookups ended up on the wrong multipath nodes. Use rm_refs for RNF_NORMAL masks so that all multipath routes are able to point to the same radix_mask entry. Additional logic ensures that rm_leaf always points back to the head of the multipath rn_dupedkey chain. Tested by dlg@, gollo@, david@, sthen@ and a few more This can have my OK dlg@
* Use rn_mpath_next() in rtalloc_mpath() to figure out if the next routeclaudio2008-12-291-2/+2
| | | | | | belongs to the same multipath group instead of own wrong check which failed to look at the priority. Found and diff tested by gollo@
* Implement link-state tracking on the routing table. Routes to interfacesclaudio2008-11-241-1/+102
| | | | | | | | which are considered down will no be marked ~RTF_UP and so multipath routing will start to work as expected and not pump 50% of the traffic to nirvana. Most of the magic happens in rn_mpath_reprio() which fiddles with the routing table internals. The rest is more straight forward. get it in deraadt@
* Change rn_mpath_next() to be able to walk over the full multipath listclaudio2008-11-211-22/+21
| | | | | | | not only over routes of the same prio. This makes it possible to modify rt_mpath_matchgate() so that if only gateway is specified without a specific priority it will scan the full list and not only the first routes. This is also needed for upcoming link state tracking.
* Implement routing priorities. Every route inserted has a priority assignedclaudio2008-05-071-5/+44
| | | | | | | | | and the one route with the lowest number wins. This will be used by the routing daemons to resolve the synchronisations issue in case of conflicts. The nasty bits of this are in the multipath code. If no priority is specified the kernel will choose an appropriate priority. Looked at by a few people at n2k8 code is much older
* Redo rev 1.8 but this time with an additional fix to solve the dhclient crashesclaudio2008-05-071-8/+8
| | | | | | | seen by krw. This is a prerequisite for upcomming routing priorities: Always compare the nexthop if one is specified even if it is a non-multipath route. This mostly affects "route delete" and it will not remove the last route if previous delete is redone. OK henning@
* Revert change which seems to break things like dhclient. Requested bykrw2007-12-051-8/+8
| | | | deraadt@.
* Always compare the nexthop if one is specified even if it is a non-multipathclaudio2007-12-041-8/+8
| | | | | route. This mostly affects "route delete" and it will not remove the last route if previous delete is redone. OK henning@
* Whitespace, oops.pascoe2006-06-181-2/+2
|
* Add support for equal-cost multipath IP.pascoe2006-06-181-18/+110
| | | | | | | | | | | | | | To minimise path disruptions, this implements recommendations made in RFC2992 - the hash-threshold mechanism to select paths based on source/destination IP address pairs, and inserts multipath routes in the middle of the route table. To enable multipath distribution, use: sysctl net.inet.ip.multipath=1 and/or: sysctl net.inet6.ip6.multipath=1 testing norby@ ok claudio@ henning@ hshoexer@
* adjust functions dealing with the routing table to take a table ID ashenning2006-06-161-3/+3
| | | | | | parameter so they can work on alternate tables. table 0 hardcoded for many callers yet, that will be adapted step by step. input + ok claudio norby hshoexer
* typohenning2005-05-151-2/+2
|
* ANSI, mostly from Toni Mueller <openbsd-tech@oeko.net>henning2005-05-151-21/+9
|
* require RTF_MPATH to enter a multipath route with RTM_ADD.cedric2004-06-191-3/+6
| | | | | route(8) takes a new -mpath modifier to enter a multipath route. requested deraadt@, ok itojun@ mcbride@ millert@
* radix tree with multipath support. from kame. deraadt okitojun2004-04-251-0/+274
user visible changes: - you can add multiple routes with same key (route add A B then route add A C) - you have to specify gateway address if there are multiple entries on the table (route delete A B, instead of route delete A) kernel change: - radix_node_head has an extra entry - rnh_deladdr takes extra argument TODO: - actually take advantage of multipath (rtalloc -> rtalloc_mpath)