summaryrefslogtreecommitdiff
path: root/sys/net/route.c
AgeCommit message (Collapse)Author
2006-06-19Unbreak the tree. The code to set and unset the RTF_MPATH bit on all multipathClaudio Jeker
routes did not carefully check if the route lookup succeded or not and so rn_mpath_next(rn) blowed up because rn was NULL. Check if rnh_lookup succeded before touching rn in anyway. OK norby@ initial diff by hshoexer@
2006-06-17When multipath routes are inserted, ensure that RTF_MPATH is set for anyChristopher Pascoe
previous route that may not have been inserted with the -mpath flag. Similarly, when removing a multipath route and leaving only one route, clear the RTF_MPATH flag so this is clear. ok claudio@
2006-06-16adjust functions dealing with the routing table to take a table ID asHenning Brauer
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
2006-06-15put the multiple routing tables support back in, fixed.Henning Brauer
problem before: with this, we are no longer using the address family as array index directly, since only 3 of 31 address fanilies actually attach a table, but we're using an address family to array index translation (just another array). there, 0 meant "does not attach a table", thus rt_gettable has to return a null pointer. unfortunately we were using array index 0 for whatever af attaches first, and since the list is backwards,, that used to be ipsec - execpt on ipsec-less ramdisks, where it was inet6, and since route show blindly iterates over all address families, and all those without a table pointed to index 0, we got 28 or 29 copies of the v6 table. i had that right initally, and then i borked it later... re-spotted by claudio. ok norby hshoexer claudio
2006-06-06back out multiple routing table diffs (3 of 'em) because this makesTheo de Raadt
'route show' dump out repeated copies of the v6 routing table on ramdisks. on some architectures it spins forever doing this, on others it just goes for a long time printing the v6 routes over and over before terminating. spotted by jmc and krw, backout diff tested by beck.
2006-06-01use the table ID as array index directly, faster in the forwarding pathHenning Brauer
we trade higher memory consumption if the user doesn't use continous table IDs, but in the worst case (table IDs 0 and 255, 64bit machine) that is 2KB ok claudio ryan
2006-05-31add comment indictation that rtable_add must be called at splsoftnetHenning Brauer
2006-05-31move us to multiple routing table heads.Henning Brauer
-instead of staticaly declaring the heads, allocate memory for them -add second dimension to the routing table head array, table ID -space saver: do not use the AF as array index directly, but have an AF->index translation array and only account for AFs actually attaching a routing table note that whil ethat allows for multiple routing table heads, nothing uses taht yet. tested by many, ok claudio reyk norby mcbride
2006-05-20don't panic if the address familiy is not found in the rt_tablesReyk Floeter
ok henning@
2006-04-26Missed the goto in the error path. This resulted in an access to a NULLClaudio Jeker
pointer and a panic later on. Be more careful Claudio! OK henning@
2006-04-22Routes announced via rt_missmsg() do not have rtm_index set. While in mostClaudio Jeker
cases harmless it is used by the IPv6 code. The result is that bgpd is unable to assigning link local addresses to the correct interface. OK henning@ Fix for PR 5063.
2006-03-22prevent anything outside rote.c from accessing the routing table headsHenning Brauer
directly. rather provide a rt_lookup function for regular lookups, and a rt_gettable for those that need access to the head for some reason. the latter cases should be revisted later probably so that nothing outside the routing core code accesses the heads at all... tested claudio jolan me, ok claudio markus
2006-03-20introduce rt_if_remove which takes care of routing table updates for anHenning Brauer
interface that is removed. use that from if.c and if_tun.c instead of re-implementing in the latter case. ok claudio
2006-03-06get rid of questionable macro gore.Henning Brauer
a 200+ lines diff, but no binary change.
2006-03-06change a questionable multi-level foo ? a : b construct into readableHenning Brauer
code. no binary change.
2006-03-06more cleanup, again no binary change.Henning Brauer
as the previous changes from a train ride to frankfurt a bit over a week ago
2006-03-06cvhange a KASSERT into a if() .. panic() construct so the binary doesn'tHenning Brauer
change every time a line is added or removed. no functional change.
2006-03-06KNF, cleanup etc, no binary changeHenning Brauer
2006-02-01Initialize rmx_expire in rt_timer_add() so that dynamic routes (e.g. PMTU)Claudio Jeker
show a correct expire time in route(8). OK and idea mpf@ looks good henning@
2005-11-29something in the eurobsdcon route-a-thon broke my simple home networkJolan Luff
router so back out the routing stuff to pre-eurobsdcon where my machine doesn't crash immediately. i am happy to test diffs and report success/failures but i am not happy to have instantaneous crashes when i reboot with a new kernel that was compiled from pristine sources. if you are going to be an elitist asshole then you could at least make sure your code works. ok and "be crass towards them" deraadt@
2005-11-28more breakageMarkus Friedl
2005-11-28unbreak route deletion (from revision 1.55; obviously too much eyebleeding)Markus Friedl
2005-11-27don't let anything outside route.c access the routing table heads directly,Henning Brauer
but go through a provided wrapper. also provide rt_lookup() instead of doing the lookup manually in many places. ryan ok
2005-11-25move the code to delete routes having a specific interface as outputHenning Brauer
when the interface is deleted to a function in route.c, and replace the copies of that code by calls to that function from basel almost-hackathon
2005-11-25KNFHenning Brauer
2005-11-25reduce eyebleeding, since we only borrow the code from our childrenHenning Brauer
2005-11-25How can we dance when our humppa is feedingHenning Brauer
How do we code while our eyes are bleeding
2005-06-08kill some leftover bits from netns and iso routingHenning Brauer
2005-06-08in rtlabel_name2id, handle the case of an empty name: return 0Henning Brauer
label id 0 means "no label". in pf_ioctl, where this is used to filter based on a label, this is an error condition. for the other 2 cases, messages on the routing socket, this allows for an sockaddr_rtlabel to be always present for messages on the routing socket, and when it is all zero it is exactly like if there was no sockaddr_rtlabel at all. ryan ok
2005-06-07introduce a default "external" interface group, containing the interface(s)Henning Brauer
the the default route(s) point to. handles IPv4 and IPv6 as well as multipath routes. follows default route changes, of course. eases writing pf rulesets especially on laptops etc. that use different interfaces depending on the environment (wired, wireless, ...) ok theo ryan
2005-05-15ANSI, mostly from Toni Mueller <openbsd-tech@oeko.net>Henning Brauer
2004-09-16handle route labels on RTM_CHANGE, ok mcbride, prodded my markus some time agoHenning Brauer
2004-08-09Change static functions to be non-static, for better backtraces.Otto Moerbeek
ok krw@ henning@
2004-08-08Zero route info structure in rtredirect(), avoiding a panic on labelOtto Moerbeek
copy. ok millert@ deraadt@ henning@
2004-08-03introduce route labels, allowing for up to 32 bytes of info to be attachedHenning Brauer
to a route. the label is sent over the routing socket wrapped into a new struct sockaddr_rtlabel, allowing for handling it like any other sockaddr. struct rtentry only contains a (16 bit) label-ID, with the actual labels kept outside the routing table. ID allocator code inspired by my own code for altq and pf tags. mostly hacked at the c2k4 hackathon, markus ok
2004-07-28pool(9) for rtentry and rttimer; similar to netbsd; ok mcbride, henning, pbMarkus Friedl
2004-07-20KASSERT instead of assert. Gives smaller RAMDISKS.Artur Grabowski
2004-06-22Pull the plug on source-based routing until remaining bugs are eradicated.Cedric Berger
No need to reconfig kernel or rebuild userland stuff. requested deraadt@, help beck@
2004-06-21First step towards more sane time handling in the kernel -- this changesThorsten Lockert
things such that code that only need a second-resolution uptime or wall time, and used to get that from time.tv_secs or mono_time.tv_secs now get this from separate time_t globals time_second and time_uptime. ok art@ niklas@ nordin@
2004-06-19require RTF_MPATH to enter a multipath route with RTM_ADD.Cedric Berger
route(8) takes a new -mpath modifier to enter a multipath route. requested deraadt@, ok itojun@ mcbride@ millert@
2004-06-06extend routing table to be able to match and route packets based onCedric Berger
their *source* IP address in addition to their destination address. routing table "destination" now contains a "struct sockaddr_rtin" for IPv4 instead of a "struct sockaddr_in". the routing socket has been extended in a backward-compatible way. todo: PMTU enhancements, IPv6. ok deraadt@ mcbride@
2004-04-25radix tree with multipath support. from kame. deraadt okJun-ichiro itojun Hagino
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)
2003-12-10de-register. deraadt okJun-ichiro itojun Hagino
2003-08-27cut-and-paste error; henricJun-ichiro itojun Hagino
2003-08-26mark cloned route with RTF_CLONED. remove RTF_CLONED route when clone parentJun-ichiro itojun Hagino
disappers. deraadt ok
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2003-02-12Remove commons; inspired by netbsd.Jason Wright
2002-09-11KNF - return is not a function.Jun-ichiro itojun Hagino
2002-07-11KNF.Artur Grabowski
From Lurene Angela Grenier <lurene@daemonkitty.net>
2002-06-11sprinkle splasserts where function comments tell us to.Artur Grabowski