summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd/ospfd.c
AgeCommit message (Collapse)Author
2016-02-02Remove setproctitle() for the parent process. Because rc.d(8) uses processStuart Henderson
titles (including flags) to distinguish between daemons, this makes it possible to manage multiple copies of a daemon using the normal infrastructure by symlinking rc.d scripts to a new name. ok jung@ ajacoutot@, smtpd ok gilles@
2015-12-05Pledge ospfd SE ("stdio inet mcast") and RDE ("stdio") move some codeClaudio Jeker
around to make it possible. Parent can't be pledged at the moment because of carp ioctl (carp demote). Putting it in so that people can test. OK benno@
2015-12-03imsg_read will return EAGAIN in some cases so prep code for it.Claudio Jeker
This is in the way for ospfd pledge so in it goes. OK benno@
2015-09-27As done for bgpd recently, rename if_mediatype to if_type in ospfd/ospf6d.Stefan Sperling
And some ifmedia64 fixes. "move forward" deraadt@
2015-07-20Fix a segfault at startup when if_change() ist called beforeSebastian Benoit
imsg_init() exposed by the second part of this diff which makes carp(4) interfaces be recognized to be in "backup" mode on start-up. Problem analyzed and fix provided by Johan Ymerson, thanks! ok claudio@, mpi@
2015-03-14When removing interfaces in the RDE we also need to remove all the RDEClaudio Jeker
neighbors that are part of that interface or we open us up to use after free situations like the one found by sthen@. Diff makes sense sthen@
2015-02-10Convert ospfd over to SOCK_CLOEXEC | SOCK_NONBLOCK and make the routeClaudio Jeker
socket non-blocking. Introduce the same trigger for partial rt msgs.
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers whereTheo de Raadt
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
2014-07-12Close connections when msgbuf_write() returns 0.Kenneth R Westerback
ok claudio@
2013-11-13from claudioSebastian Benoit
"Let msgbuf_write return -1 with errno EAGAIN. The users then must check if this was the case and readd the event or poll again. The current handling in the imsg code is wrong for sure." ok gilles, benno
2013-03-22whitespace tweak; gratuitous difference with ospf6dStuart Henderson
2011-08-20Decouple log_verbose() from log_init() so the verbose flag stays set withStuart Henderson
"ospfd -v" (previously only "-vd" worked). Feedback on earlier implementation from henning@ blambert@ claudio@, ok claudio@
2011-05-06Do not special case loopback interfaces on init. Instead force themClaudio Jeker
to IF_STA_LOOPBACK in if_act_start() this way they will repsect IFF_UP on startup. Also remove a now no longer needed workaround when reloading interfaces. Initial diff provided by Patrick Coleman. OK dlg@
2011-03-24Fix some memory leaks. Mainly better cleanup on shutdown but the v_nexthopClaudio Jeker
leak is a runtime one. OK bluhm@
2010-09-02remove trailing spaces and tabs from source code; no binary changesIgor Sobrado
(verified by both sthen@ and me). ok sthen@; "just commit it" claudio@
2010-05-14When merging interfaces after a config reload, the fsm state for interfacesStuart Henderson
is forced into IF_STA_NEW so that if_init() can be called to setup timers etc. When a loopback interface is added to the config, this means there's no way to get to the correct state. Fix by avoiding changing an existing IF_STA_LOOPBACK and forcing loopback interfaces to be passive (otherwise skipping the if_init on an active interface causes problems). ok claudio@
2010-02-19implement ospfctl fib reload.David Gwynne
this tells the daemon to resync the kernels list of interfaces and routes with the daemons list. this is very useful if the routing socket overflows and you want to sync things up again. lots and lots of help from claudio@ ok claudio@
2010-02-16Only merge interfaces that have the same address and netmask. Fixes a bugClaudio Jeker
with reloads when running ospfd on multiple aliases on the same interface. Is also needed to handle interface address changes in a much better way. OK dlg@, sthen@
2009-11-02Implement IMSG_CTL_LOG_VERBOSE to enable or disable debug logging on runtime.Claudio Jeker
It always annoyed me that in case of a problem I had to restart the ospf in forground debug mode and by doing so losing all routes at least twice. OK henning, sthen, michele
2009-06-06sync ospfctl/ospfd with the common imsg code, making it lib ready as well.Eric Faurot
"looks ok" claudio@
2009-06-05make ospfd's imsg lib ready as well.Pierre-Yves Ritschard
ok claudio@
2009-06-05Preliminary rdomain support, all hacked up by reyk@Claudio Jeker
2009-05-31Remove redundant imsg_event_add calls; ok claudio@Jacek Masiulaniec
2009-05-31The libevent callback function may be called with EV_READ and EV_WRITEClaudio Jeker
set at the same time so using a switch to do read or write is a bad idea. Problem noticed by Eygene Ryabinkin on FreeBSD for some reasons it is not triggered on OpenBSD. Fix aggreed by a most other libevent hackers
2009-05-15Do not ignore the route metric for "redistribute default".Marco Pfatschbacher
Got broken in -r 1.62. Pointed out by bluhm@ OK bluhm@, claudio@
2009-04-07allow to specify an alternate control socket instead of /var/run/ospfd.sock.Reyk Floeter
this is required to run multiple instances of ospfd. ok claudio@
2009-03-27Allow the announcement of default route also via redistribute 0.0.0.0/0Michele Marchetto
and route labels. ok claudio@
2009-03-24Change the behaviour of redistribute default.Michele Marchetto
Now a default route have to be present in the fib to be correctly advertised. Spotted and tested by Steven Surdok on ripd. ok claudio@
2009-03-01Print the correct function name in log_debug().Michele Marchetto
OK claudio@ stsp@
2009-01-07Full stub area support. This allows ABRs to announce a default networkClaudio Jeker
summary LSA into stub areas so that these routers are able to reach the outside of the area. OK norby@
2009-01-01Call kr_shutdown() before exit even in config test mode and config parseClaudio Jeker
error case.
2008-11-24Initial support for stub areas. The bit still missing is the redistributionClaudio Jeker
of the default summary net lsa on ABRs but that is comming. OK norby@
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-10-25Add -D makro=value as well so that all routing daemons are in sync.Claudio Jeker
OK norby@
2007-10-20forgot about ospfd in last commit.Pierre-Yves Ritschard
ok hennin@ too.
2007-10-14Missing spaceClaudio Jeker
2007-10-13in all these programs using the same pfctl-derived parse.y, re-unify theTheo de Raadt
yylex implementation and the code which interacts with yylex. this also brings the future potential for include support to all of the parsers. in the future please do not silly modifications to one of these files without checking if you are de-unifying the code. checked by developers in all these areas.
2007-10-11Don't check for OSPF_OPTION_E in the parent. OSPF_OPTION_E is per area andClaudio Jeker
so the parent process has no way to know if it should redistribute or not. Let the RDE decide. OK norby@
2007-10-01fix alot of whitespace problems...Esben Norby
2007-09-25Last missing piece in the equal cost multipath support for ospfd.Claudio Jeker
Send all possible nexthops to the parent process and correctly sync the RIB, FIB and kernel routing table. Based on initial work by pyr@. OK pyr@ norby@ PS: don't forget that you need to enable multipath support via a sysctl
2007-09-18Correctly track the E-bit of router LSA on config reloads. If redistributionClaudio Jeker
is turned on or off the E-bit needs to be toggled accordingly else the AS-external LSA are ignored by the other OSPF routers. OK norby@
2007-07-25Don't fatal if the imsg pipe is closed, this is often triggered in the parentClaudio Jeker
and hides the real cause of the termination. OK norby@, reyk@, pyr@
2007-06-19Allow ospfd reconfiguration through SIGHUP, add SIGHUP handlers inPierre-Yves Ritschard
children like in bgpd so that ``pkill -1 ospfd'' works as expected. ok claudio@
2007-05-29Demote support for ospfd. It is possible to specify a demote group onClaudio Jeker
interfaces and areas. With this carp setups using ospfd are more reliable because we can fail over if the OSPF connectivity is (partially) lost. OK norby@
2007-03-25If the interface metric changes on reload it is necessary to re-originateClaudio Jeker
the router LSA so that the change propagates instantly. Call orig_rtr_lsa() in merge_config() if a interface in an area changes. Do it as late as possible to reduce the amount of updates generated by a config reload. Found and tested by Stuart Henderson. OK norby@
2007-03-21Add support for RFC 3137: OSPF Stub Router AdvertisementClaudio Jeker
This allows ospfd to announce networks without the need to transit traffic. stub router is enabled if the fib is not coupled, net.inet.ip.forwarding is not 1 or if the stub router global config option is set to yes. OK norby@
2007-03-17Exchange a strlcpy() with a strncpy(). A similar change was done in parse.yClaudio Jeker
some time ago. The simple password needs to be nul extended and is allowed to fill the full buffer the perfect job for stncpy(). Found and tested by Jon Morby.
2007-03-16Don't forget to set the metric in the REDIST_LABEL case. OK pyr@Claudio Jeker
2007-02-01whitespace cleanup, no binary change.Claudio Jeker
2007-02-01Preliminary configuration reload support. Seems to work reasonably wellClaudio Jeker
after fixing many use-after-free errors a couple of days ago. Most cases -- adding/removing of interfaces, adding/removing of areas -- seem to work. Still merge_config() is a behemoth of a function and some edge cases may not be covered correctly (yet). OK norby@ pyr@