summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd/kroute.c
AgeCommit message (Collapse)Author
2019-11-09Fix function name in error message.denis
input & OK claudio@
2018-12-28Add config option fib-priority to set a custom prio for routes ospfdremi
inserts into the kernel routing table. OK claudio@
2018-07-10Since we use multiple cloning routes (mpath) if more than one ip addressfriehm
exists in the same network, the routes are distinguished by their gateway address, which is the associated interface address. The ospfd has to track the gateway addresses so that kroute_matchgw() is able to find the correct routes. OK claudio@
2018-06-25Add IMSG_IFADDRADD to ospfe and the master process.remi
This allows ospfd to recover automatically when an ip address gets removed and re-added as it happens when the netstart script is executed on a running system. previous attempt discussed with friehm@ last year input from sthen@ and jca@ OK jca@
2018-02-11Use the new route filter ROUTE_PRIOFILTER in ospfd. Usually we onlySebastian Benoit
need to see routes with a higher priority (lower value) than ospfds own routes. ok claudio, ok henning previous version, feedback from sthen
2017-07-24Unify ROUNDUP macros for parsing route messages.friehm
Use the macro from route(8) / ospf6d(8) since it works also with argument 0. OK claudio@
2016-12-27struct rroute has been removed, rename variables.Jeremie Courreges-Anglas
ok claudio@
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-10-26Kernel got fixed we no longer need to check if rtm_pid is 0 to filter outClaudio Jeker
route messages that are not from us.
2015-10-24Filter our RTM_GET messages which are not from us.Claudio Jeker
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-07-19revert previousSebastian Benoit
Properly handle carp(4) interfaces in "backup" mode on start-up. Problem analyzed and fix provided by Johan Ymerson, thanks! ok claudio@, benno@ it breaks on systems without carp because iev_ospfe is not initiallized at the time kif_init() is called in main.
2015-07-18Properly handle carp(4) interfaces in "backup" mode on start-up.Martin Pieuchot
Problem analyzed and fix provided by Johan Ymerson, thanks! ok claudio@, benno@
2015-07-17Do similar handling of connected routes and filtering of llinfo and broadcast.Claudio Jeker
With this the ospfd fib and the kernel routing table are better in sync.
2015-02-11Use sizeof(u_short) in the first check since there are RT messages thatClaudio Jeker
are less then sizeof(*rtm) bytes long (e.g. interface announcements). Found the hard way by phessler@
2015-02-10Forgot the EAGAIN or EINTR check on read.Claudio Jeker
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-06-23The second level of the CTL_NET sysctl is a PF_*, not an AF_*Philip Guenther
inconsistent usage in route(8) noted by Gregor Best (gbe (at) ring0.de)
2013-10-30another simple %i to %d conversion for obviousnessTheo de Raadt
2013-06-01Minor cleanup, do not set values to 0 twice.Claudio Jeker
2011-09-16Rather than reloading kernel routes immediately when an RTM_DESYNC is seen,Stuart Henderson
set (or extend) a timer and only reload when this expires. Avoids repeatedly dumping full kernel routes (thus generating more load) when the machine has problems keeping up with messages on the route socket. (if you see lots of repeated "reloading interface list and routing table" in ospfd logs, this will help). Suggestions/ok claudio@.
2011-07-04LINK_STATE_IS_UP() cleanup userland part. There is no need to specialClaudio Jeker
case carp(4) interfaces anymore. LINK_STATE_IS_UP() almost always does the right job. OK deraadt@ henning@ This needs a -current kernel or link state may be not reported correctly.
2011-01-12Kill struct rroute and move the metric to struct kroute. ThisClaudio Jeker
disturbed me for a long time and makes upcomming work a bit easier. OK sthen@, phessler@
2010-10-14kr_redistribute() needs to be called with the head node of a multipathClaudio Jeker
chain. Fix kroute_insert() and rtmsg_process() to correctly do this. OK bluhm@
2010-07-14handle RTM_DESYNC. if the kernel says we're out of sync with the kernelDavid Gwynne
routing table and interface list, do a reload of the kernel state. ive been running this in production for 2 or 3 weeks. tested by sthen@ ok sthen@ claudio@ deraadt@ code written by andrew sallaway at the univeristy of queensland.
2010-07-12Merge duplicate log messages into one log_warn().Alexander Bluhm
ok claudio@
2010-07-09ospfd is a AF_INET only routing daemon so limit the routing socket to thatClaudio Jeker
af. This is possible since this filtering no longer blocks RTM_IFINFO. OK henning@
2010-06-27fix rtmsg_process to return on an error during processing rather thanDavid Gwynne
continue. fix kr_dispatch_msg so it acts when rtmsg_process fails. from andrew sallaway based on discussion with claudio@ ok claudio@
2010-06-23127/8 is INADDR_LOOPBACK & IN_CLASSA_NET the kroute code does notClaudio Jeker
automagicaly mask the addresses. While there kill a #ifdef that no longer makes sense since it is the least problem for portable versions.
2010-06-23fetchifs and fetchtable return -1 on error, not !0. in fact, they returnDavid Gwynne
the number of bytes they processed from the kernel on success, so testing against 0 meant that the fib reload code always dropped out early. found by andrew sallaway ok claudio@
2010-05-18Spacing.Claudio Jeker
2010-04-02The rtm_errno check which was moved in the last commit should onlyStuart Henderson
be done for rtmsgs (which have an rtm_errno) and not ifmsgs (which have part of an if_data struct in that location). Fixes problems finding interface addresses at startup. ok claudio@
2010-04-01Minor cleanup figured out while syncing kroute with snmpd's.Claudio Jeker
OK dlg@
2010-02-23fetchtable and the kroute dispatch handlers both parse the same messagesDavid Gwynne
in slightly different ways. this unifies these handlers and cuts fetchtable over to using the generic handler. help from claudio@ and sthen@ ok claudio@
2010-02-22dedup some code a bit. rather than have the same code in fetchifs andDavid Gwynne
dispatch_rtmsg, factor the message handling out. both fetchifs and dispatch_rtmsg get a buffer full of messages and then run it through a parser. now they get their buffers and pass it to rtmsg_process. ok claudio@
2010-02-22remove the original fetchtable code and replace it with the newDavid Gwynne
refetchtable. tested by me and sthen@ ok claudio@
2010-02-19oops, remove dead code.David Gwynne
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-16Pick up RTM_DELADDR and issue an internal IFADDRDEL message to the ospfe toClaudio Jeker
inform about the interface address change. If this is an active interface it will be downed. A ospfctl reload is needed to fetch the new/changed IP if one got set. OK dlg@, sthen@
2009-07-23Spelling and comment fixes by stsp@Claudio Jeker
2009-06-05rtm->rtm_hdrlen conversionChris Cappuccio
ok claudio@, henning@
2009-06-05Preliminary rdomain support, all hacked up by reyk@Claudio Jeker
2009-06-02Track reject and blackhole routes and allow them to be redistributed evenClaudio Jeker
though they point to the loopback. Mainly used for redistribute default since on default free routers we need to have a fake route now. After discussion with Tonnerre Lombard, idea OK henning@
2009-04-26comment typos; no binary changeStuart Henderson
2009-01-16fix last updateJoerg Goltermann
OK claudio@ henning@
2009-01-08Fix use after free of kr. Happend when the first loop removed the headClaudio Jeker
element without updating the kr pointer which was later on used again. Found by david@. OK norby@
2009-01-06Remove workaround added in rev 1.63. The real issue has been found andClaudio Jeker
fixed and the bandaid is no longer needed. See rev. 1.26 of sys/net/radix.c
2009-01-01Move initialisation of krt into kif_init so that it is possible to callClaudio Jeker
kr_shutdown() after kif_init().