summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/bgpd.c
AgeCommit message (Collapse)Author
2008-05-12Error out with usage line if additional arguments are given after thePierre-Yves Ritschard
option parsing. Found out the hard way by jdixon on ifstated. ok sobrado@, jdixon@, millert@
2007-05-11Various spelling fixes from Stuart Henderson.Claudio Jeker
2007-01-26Massiv rework of the control imsg flow. Main changes:Claudio Jeker
- dedicated pipe between the SE and the RDE for control messages - restartable RB tree dumps in the RDE - queuing limits both in the SE and RDE The result is a dramatic decrease of memory consumption on operations like bgpctl show rib. Previously all messages where first stored in the RDE then passed to the SE where they got queued in case bgpctl was not fast enough. Now only a small number of messages is generated and passed to the SE and the SE has an additional limit instead of acting like an infinite buffer. Without this the bgpd on bgpd.networx.ch would not survive a single minute. looks good henning@
2007-01-04ignore SIGPIPE, like the other 2 processes already do. we detect brokenHenning Brauer
pipes without the signal just fine. ok claudio
2007-01-04Do not run rde_shutdown() unless bgpd is started with -d.Claudio Jeker
On some of my systems rde_shutdown() takes more than 3min doing nothing more than calling free(3) over and over again.
2006-11-28allow bgpd to work on alternate routing tables, claudio ok, jmc manpage helpHenning Brauer
2006-06-19add -c to usage() and synopsis;Jason McIntyre
2006-06-17implement carp demotion control for bgpd.Henning Brauer
sessions can be configured to modify the carp demotion counter for a given interface group (usually, "carp", which has all carp interfaces) when the session is not established. once the session is established for 60 seconds, the demotion is cleared. this, used correctly, can prevent a bgpd-box which lost all sessions (and thus has no routes) to be carp master, while the backup has sessions. thought through and partially hacked on a drive from calgary to vancouver with ryan, ok claudio
2006-05-27Pass a IMSG_CTL_RESULT messgae back to bgpctl on reloads to indicate ifClaudio Jeker
the reload was successful or not. OK henning@
2006-04-26Last argument to send_filterset() is a left-over from one of my not so cleverClaudio Jeker
ideas that will never be included and always set to 0. Kill it.
2006-03-22Change the way bgpd selects nexthops. Up until now every route was consideredClaudio Jeker
when calculating the nexthop. Now only non BGP routes and not the default route are used unless forced with the new config options nexthop qualify via bgp nexthop qualify via default This change is required for complex setups e.g. where an additional IGP is running. OK henning@
2006-03-15Sync usage with man page (sort arguments).Claudio Jeker
2006-03-15Allow the control socket to be changed on the command line. Useful if youClaudio Jeker
need to run multiple bgpds on a single box to simulate a IX. This helped me massivly debugging error reports. OK henning@
2006-01-24Functions in the poll() loop should only be moved around if there are noClaudio Jeker
side-effects. Revert last changes and make bgpctl reload work again.
2006-01-24KNFHenning Brauer
2006-01-24introduce a second control socket, which is restricted to certain messages,Henning Brauer
nameley the show ones. needed for looking glass style applications, monitoring etc. claudio ok
2006-01-03Plug some mem leaks.Claudio Jeker
2006-01-03Move the signal handler flags check between the poll() call and the pollClaudio Jeker
fd handling. Do not access poll fd in case of an error or timeout. With and OK dlg@
2005-12-24bzero the pfd array before setting it up and calling poll because on errorClaudio Jeker
(e.g. EINTR) poll() will not update the pfd array (copyout) and so the old revents are used and results in a blocking parent process. OK dlg@
2005-11-02Reorder and comment reconfigure(). Makes more sense so.Claudio Jeker
2005-11-01Switch from the per peer filter set list to a filter-only solution.Claudio Jeker
The default filter_sets are converted into match filter rules that get evaluated first. Simplifies code massively -- mainly the config reload part -- and makes softreconfig out a piece of cake. "get it in" henning@
2005-10-13Simplify poll loop as well. "grrr, OK" henning@Claudio Jeker
2005-07-01Switch filter_sets form SIMPLEQ to TAILQ, needed for upcomming stuff.Claudio Jeker
2005-06-29rtlabel support via filter sets. Just use "set rtlabel foobar" in filtersClaudio Jeker
network and neighbor statements and the routes are labeled accordingly. While doing that fix some mem-leaks by introducing filterset_free() and remove the free on send option of send_filterset(). This took a bit longer because we need to carefully track the rtlabel id refcnts or bad things may happen on reloads. henning@ looks fine
2005-06-09Change the "network connected|static" statements to "network inet|inet6Claudio Jeker
connected|static" so that it is possible to distinguish between IPv4 and IPv6 addresses. "network connected|static" is considered deprecated but will be supported as an alias for "network inet connected|static" for some time (one release) to simplify upgrades. This also solve a nasty crash when using "network connected". OK henning@
2005-05-27will throw claudio in a big pot of kaesefondue for repeated whitespace fuckupsHenning Brauer
2005-05-27kroute6 support, at least partially. Get it in so that Henning can clean itClaudio Jeker
up more. OK henning@
2005-05-23one more endpwentHenning Brauer
2005-04-28Support for "network connected" and "network static" -- announce allClaudio Jeker
directly connected respectively all static routes. The list is auto- matically adjusted as soon as a route changes. OK henning@
2005-03-30bgpd used to open listeners in advance in the parent and the SE pickedHenning Brauer
those it needed, closing all the others. this has some nasty races. so let the parent keep the list of listeners so it knows when it has to open a new one claudio ok, also tested by jason ackley
2005-03-28free rules_l if the initial config file parse failsHenning Brauer
2005-03-24fix memory leak in error paths. found with coverity prevent.Ted Unangst
ok claudio henning
2005-02-09need to send IMSG_NETWORK_DONE after sending networks and associated filterHenning Brauer
sets, otherwise local netyworks get withdrawn after config reload; misbehaviour noticed by peter.galbavy@knowtion.net, claudio ok
2005-02-02usage() is __deadHenning Brauer
pt out by Alexander v Gernler
2004-11-23Switch from a single filter_set to a linked list of sets. With this changeClaudio Jeker
it is possible to specify multiple communities. This is also the first step to better bgpd filters. OK henning@
2004-10-19allow neighbor definitions to depend on interface state.Henning Brauer
with this, if a neighbor is configured as dependent on carp0 for example, the neighbor will remain in state IDLE as long as carp0 is not master. once carp0 becomes master the session(s) depending on it immediately go to CONNECT (or ACTIVE, if they're configured passive), reducing failover time. claudio ok, with some input from ryan as well
2004-09-23after receival of a SIGCHLD reset io_pid or rde_pid, respectively, dependentHenning Brauer
on which child went away.
2004-09-16imsg API cleanup:Henning Brauer
-kill imsg_compose_pid, imsg_compose_fdpass and imsg_create_pid -extend the original imsg_compose/_create API to take pid & fd too -make imsg_compose do imsg_create + imsg_add + imsg_close instead of duplicating the code -adjust all callers to the new API ok claudio
2004-09-16malloc the imsg buffers instead of having them staticly, suggested byHenning Brauer
micskye some time ago
2004-09-15if (signalflag) { dowork(); signalflag = 0; } is a race. First clear flag,Otto Moerbeek
then call work(). ok henning@
2004-08-24use session_socket_blockmode() instead of hand-rolling roughly the sameHenning Brauer
claudio ok
2004-08-05The peer_l is not needed in the rde but still allocated, free them andClaudio Jeker
save 1k per peer. OK henning@
2004-08-03Fix mem-leak on exit. OK henning@Claudio Jeker
2004-07-28The hole dance to close a mrt file after fd passing in the parent is notClaudio Jeker
needed as the fd is closed while beeing passed. looks good henning@
2004-07-05fix a few KNF falloutsHenning Brauer
2004-07-042 more file descriptors for each RDE and SE inherited from the parentHenning Brauer
we should close
2004-07-04when getting rid of the listen_addr TAILQ after forking actually closeHenning Brauer
the file descriptors in RDE and parent process, not needed or used there
2004-07-03Switch mrt dumping to fd passing. This gives some speed up when extensiveClaudio Jeker
dumping is done. Acctually mrt dumps were broken because of the fd passing. The nice side effect is a much cleaner code, especially in the parent process. OK henning@
2004-06-20at least somewhat consistently name the TAILQ_ENTRYs... this confused meHenning Brauer
more than once
2004-06-20implement file descriptor passing in the imsg/msgbuf framework, and useHenning Brauer
it to let the main process to prepare new listening sockets (socket() and bind()) on behalf of the session engine, which of course cannot bind() to ports < 1024 any more once it dropped privileges. with some help from theo, claudio ok