summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/bgpd.c
AgeCommit message (Collapse)Author
2003-12-26let imsg_get and imsg_compose not fatal() but return errors upstream.Henning Brauer
make the callers cope.
2003-12-26when this project started and i added the fatal() function, I made it takeHenning Brauer
the error number as parameter instead of accessing errno, because in one place the error number was not in errno but fetched from a socket. now, of course it makes much more sense to just set errno to the error number just fecthed in this one place instead of having hundreds of fatal() calls all transfer the errno round and round and round... fix this, and also provide a fatalx, which does not care for errno and doesn't invoke strerror. oh, btw, in the place where we fetch the err # from the socket, we don't call fatal anymore anyway...
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-26overhaul error handlingHenning Brauer
try to handle as much as possbile in a graceful way so taht we don't leave the kernel routing table full of our routes, for example.
2003-12-26handle kroute_init failures nicerHenning Brauer
2003-12-26improve log messageHenning Brauer
2003-12-26log nexthop status changesHenning Brauer
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-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-25track routing table changes that are _not_ caused by bgpd itselfHenning Brauer
ok claudio@
2003-12-25kill IMSG_KROUTE_ADD as well. just send KROUTE_CHANGE requests.Henning 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-24now that the main process can cleanup without RDE's help, we do not need theHenning Brauer
somewhat fragile IMSG_SHUTDOWN_* stuff any more. speeds shutdown up enourmously. ok claudio@
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-24slightly more helpfull error msgsHenning Brauer
2003-12-24handle write() returning 0 correctly, adjust the msgbuf API appropriately,Henning Brauer
and make all callers cope.
2003-12-23spacingTheo de Raadt
2003-12-23send shutdown requests to the child processes and wait for a ackmessage fromHenning Brauer
them when shutting down. the rde needs the main process to clean up the routing table on exit so the parent process needs to be in service until the RDE is done. ok claudio@
2003-12-22delay setting up the signal handlers in the main process until after fork(),Henning Brauer
pointed out by theo
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@
2003-12-22uid check later; configtest is useful as non-rootHenning Brauer
2003-12-22add a configtest modeHenning Brauer
2003-12-22No need to setup a signal handler for SIGKILL as you can't catch it anyway.Miod Vallat
2003-12-22in the same vein we can plain errx() if the geteuid check fails.Henning Brauer
2003-12-22when starting up and the configuration has errors, do not call fatal().Henning Brauer
plain exit() is enough. we have not yet forked and an error message is already printed by the parser. inspired by a theo request
2003-12-21rename get_imsg() to imsg_get(); that's more consistentHenning Brauer
2003-12-21wrap read & write buffers for imsgs into a struct.Henning Brauer
finally gives us read buffers per pipe instead of per process, eleminating a possible race. also gets us a real imsg_init() that does all the boring init work
2003-12-21overhaul the write buffering code.Henning Brauer
introduce msgbuf API and bundle all info needed for the write buffers in a struct msgbuf. also switch to a write queue per handled connection (each bgp session, each pipe) instead of one big one. fixes some subtle problems and is overall nicer. ok claudio@
2003-12-21use pipe(2)s instead of socketpair(2)s.Henning Brauer
suggested by tedu@ for a performance gain, ok claudio@
2003-12-20more from the castathon; imsg_compose takes void * now so get rid of the castsHenning Brauer
2003-12-20few missing break; in default: cases in switch; one noticed by tedu@Henning Brauer
2003-12-20spacingTheo de Raadt
2003-12-20parent: waitpid() for the child processes on exitHenning Brauer
2003-12-20keep track which process we are so fatal() can log in which proc theHenning Brauer
condition happened. fatal()s from subsystems used by all 3 processes like the imsg subsystem were hard to track down without knowing in which process the condition happened.
2003-12-20read(2)/write(2) return ssize_t, not size_tHenning Brauer
2003-12-17send reconf requests to the RDE as well and handle them there; syncing peerHenning Brauer
data with RIB missing use same message in RDE and SE for consistency
2003-12-17welcome, bgpdHenning Brauer
started by me some time ago with moral support from theo, the proceeded up to the point where the session engine worked correctly. claudio jeker joined then and did a lot of work in the RDE. it is not particulary usefull as application right now as parts are still missing but is imported to enable more people to work on it. status: BGP sessions get established fine, OPEN messages and then KEEPALIVEs exchanged etc. session FSM works fine; NOTIFICATIONs are handled fine, and all connection drops etc I provoked get handled fine. Incoming UPDATE messgages are parsed well and the data entered to the RIB, the decision process is not yet there, neither is outgoing UPDATEs or sync to the kernel routing table. not connected to the builds yet.