summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd/kroute.c
AgeCommit message (Collapse)Author
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@
2006-11-16ignore routing messages for alternate tables for now, from bgpdHenning Brauer
2006-05-30Now that rtlabels are accessable via sysctl we can use route lables toClaudio Jeker
define which routes should be redistributed via OSPF. So now you can define the export list on a fine graded basis. More to come... OK norby@
2006-05-27Revert last commit. Having ifindex of 0 is an error and needs to be reported.Claudio Jeker
Having routes with incorrect ifindex makes it impossible to correctly validate routes. -current ospfd needs a -current kernel.
2006-04-28do not log "interface with index 0 not found". ifindex == 0 happens onHenning Brauer
routes. same as in bgpd now. norby ok
2006-04-25ARGSUSED for event handler.Claudio Jeker
2006-04-18struct kif_kr is not used in ospfd.Claudio Jeker
2006-04-16KNFHenning Brauer
2006-04-16only look at later rt_msghdr fields for those messages actually usingHenning Brauer
rt_msghdr, same as in bgpd, ok claudio norby
2006-03-08Fix logic of the kroute code. First of all there was a porblem if a prefixClaudio Jeker
is known via kernel and ospf. If the kernel route is removed the ospf one was not added to the FIB. This is an uncommon event so it is OK to request an update from the RIB in this case. Additionally ospfd treated bgpd inserted routes like static routes. This is wrong because IGP routes habe a higher preference over EGP routes. In this case a bgpd route needs to be overridden by a ospfd one. With these to fixes bgpd and ospfd start to play nicely together. OK norby@
2006-01-23Kill stupid comment. "not reached" after a continue is superfluous.Claudio Jeker
2006-01-12Rewrite the redistribute code. The previous implementation was stupid andClaudio Jeker
resulted in a major bottleneck if bgpd was used on the same box -- not clever to do linear searches over 175k entries :(. This now moves the redistribute code back into kroute duty and kills the linear list. Also default routes are now redistributed without the need for a kernel default route. OK norby@
2006-01-12Change inet_addr("127.0.0.1") into htonl(INADDR_LOOPBACK) and similar.Claudio Jeker
OK norby@
2006-01-05Make ospfd respect carp(4) interfaces and their weird behaviour. They willClaudio Jeker
not be used to connect to a OSPF cloud and forced to be passive. With this ospfd will only announce the carp interface route if the interface is master. So you can connect a LAN in a redundant way to your ospf backbone. OK norby@
2005-12-14Replace strlcpy() with memcpy() in the sockaddr_dl handling. sdl_data isClaudio Jeker
not a C string and strlcpy() only works on C strings -- returns length of the source. Found by tedu@ OK deraadt@ tedu@
2005-08-08tab before newline.Claudio Jeker
2005-06-26Do not automaticaly announce routes that have RTF_DYNAMIC set. These routesClaudio Jeker
are e.g. created by the PMTU code and are removed after some time. OK norby@
2005-05-24Only redistribute networks if the interface they depend on is actuallyClaudio Jeker
up and running. This makes redistribution of carp(4)-ed networks magically work. OK norby@
2005-05-24Set ifindex for all kernel routes. This makes it very easy to track theClaudio Jeker
state of static prefixes. OK norby@