summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd/kroute.c
AgeCommit message (Collapse)Author
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().
2008-12-17Add a workaround for some crazyness that happens if a cloning route has aClaudio Jeker
low priority gateway route below itself plus a carp interface on the same network. The result is that some arp entries can't be added. This is a bandaid that will give me time to figure out the real bug.
2008-12-12Make the kroute code routing priority aware. This solves a few issues andClaudio Jeker
makes to code simpler. While the routing table is somewhat simpler the redistribution code does not allow a much more radical approach. With some additional help of Mr. Kernel and his rtsock it should be possible to rip even more code out of kroute.c. Tested and OK sthen@, gollo@
2008-11-21Kill some old debug messages that are no longer needed.Claudio Jeker
2008-09-29Refactor code that handles the kroute interfaces and make it possible toClaudio Jeker
learn new interfaces during runtime. This should solve the issue with reloads failing when interfaces where created during runtime. OK norby@
2008-07-24Use memcpy() and memcmp() like everywhere else in ospfd. OK norby@Claudio Jeker
2008-06-13Simplify ROUNDUP() macro, it does not need the additional size argument.Claudio Jeker
That will be sizeof(long) no matter what.
2008-05-09insert/delete routes w/ prio RTP_OSPFHenning Brauer
2008-05-05Use rtm_hdrlen instead of the static header length. OK norby@Claudio Jeker
2007-10-17From ripd: Add missing RTM_VERSION checksClaudio Jeker
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-07-23when multipath routes exist, display them in ospfctl sh fib output.Pierre-Yves Ritschard
ok claudio@
2007-06-19add support for mapping route labels to AS-external route tags.Reyk Floeter
manpage bits from jmc@ ok norby@ claudio@
2007-06-13Ingnore updates that did not change the route. This enhances the signal toClaudio Jeker
nois ratio on the routing socket. OK norby@ reyk@
2007-06-12When removeing as-ext LSA initialise the metric to some sane default elseClaudio Jeker
the ospfd on the other side is dropping the packets because the sanity check fails.
2007-05-22Rework the way how ospfd fetches and tracks interfaces. Try to merge theClaudio Jeker
code which is very similar and especially include RTM_NEWADDR in dispatch_rtmsg(). With this newly created interfaces will no longer cause config reload problems. OK norby@
2007-04-19Use iovecs to write routing messages to the socket instead of a staticClaudio Jeker
structure. This gives greater flexibility and solves an upcoming problem with multipath routes. OK norby@
2007-04-12Before starting to evaluate the redistributon of a route it helps to setClaudio Jeker
the metric to the highest and least preferred possible value else no routes are redistributed. OK norby@
2007-03-27First step to make ospfd equal cost multipath aware.Claudio Jeker
Change kroute.c code so that it correctly tracks multipath routes. Route redistribution is way more complex in a mulitpath environment. It is not possible to redistribute multiple pathes and only a part of the multipath routes may be redistributable. So a route is redistributed as soon as one of the multipath routes is redistributable. Tested and OK norby@ and pyr@ -- at least we see no regression
2007-03-13Don't call rtlabel_unref() twice on RTM_DELETE. kroute_remove() does itClaudio Jeker
so don't unref before calling kroute_remove() or we end up with wrong reference counts.
2007-03-13rtm_tableid is only valid for RTM_ADD, RTM_CHANGE and RTM_DELETE but notClaudio Jeker
for stuff like RTM_IFINFO or RTM_IFANNOUNCE. So move check to a save location. Always check rtm_type before accessing some random value inside the route message.
2007-02-25copy mis-aligned routing socket message into a properly aligned struct, soTheo de Raadt
that we can access it safely; ok claudio in the long term we must deal with the 32/64 bit issues of if_buadrate and friends
2007-02-24spelling; sthen@spacehopperTheo de Raadt
2007-02-01kr_reload() -- another helper function for reload support. This oneClaudio Jeker
takes care that redistribution is correct after reload. OK norby@ pyr@
2006-12-13Doh! I forgot the change from kroute to rroute in the deletion case.Claudio Jeker
Found by Armin Wolfermann
2006-12-07Make it possible to set the metric and LSA type for redistributed routes.Claudio Jeker
Mostly based on a diff by Pierre-Yves Ritschard (I just simplified the parser code). OK norby@
2006-11-28add additional link states to report the half duplex / full duplexReyk Floeter
state, if known by the driver. this is required to check the full duplex state without depending on the ifmedia ioctl which can't be called in the kernel without process context. ok henning@, brad@
2006-11-28mib we pass to sysctl when fetching the routing table has 7 entries now,Henning Brauer
not 6 any more (rtableid added). need to tell sysctl so.
2006-11-17Support for multiple networks on one interface. Until now only the mainClaudio Jeker
address of a interface could be used. Now it is possible to specify a interface more than once if multiple networks are configured. An alternative network can be specified via e.g. interface em0:10.0.5.1. The old interface syntax without the IP still works and uses the main/first configured IP address. ospfd now needs to include the IP header on outgoing messages as it is not possible to specifiy the source address in sendto(2). Additionally all multicast joins and leaves have to be tracked. OK norby@