summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd/kroute.c
AgeCommit message (Collapse)Author
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@
2005-05-13The NET_RT_IFLIST sysctl returns RTM_IFINFO and RTM_NEWADDR messages inClaudio Jeker
the buffer. While RTM_IFINFO starts with a struct if_msghdr RTM_NEWADDR does not. In other words (struct sockaddr *)(next + sizeof(ifm)) is only correct for RTM_IFINFO and not for RTM_NEWADDR. So move the ifm_type check up else get_rtaddrs() would access memory outside of buf. OK henning@
2005-04-16Set F_STATIC flag earlier else the default route will end up as non-static.Claudio Jeker
2005-04-12Support for self originated AS-external LSA.Claudio Jeker
With "redistribute (static|connected|default|none)" it is possible to tell ospfd which external routes should be announced. Connected routes will be announced only if there is no corresponding interface configured, in that case the prefix is not external. Adding and removing of announced prefixes are done automaticaly. OK norby@
2005-03-31Add support for crypt authentication (MD5).Esben Norby
ok and input claudio@
2005-03-26Implement the IMSG_CTL_IFINFO bits correctly. This is needed forClaudio Jeker
"ospfctl show fib interface". OK henning@ norby@
2005-03-26kroute.c cleanup, simplify code and remove unused functions.Claudio Jeker
OK henning@
2005-03-23The interface name in struct sockaddr_dl may not be nul terminated andClaudio Jeker
so the strlcpy() will copy to much. Use sa_nlen instead with some additional logic. This fixes a problem where interfaces where not found. OK norby@
2005-03-23prefixlen2mask() should return a network byte order result as it does implyClaudio Jeker
by using an in_addr_t as return type. It simplyfies also the usage as in most cases the mask is used with a struct in_addr address which is also network byte order. Add prototypes of prefixlen2mask() and mask2prefixlen() to ospfd.h as it is used or will be used at different places. OK norby@
2005-03-23grow receive buffer on the routing socket, from bgpdHenning Brauer
2005-03-23explicitely initialize opt, from bgpdHenning Brauer
2005-03-15Add control messages for the show fib commands.Claudio Jeker
OK norby@ deraadt@