summaryrefslogtreecommitdiffstats
path: root/ospfd
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'current' into dn42quagga_1.1.0-dn42.11-rc0David Lamparter2010-02-051-2/+3
|\
| * lib: get rid of extraneous output with vty_prependDavid Lamparter2010-02-051-2/+3
| | | | | | | | | | | | | | | | | | the vty_*prepend* family can be used to reduce the amount of output produced by "show running-config" and "write ...". it buffers output in struct vty->prepend (1024 bytes) and outputs it when vty_out is called. if vty_out isn't called, it can be removed with vty_unprepend later. applied on zebra and ospfd to get rid of empty interface blocks.
* | Merge branch 'patches/jt_ospf-fixes-20091129' into dn42David Lamparter2010-02-051-1/+0
|\ \
| * | Revert "ospfd: actually add nbr to nbrs list."David Lamparter2010-02-051-1/+0
| | | | | | | | | | | | | | | | | | No, at second thought I don't want it in the list twice... This reverts commit 43f93a5b3a491052b8206e6d94dd3c986aa9f45b.
* | | Merge branch 'current' into dn42David Lamparter2010-02-051-4/+4
|\ \ \ | | |/ | |/|
| * | lib, ospfd: remove ZEBRA_FLAG_BLACKHOLE from the zclient APIDavid Lamparter2010-02-051-4/+4
| | | | | | | | | | | | | | | | | | | | | FLAG_BLACKHOLE is used for different things in different places. remove it from the zclient API, instead indicate blackhole routes by ZAPI_MESSAGE_BLACKHOLE, which is converted to the proper zapi indication by zapi_ipv4_route()
* | | Merge branch 'patches/pj_workqueue' into dn42David Lamparter2010-02-059-91/+138
|\ \ \ | | | | | | | | | | | | | | | | Conflicts: lib/thread.c
| * | | ospfd: use workqueue for ospf_ase_calculate_routePaul Jakma2010-02-054-28/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * The ospf_ase_calculate_timer can take a long time to run, as it scales O(# of AS-External LSAs), in domains with lots of external routes. Fix this by using a work-queue for the per-LSA processing, thus splitting it up a bit. * ospf_ase.h: (ospf_ase_calculate_route, ospf_ase_calculate_schedule) no need for these to be exported. * ospf_spf.c: (ospf_spf_calculate_timer) ospf_ase_calculate_schedule is gone. * ospfd.h: (struct ospf) add a work-queue for the AS-External route calculation. * ospf_ase.c: (ospf_ase_calc_completion) completion func, for when ase-calculation is done. Also have to take care to see if the timer needs to be rescheduled, which is the case if ospf->ase_calc is set again but there is no timer scheduled. (ospf_ase_calc_process) workqueue processing function, calls to the existing ospf_ase_calculate_route. (ospf_ase_calculate_timer) add to work-queue, instead of calling ospf_ase_calculate_route directly. (ospf_ase_calculate_timer_add) do the job of ospf_ase_calculate_schedule which can be removed. Set flag so we can tell if a timer schedule comes in while the previous timer is running.
| * | | ospfd: Prioritise hellos for sending by queueing to head of output bufferPaul Jakma2010-02-052-46/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * It's possible for the packet output buffer to be filled up with a long series of non-Hello packets in between Hellos packets, such that the router's neighbours don't receive the Hello packet in time, even though the hello-timer ran at about the right time. Fix this by prioritising Hello packets, letting them skip the queue and go ahead of any packets already on the queue. This problem can occur when there are lots of LSAs and slow links. * ospf_packet.h: (ospf_hello_send_sub) not used outside of ospf_packet.c * ospf_packet.c: (ospf_fifo_push_head) add packet to head of fifo (so its no longer really a fifo, but hey) (ospf_packet_add_top) add packet to top of the packet output queue. (ospf_hello_send_sub) Put Hello's at the top of the packet output queue. make it take in_addr_t parameter, so that this ospf_hello_send can re-use this code too. (ospf_hello_send) consolidate code by using ospf_hello_send_sub (ospf_poll_send,ospf_hello_reply_timer) adjust for ospf_hello_send_sub.
| * | | ospfd: Reset neighbour inactivity timer for any packet arrivalPaul Jakma2010-02-053-17/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * The hello protocol monitors connectivity in 2 different ways: a) local -> remote b) remote -> local Connectivity is required in both directions (2-way) for adjacencies to form. The first requires a round-trip to detect, and is done by advertising which other hosts a router knows about in its hello messages. This allows a host to detect which other routers are and are not receiving its message. If a remote neighbour delists the local router, then the local router raises a "1-Way Received" event. The latter is straight-forward, and is detected by setting a timer for the neighbour. If another Hello packet is not received within this time then the neighbour is dead, and a separate "Inactive" event is raised. These are 2 different and relatively independent measures. Knowing that we can optimise the 2nd, remote->local measure and reset the timer when /any/ packet arrives from that neighbour. For any packet is as good as a Hello packet. This can help in marginal situations, where the number of protocol messages that must be sent sometimes can exceed the capacity of the network to transmit the messages within the configured dead-time. I.e. an OSPF network with lots of LSAs, slow links and/or slow hosts (e.g. O(10k) LSAs, O(100kbit) links, embedded CPUs, and O(10s) dead-times). This optimisation allows an OSPF network to run closer to this margin, and/or allows networks to perhaps better cope with rare periods of exceptional load, where otherwise they would not. It's fully compatible with plain OSPF implementations and doesn't prejudice dead-neighbour detection. * ospf_nsm.h: Rename HelloReceived event to PacketReceived. * ospf_nsm.c: (nsm_hello_received) -> nsm_packet_received * ospf_packet.c: Schedule PacketReceived whenever a valid message is received.
| * | | ospfd: the maxage_lsa_remover should check whether it needs to yield the cpuPaul Jakma2010-02-051-0/+4
| | | |
* | | | Merge branch 'patches/smallones' into dn42David Lamparter2010-02-057-105/+11
|\ \ \ \
| * | | | ospf: cleanupStephen Hemminger2010-02-057-105/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OSPF compiler warnings: * remove dead code * avoid casting int to pointer (instead use unsigned long) (changes to ospf_ase.c removed by David Lamparter) Cc: David Lamparter <equinox@diac24.net>
* | | | | Merge branch 'merged/ospfd' into dn42David Lamparter2010-02-0421-637/+926
|\ \ \ \ \ | | |/ / / | |/| / / | |_|/ / |/| | |
| * | | Merge branch 'patches/jt_unnumbered' into ospf-merge-3David Lamparter2010-02-0410-176/+448
| |\ \ \ | | | | | | | | | | | | | | | | | | | | Conflicts: ospfd/ospfd.c
| | * | | ospfd: Optimize and improve SPF nexthop calculationJoakim Tjernlund2010-02-044-98/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Maintain router LSA positions in OSPF interface. Find the OSPF interface in nexthop_calculation using the position in the router LSA. This has the following advantages: - Multiple numbered PtP interfaces with the same IP address between the same two routers. - Use Unnumbered PtP on just one end of the link. - Faster OI lookup for the OSPF interface and only done once for PtoP links. *ospf_interface.h: (struct ospf_interface) Add storage for storing router LSA position. *ospf_interface.c: (ospf_if_lookup_by_lsa_pos) lookup OSPF I/F in an area using LSA position. (ospf_lsa_pos_set) assign LSA position to OSPF interface. *ospf_lsa.c: (router_lsa_link_set) Call ospf_lsa_pos_set() to record LSA position. *ospf_spf.c: (ospf_spf_next) Count and pass along lsa position. (ospf_nexthop_calculation) Add lsa position argument. call ospf_if_lookup_by_lsa_pos() for OSFP interface handle. Clean up and remove all calls ospf_if_is_configured() the rest. Adjust a few debug logs.
| | * | | ospfd: Update SPF calculation for unnumbered linksJoakim Tjernlund2010-02-043-44/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for real unnumbered PtP interfaces in ospf_nexthop_calculation(). Add ospf_if_lookup_by_ifindex() to support Unnumbered PtP links. This version does not support: - Multiple numbered PtP interfaces with the same IP address between the same two routers. - Unnumbered PtP on just one end of the link. * ospfd/ospf_interface.c: Add ospf_if_lookup_by_ifindex(). * ospfd/ospf_interface.h: ditto. * ospfd/ospf_spf.c: ospf_nexthop_calculation (), call ospf_if_lookup_by_ifindex() for Unnumbered PtP links.
| | * | | ospfd: External routes over PtoP must be directly connected.Paul Jakma2010-02-042-25/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Fri, 31 Jul 2009, Joakim Tjernlund wrote: > How can I do that? ASE is screwing with the P2P route and needs > some fixing. Perhaps you are suggesting to remove the check in ase > all togher(delete the whole for loop) and place it somewhere else? > I haven't looked at that possiblity and I am not convinced that it > is a good idea either. Well, what I'm curious about is how you don't see a similar issue with non-AS-external routes? Indeed, I wonder why we can't just apply your check much earlier - as/when we add routes to the intra-area routing table - and just get rid of that complete_direct_routes thing altogether. > ASE is forcing a nexthop.s_addr when it should not. So would this perhaps fix it too (and if so, possibly fix similar issues with other kinds of routes too)?: REPLACES "External routes over PtoP must be directly connected." by Joakim Tjernlund As all locally routes over PtoP interfaces are interface routes, one must also make sure that external routes over PtoP interfaces are directly connected. Cc: David Lamparter <equinox@diac24.net>
| | * | | ospfd: Do not free area too early.Joakim Tjernlund2010-02-041-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Freeing the area resets all LSAs seq number. Wait until the area has no more configured interfaces before freeing it. PPP intefaces are usally deleted when they go down and created again when the come up. Avoid freeing the area and resetting the seq number due to number of active interfaces drops to zero temporairly.
| | * | | ospfd: add missing ospf_interface_[un]set prototypesDavid Lamparter2010-02-041-0/+3
| | | | |
| | * | | ospfd: Impl. command ip ospf areaJoakim Tjernlund2010-02-043-62/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use with interface command: interface ppp0 ip ospf area 0.0.0.0 This will enable OSPF on ppp0 with area 0.0.0.0 Remove with "no ip ospf area"
| | * | | ospfd: Do not send host routes on unnumbered PtP I/F'sJoakim Tjernlund2010-02-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to Acee Lindem, chairing the OSPF WG on IETF, one should not transmit Option 1 as described in 12.4.1.1. The text is unfortunately a bit unclear but the intention of the spec was not to emit Option 1 (nor Option 2) Changed to use CHECK_FLAG by David Lamparter. Cc: David Lamparter <equinox@diac24.net>
| | * | | ospfd: Test for ZEBRA_INTERFACE_UNNUMBEREDJoakim Tjernlund2010-02-041-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In lsa_link_ptop_set() and add ifindex to LSA if set. Changed to use CHECK_FLAG by David Lamparter. Cc: David Lamparter <equinox@diac24.net>
| | * | | zebra, lib: Add ZEBRA_INTERFACE_UNNUMBERED interface flag.Joakim Tjernlund2010-02-042-0/+14
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use interface <ifname> "unnumbered" command to set unnumbered mode. "no unnumbered" will clear it. Changed to use *_FLAG macros by David Lamparter. Cc: David Lamparter <equinox@diac24.net>
| * | | Merge branch 'patches/jt_ospf-fixes-20091129' into ospf-merge-3David Lamparter2010-02-0415-457/+313
| |\ \ \ | | | |/ | | |/|
| | * | ospfd: actually add nbr to nbrs list.Joakim Tjernlund2010-02-041-0/+1
| | | |
| | * | ospfd: PointToPoint neighbors are identified by router ID.Joakim Tjernlund2010-02-041-3/+5
| | | | | | | | | | | | | | | | | | | | According to RFC 2328, section 10.5 PointToPoint neighbors should be identified by router ID instead of source IP address.
| | * | ospfd: fix ospf SNMP support broken by prev 2 commitsDavid Lamparter2010-02-041-12/+9
| | | | | | | | | | | | | | | | | | | | ospf_snmp.c uses ospf_neighbor->address and still has the route_nodes list code. fix it up to match current code.
| | * | ospfd: delete address in struct ospf_neighborJoakim Tjernlund2010-02-049-56/+44
| | | | | | | | | | | | | | | | | | | | address is the same as src so it is redundant. This will save both memory and CPU when processing Hellos.
| | * | ospfd: fix opaque-LSA broken by route_node -> listDavid Lamparter2010-02-041-12/+9
| | | | | | | | | | | | | | | | | | | | ospf_opaque.c needs to be updated for moving from route_node to a regular list.
| | * | ospfd: replace route_nodes with a listJoakim Tjernlund2010-02-0410-348/+227
| | | | | | | | | | | | | | | | | | | | | | | | It is wasteful to use route nodes for something as simple as a neighbor list. Replace with a list.
| | * | ospfd: fix ospf_nbr_lookup_by_addr()Joakim Tjernlund2010-02-031-21/+8
| | | | | | | | | | | | | | | | | | | | | | | | ospf_nbr_lookup_by_addr() included routerID while searching. That is not the intention of this function so change it to only search for IP addresses.
| | * | ospfd: ospf_hello() should only kick state machine once.Joakim Tjernlund2010-02-031-23/+28
| | |/ | | | | | | | | | | | | The 2 last bullets in RFC 2328, section 10.5 are mutually exclusive, make is so.
| * | ospfd: Add new host route commandJoakim Tjernlund2010-02-045-3/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add static host routes into router LSA. See RFC 2328 chapter 12.4 and Appendix C.7 Syntax: router ospf ip ospf host A.B.C.D area (A.B.C.D|<0-4294967295>|all) cost <0-65535> no ip ospf host A.B.C.D area (A.B.C.D|<0-4294967295>|all) * ospfd/ospf_route.h: Add struct ospf_host_route * ospfd/ospf_lsa.c: (router_lsa_link_set) Add host routes to Router LSA. * ospfd/ospf_vtc.c: Impl. ip_ospf_host_cmd and no_ip_ospf_host_cmd. (ospf_config_write) Write out host routes to config. * ospfd/ospf_ospfd.c: (ospf_new) Allocate new host route list. (ospf_finish_filnal) Free host list. (ospf_area_check_free) Check if any host routes in area before freeing. * ospfd/ospf_ospfd.h: Add a host list to struct ospf.
| * | ospfd: invalid MD5 auth_key?Joakim Tjernlund2010-02-041-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | This looks fishy in ospf_make_md5_digest() if (list_isempty (OSPF_IF_PARAM (oi, auth_crypt))) auth_key = (const u_int8_t *) ""; ... MD5Update(&ctx, auth_key, OSPF_AUTH_MD5_SIZE); auth_key points to a "" string of len 1 which is a lot smaller that OSPF_AUTH_MD5_SIZE. Is this intentional to get some random data or just a plain bug? Anyone using MD5 should have a closer look and decide what to do.
* | lib: fs namespacing 3/5: use path_state for zserv socketDavid Lamparter2010-02-041-1/+7
| | | | | | | | | | | | this uses the path_state helper for determining the path of quagga's zserv.api socket. this allows for running multiple instances of zebra each with its own interface.
* | lib: fs namespacing 2/5: use path_state for vty pathsDavid Lamparter2010-02-043-5/+13
| | | | | | | | | | | | use the path_state helper functions for determining vty socket paths in all quagga daemons. this allows for running multiple daemons if a namespace name is set.
* | lib: put route_types.txt to real useDavid Lamparter2010-02-031-31/+16
|/ | | | | | | this replaces most occurences of routing protocol lists by preprocessor defines from route_types.h. the latter is autogenerated from route_types.txt by a perl script (previously awk). adding a routing protocol now is mostly a matter of changing route_types.txt and log.c.
* ospfd: Fix debug messages that were masked by DISCARD_LSAPaul Jakma2010-01-141-3/+4
| | | | | * ospf_packet.c: (ospf_ls_upd) DISCARD_LSA continues, and so should be after debug messages, not before them.
* ospfd: remove unneeded memset from a very hot functionPaul Jakma2010-01-141-1/+0
| | | | | | * ospf_lsdb.c: (lsdb_prefix_set) memset is unneeded, as all fields are initialised explicitly, and this function can be in the top-3 of a profile when there are a lot of LSAs.
* ospfd: VTY strings cleanupStephen Hemminger2009-12-031-15/+2
| | | | Several bits of text can be local or are unused.
* ospfd: comment out unused functionStephen Hemminger2009-12-031-0/+2
|
* ospfd: make local functions staticStephen Hemminger2009-12-032-55/+8
| | | | | | | | | This code is only used one place and can be made local. Gcc is smart enough to inline local functions if it wants to. The function also has a big chunk of compatiablity code that is no longer used; since quagga is now in a version control system the source does not need to be used as a historical reference.
* [ospfd] enable more OSPF cost command aliasesDenis Ovsienko2009-09-281-0/+88
| | | | | | | | | | | | The following syntax forms were not historically supported by Quagga, although IOS accepted them w/o a problem: no ip ospf cost <1-65535> no ospf cost <1-65535> no ip ospf cost <1-65535> A.B.C.D no ospf cost <1-65535> A.B.C.D From now on Quagga also supports these variants.
* ospfd: Make sure priority is respected.Joakim Tjernlund2009-08-281-1/+1
| | | | | * ospf_ism.c (ospf_dr_eligible_routers) should test for priority > 0 instead of != 0 as ospf_nbr_new () initially sets prio to -1
* ospfd: Tighten up the connected check for redistributionJoakim Tjernlund2009-08-281-8/+5
| | | | | | * ospf_zebra.c: (ospf_distribute_check_connected) check to make filter out routes matching connected routes was matching against OSPF networks, which can be far more general than the actual connected interfaces. Fix.
* all: check return value from daemon() callStephen Hemminger2009-08-131-2/+5
| | | | | | * */*main.c: (main) Current versions of Gcc warn if the return value for daemon() is not checked. So add a simple test and exit on failure.
* ospfd: fix performance problem with redistribute deleteStephen Hemminger2009-08-132-14/+4
| | | | | | | | | | | | Doing redistribute delete with full BGP table was taking 30 minutes, this drops it down to less than a second. * ospf_lsa.c: (ospf_lsa_maxage) When flushing lots of entries the performance is terrible because it looks up each LSA entry through ospf_lsa_maxage_exist before deleting causing O(N^2) performance. Use a new OSPF_LSA_MAXAGE flag instead of scan - and maintain it. (ospf_lsa_maxage_exist) removed (ospf_lsa_maxage_delete) maintain OSPF_LSA_MAXAGE flag
* ospfd: Make sure route table is recalculated.Joakim Tjernlund2009-08-111-18/+23
| | | | | | | | | | | | | | | In some cases ospfd does not recalc the route table. This happens when ospfd receives an old LSA which will trigger recalc but the this recalc will fail because all interfaces isn't up yet. Next LSA that is originated matches the old one so no recalc will be performed. This problem has been observed when there are only 2 ppp I/Fs in an area, both go down at the same time, then they come up again with a few seconds apart. * ospf_lsa.c: (ospf_{router,network}_lsa_install) avoid a needless scheduling of SPF. (ospf_lsa_different) fix bug in LSA comparison that would lead to the described failure to schedule SPF.
* ospfd: Make "Packet ... received on wrong link" conditional on debugPaul Jakma2009-08-111-2/+3
| | | | | | * ospf_packet.c: make this message conditional on 'debug ospf event', as it be easily triggered with, e.g., multiple subnets sharing same physical network. E.g, see bug #532.