OSPFD Bug fixes

This page briefly describes each of the bug fixes made to the OSPFD implementation originally provided in the book OSPF Complete Implementation (Addison-Wesley, 9/2000). With the first fix, the version number was changed from 0.1 to 1.1. In subsequent fixes, the minor revision number (right of decimal point) has been incremented. For each fix a diff file is included that can be used to update the source distribution using the patch utility. To apply a patch, change to the top-level directory of your ospfd distribution, and then type patch -Np1 < patch_file, where patch_file is one of the patches contained in this directory.

Patches must be applied in order. They were produced using diff -Nabur old_dir new_dir.

Note also that with some of the patches, we have forgotten to update the version number correctly. However, If you download and install all the patches, the version number will (probably) read correctly.

You can download the entire set of patches in one gzipped tar file by clicking here.

OSPFD Patch listing
  • Patch 1.1. Fix allowing the configuration of a host route to be updated. Previously this would cause the number of interfaces to the host route's area to be incorrectly decremented. This is Exercise 8.4 in OSPF: Complete Implementation.
  • Patch 1.2. Fix which forces reference to area implicitly configured by host, interface, area aggregate or interface reconfigurations. Exercise 8.5.
  • Patch 1.3. Remove references to deleted interfaces. Exercise 13.4.
  • Patch 1.4. Fix stack corruption when next hop database merge produces more than MAXPATH equal-cost paths.
  • Patch 1.5. Fix the rate-limit logic for AS-external-LSAs.
  • Patch 1.6. Better fix for patch 1.1, which still had problems deleting host routes due to calling a virtual function in the interface destructor.
  • Patch 1.7. More problems with dynamic reconfiguration. This time we fix dynamic deletion of virtual links.
  • Patch 1.8. Fix to OSPF Database Overflow. When the overflow timer expires, we don't exit overflow state if we are still at the limit of non-default AS-external-LSAs.
  • Patch 1.9. When dynamically adding a virtual link, bring it up when the endpoint is already reachable. Also, put the right version numbers in.
  • Patch 1.10. When an incremental summary calculation has changed a routing table entry, this change must be pushed into the system's forwarding table.
  • Patch 1.11. If the illegal cost of 0 is requested for a link, set the cost equal to 1 instead. Note that the Dijkstra calculation can handle a cost of 0, but the equal-cost multipath logic can end up installing loops in that case (since the paths with zero cost loops end up having the same cost as the path discovered by the Dijkstra).
  • Patch 1.12. If one or most host routes were associated with the first area in the configuration, and that area had only active unnumbered interfaces without adjacent neighbors, the host routes would not get advertised.
  • Patch 1.13. Allow even the OSPF Router ID to be changed dynamically. This is how it must be done. When a reconfiguration requests to change the OSPF Router ID, you must first call ospf->shutdown() to gracefully shutdown the OSPF code. When shutdown has completed, which you know since the OspfSysCalls::halt() function is called, you must then a) delete the present OSPF class, b) reallocate it, and c) download the new configuration into it. Consult the Linux port for more details, in the files ospfd/linux/ospfd_linux.C and ospfd/linux/system.C.
  • Patch 1.14. Ignore virtual links configured to yourself. These were crashing ospfd before.
  • Patch 1.15. Fix memory leak when router-LSAs or network-LSAs are flushed from the database. Also, bring version number up to 1.15.
  • Patch 1.16. This patch pertains only to the Linux port, and for those Linux systems running kernel version 2.2 and higher. On those systems we have implemented the rtnetlink interface to the kernel, enabling the following two bug fixes: 1) automatically reacts to changes in interface flags and addresses, and 2) when direct interface becomes operational again, any alternative route to the subnet is removed from the routing table. At the same time changed code not to add/delete multicast VIFs unless MOSPF has been enabled.
  • Patch 1.17. Another patch dealing with synchronization between the kernel routing table and OSPF. Added a new OSPF API entry point OSPF::krt_delete_notification(). This is used to inform OSPF that the kernel has deleted a routing table entry that OSPF had added. In that case, OSPF will re-add the entry to the kernel if it still exists in the OSPF routing table after MinLSInterval seconds. However, to sychronize with the Linux 2.2 kernel this is not enough. Linux 2.2 deletes routing table entries associated with failed interfaces, but does not tell OSPF that the entries were deleted, but only that the interface goes down. Consequently, we now delete routing table entries in the API routine OSPF::phy_down(). Otherwise, if an interface flaps, the kernel would lose the routing table entries but OSPF may have kept them unchanged if no new LSA was generated.
  • Patch 1.18. Fix compilation error in the OSPF simulator. Thanks to Dean Dayton for pointing this out.
  • Patch 1.19. This is an enhancement, not a bug fix. The I-D draft-ietf-ospf-ppp-flood-00.txt has been implemented, which allows you to limit the number of flooding adjacencies to a neighboring router that is connected via parallel point-to-point links. To configure this functionality, add the command PPAdjLimit _maxadj_ to the ospfd daemon's configuration file, or use the PPAdjLimit _rtid_ _maxadj_ for the OSPF simulator.
  • Patch 1.20. Fix some declarations that should have been size_t instead of int.
  • Patch 1.21. Fixes the reception of self-originated LSAs over demand circuits. See the message thread Flooding over demand circuit on the OSPF mailing list for a detailed description of the problem.
  • Patch 1.22. Fix a couple of C++ syntax problems, that the GNU C++ compiler didn't object to but that more strict compilers (such as Microsoft Visual C++) didn't like.
  • Patch 1.23. Another enhancement. Under configuration control, spread out the refresh of LSAs. Instead of refreshing an LSA immediately at the required interval (30 minutes for most LSAs, and the configured interval for DoNotAge-LSAs), delay the refresh randomly for up to 15 minutes (MaxAgeDiff). Off by default, this feature can be turned on by adding the command random_refresh to the ospfd or ospf simulator configuration files. For the simulator, the option will apply to all simulated routers.
  • Patch 1.24. This patch applies only to the Linux ospfd port. It allows ospfd to run over IPIP tunnels. You have to be running Linux 2.2 or later, otherwise the code is #ifdef'ed out. This patch also allows you to refer to an interface by its name (e.g., eth0 or tunl) in the ospfd config file. This is necessary if you want to treate the tunnel as an unnumbered point-to-point link. By the way, if you want to use tunnels with ospfd, you have to (a) set the tunnel ttl using /bin/iptunnel, otherwise the encapsulated packet inherits OSPF's TTL of 1 and the packet doesn't get very far, and (b) enable the tunnel for multicast traffic by giving the multicast option to ifconfig.
  • Patch 1.25. Two fixes/enhancements relating to static routes. The first allows you to configure static routes for directly connected interfaces, which will be used when the router loses its direct interface (this fix specific to the Linux ospfd port). The second allows you to configure multiple static routes for a single prefix, each distinguished by having a different next hop and/or outgoing interface. The software will install one of the routes having a reachable next hop, essentially providing a hot-standby service for static routes.
  • Patch 1.26. Three unrelated fixes. 1) Completed the fix started in patch 1.21, dealing with receiving self-originated LSAs when you also have demand circuits. The previous fix did not cover the case when the received LSA is different than the current database copy, but a new origination would agree with the received LSA, and not the database. 2) Fix to the OSPF simulator so that routers joining a simulation in progress would start at the current time, rather than at time 0. 3) Fixed incremental summary-LSA calculations, so that we correctly detect the conditions requiring us to rerun the entire routing table calculation. See the message thread RFC 2328 Section 16.5 Case 2 on the OSPF mailing list for a detailed description of the problem.
  • Patch 1.27. Update the enhancement introduced in patch 1.19, by implementing the updated I-D draft-ietf-ospf-ppp-flood-01.txt
  • Patch 1.28. Ensure that a router summarizes its own host addresses into other areas.