summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/kroute.c
AgeCommit message (Collapse)Author
2004-01-07fix a check that catched too much... now connected routes that appearHenning Brauer
after startup (due to addition of an ip to an interface) are handled correctly.
2004-01-062004Henning Brauer
2004-01-05protect against trying to couple when we're already coupled to the fib,Henning Brauer
and log the coupling. same for decouple.
2004-01-02mark a few numbers U to please compilers; henning okTheo de Raadt
2003-12-30typos from davidHenning Brauer
2003-12-28typo in commentHenning Brauer
From: Dries Schellekens <gwyllion@ace.ulyssis.org>
2003-12-27styleHenning Brauer
2003-12-27consider the defualt route in kroute_match as well. it is a special case.Henning Brauer
2003-12-27keep a copy of the fd locally instead of passing it around all timeHenning Brauer
2003-12-27provide kroute_fib_couple and _decouple, pumping all bgp routes from theHenning Brauer
internal view to the kernel routing table respectively removing them all from the kernel routing table kroute_shutdown is now a simple wrapper to kroute_fib_decouple
2003-12-27implement "no fib-update" much coolerHenning Brauer
2003-12-27when a static route is deleted on that a nexthop depends, we re-checkHenning Brauer
wether there's another (bigger-prefix) non-bgp route suitable to reach the prefix, and if that is the case change the references over to the new route. if not, we need to invalidate the nexthop. unfortunately, we cannot just call kroute_nexthop_insert (whoch does these checks) again, as it does too much. factor out the matching and reference adding code from kroute_nexthop_insert to a new kroute_nexthop_checkmatch(), and make the surrpounding stuff cope. the kroute parts of "static route addition/deletion affects nexthop-valifity" work now.
2003-12-26detect when a newly added kernel route (non-bgp of course) matches a nexthopHenning Brauer
that is flagged invalid yet and make it valid, notify RDE etc
2003-12-26factor out common codeHenning Brauer
2003-12-2620 minutes debugging for a missinf return (0) at the end of a function,Henning Brauer
and gcc should have had complained... well.
2003-12-26by making kroute_dispatch_msg() and kroute_nexthop_add() return int insteadHenning Brauer
of void they can now report errors upstream and do not need to panic any more. so do that and handle the errors in bgpd.c in the vein that we at least can clean up before exit. there are no direct fatal() call in kroute.c now any more, nor any in bgpd.c after forking.
2003-12-26report as many errors upstream as possible instead of fatal() so theyHenning Brauer
can be handled better
2003-12-26handle kroute_init failures nicerHenning Brauer
2003-12-26provide a real log_errHenning Brauer
2003-12-26127/8 is special, and thus needs special protection.Henning Brauer
on startup, insert a fake route for it to our private view of the kernel routing table, and flag it as kernel and connected route. we never allow a bgp route to overwrite a kernel route. prodded by theo
2003-12-26o improve logging dramaticallyHenning Brauer
o handle more errors gracefullt instead of panic o don't leak mem on RB_INSERT failues (not a common case anyway, but...) o zap a few unneeded variables
2003-12-26handle IMSG_NEXTHOP_DELETE as wellHenning Brauer
2003-12-26kroute_nexthop_check -> kroute_nexthop_addHenning Brauer
kroute_validate_nexthop -> kroute_nexthop_insert
2003-12-26kroute_validate_nexthop is a private functionHenning Brauer
2003-12-26finally marry rde and kroute parts of the nexthop verification:Henning Brauer
handle IMSG_NEXTHOP_ADD and send IMSG_NEXTHOP_UPDATE when appropriate
2003-12-26o in struct nexthop_node, we don't need the full kroute_nexthop struct,Henning Brauer
| the nexthop address itself is enough o RB_INIT the nexthop table o don't forget to set the key field before RB_INSERT...
2003-12-25nothing uses the special return value kroute_msg used to set for EEXIST anyHenning Brauer
more, so zap the special treatment for EEXIST
2003-12-25bring us closer to a complete nexthop verification that does NOT needHenning Brauer
periodic scans: -keep a tree of nexthops with valid/invalid flags -provide kroute_match, which takes an IP address and gives the kernel route for that -find the kernel route for a given nexthop with that -keep a marker on the kernel route that a nexthop depends on it -on removal of the kernel route, re-evaluate the affected nexthops for validity. ok claudio@
2003-12-25detect connected routes and flag them as suchHenning Brauer
2003-12-25track routing table changes that are _not_ caused by bgpd itselfHenning Brauer
ok claudio@
2003-12-25factor out prefixlen_classful() and mask2prefixlen()Henning Brauer
2003-12-25kill an inappropriate XXXHenning Brauer
2003-12-25remove a useless check & commentHenning Brauer
2003-12-25(more or less) handle ESRCH for RTM_ADDHenning Brauer
2003-12-25it actually makes more sense to call the merged function kroute_changeHenning Brauer
2003-12-25kroute_change is obsolete, long live kroute_addHenning Brauer
2003-12-25check with our local view wether there is already an entry for the to beHenning Brauer
added prefix in the kernel routing table. if yes and inserted by us change action from ADD to CHANGE, if not added by us do not add or change that prefix.
2003-12-25oups, remove debugging cruftHenning Brauer
2003-12-25skip over routing table entires with flag LLINFO (that's arp cache)Henning Brauer
2003-12-25dump a copy of the kernel routing table into our own view on startupHenning Brauer
2003-12-24no O_NONBLOCK for routing and tcp sockets, theoHenning Brauer
2003-12-24now that we keep track of the routes we added to the kernel we can removeHenning Brauer
them easily on shutdown without the RDE's help
2003-12-24keep track of the routes we inserted to the kernelHenning Brauer
do only ever delete those, and no others
2003-12-23use RTF_PROTO1 for nowHenning Brauer
2003-12-23no RTF_MASKHenning Brauer
2003-12-23don't panic on EEXIST. that's normal for a full-table router to get a routeHenning Brauer
for its own connected network(s)
2003-12-23bzero, set sin_len, and fix an error messageHenning Brauer
from debugging session with claudio
2003-12-22o add low-level functions for adding/chaining/removing kernel routesHenning Brauer
o define new imsg types for this o process these imsgs in the parent process now "only" debugging and the rde sending these messages is missing. ok claudio@