summaryrefslogtreecommitdiffstats
path: root/ospfd
Commit message (Collapse)AuthorAgeFilesLines
* [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.
* ospfd: neuter some compiler warningsPaul Jakma2009-08-031-38/+1
| | | | | | * ospf_lsa.c: (link_info_set) Use %zd for size_t - C99 is old enough now. Lots of similar warnings all over the code. (ospf_lsa_translated_nssa_compare) Unused func - delete.
* ospfd: update some commentsPaul Jakma2009-08-032-7/+17
| | | | | * ospf_{spf,lsa}.c: remove out of date comment; add comment on some non-obvious code; Make note of a possible scaling problem.
* ospfd: Change struct ospf_path *oi to ifindex.Joakim Tjernlund2009-08-037-31/+34
| | | | | | * global: In struct ospf_path, change struct ospf_interface *oi to int ifindex. It is unsafe to reference *oi as an ospf interface can be deleted under your feet. Use a weak reference instead.
* ospfd: Discriminate better when selecting links between vertices in SPFJoakim Tjernlund2009-07-301-7/+5
| | | | | | | | * ospf_spf.c: (ospf_get_next_link) One must check the vertex type, Router or Network, to select type link to match against. Link type 1 has neighbour router ID in link_id and link type 2 has IP address of DR. Since router id may have same value as an existing IP address one risks matching a router ID against a DR.
* ospfd: Make ospf_if_lookup_recv_if() find the right unnumbered i/fJoakim Tjernlund2009-07-283-8/+15
| | | | | | | | | | | | | | | This function will return the interface for the first matching remote address for PtP i/f's. That won't work for multiple unnumbered i/f's as these may all have the same address. Pass in the struct interface pointer, ifp, to find the correct set of oi's to search in. This also reduces the size of the search list, making it faster. * ospfd/ospf_interface.c: Add struct interface * param to ospf_if_lookup_recv_if() to select the right list to search in. * ospfd/ospf_interface.h: ditto. * ospfd/ospf_packet.c: Pass new ifp argument to ospf_if_lookup_recv_if()
* ospfd: export ospf_if_table_lookup() and use it in ospf_network_run_interface()Joakim Tjernlund2009-07-283-6/+5
| | | | | | | | | | | Makes it possible to run OSPF on multiple PtP interfaces with the same remote address. * ospfd/ospf_interface.c: Export ospf_if_table_lookup(). * ospfd/ospf_interface.h: ditto. * ospfd/ospfd.c: (ospf_network_run_interface) Use ospf_if_table_lookup() to determine whether OSPF is already configured for a subnet and interface.
* [global] interface flags format warningsStephen Hemminger2009-07-281-3/+4
| | | | | */*: ifp->flags is 64 bit unsigned which can not be handled by %l on 32 bit architectures - requires %ll and the appropriate cast.
* [ospfd] Do not use stale Network/Router LSAsJoakim Tjernlund2009-06-262-8/+8
| | | | | | | | | Should a self originated Network/Router LSA with higher LS seq. nr. be received we should flood and install it in the LSDB but we cannot use it for our internal calculations as it is stale. Reorginate an new LSA to replace the stale one as soon as possible.
* [ospfd] compare ifIndex too when matching pathsJoakim Tjernlund2009-06-252-4/+13
| | | | | | ospf_path_lookup(), ospf_route_match_same() and ospf_ase_route_match_same() needs to compare if the interface matches too.
* [ospfd] external LSA route_unlock_node() fixesJoakim Tjernlund2009-06-251-10/+15
| | | | A few route_unlock_node() calls was missing.
* [ospfd] Fix a few LSA performance "bugs"Joakim Tjernlund2009-06-251-18/+5
| | | | | | | | | | | ospf_lsa_install() will calculate LSA checksum so no need to do it before calling ospf_lsa_install(). Set the OSPF_LSA_SELF_CHECKED flag on own LSA's to save ospf_lsa_is_self_originated() some work. Do not memset() memory that is about to overwritten with memcpy().
* Merge remote branch 'origin/master'Paul Jakma2009-06-241-3/+12
|\
| * [ospfd] discount IP header size from a new LSA pktDmitry Tejblum2009-06-241-3/+12
| |
* | [cleanup] Add log.h includesTomasz Pala2009-06-241-0/+1
|/
* [ospfd] cancel OSPF timer hack in nsm_change_stateDmitry Tejblum2009-06-231-8/+0
| | | | | | | | | | | | | This piece of code causes all Quagga routers on a broadcast link to send a HELLO packet simultaneously if they see a new neighbor. It also resets the HELLO timer, so all the quagga routers will continue to send HELLO packets simultaneously in the future. This is not good (especially on networks with a lot of Quagga routers connected), and is explicitly discouraged by the OSPF standard, RFC 2328 (chapter 4.4.Timers). I suggest to remove the code snippet, it does not provide much benefit anyway.
* [ospfd/BSD] add missing UINT16_MAX - picked up from FreeBSD ports patchJeremy Jackson2009-06-191-0/+2
| | | | | | | | | | | Should probably have AC_TYPE_UINT16_T in configure.ac to make it really clean... and a fresh import of gnulib, the existing copy of gnulib seems to be manually put some stuff in zebra.h. I'm leaving that alone for now, since a fresh import will probably clean up a lot of cruft and it would be a duplicated effort to fix some things now. The FreeBSD port 0.99.11_1 files/patch-ospfd-ospfd.h can probably go away after this is applied.
* [daemons/cleanup] Remove disabled log_mode argument support.Jeremy Jackson2009-06-181-2/+1
| | | | | * */*main.c: Seems that the actual code was removed previously, but the argument processing code remained.
* [OSPF/cleanup] make message lists read onlyStephen Hemminger2009-06-183-23/+23
|
* [ospfd] Fix OSPF route refcount leakStephen Hemminger2009-06-181-1/+2
| | | | | This may fix vyatta BUG 3096. The reference count for OSPF route table was never completely freed on deleting all neighbors.
* [cleanup] Make command nodes staticStephen Hemminger2009-06-122-10/+3
| | | | | The cmd_nodes used to configure vty, can mostly be static so (basic data hiding 101).
* [cleanup] functions taking no args should be declared with void argsStephen Hemminger2009-06-121-1/+1
| | | | | Use Ansi-C prototypes rather than old K&R method of declaring function without arguments
* [cleanup] Convert XMALLOC/memset to XCALLOCStephen Hemminger2009-06-1210-53/+18
| | | | Simple conversion of XMALLOC/memset to XCALLOC
* [snmp] Compiler warning fixes for when "--enable-snmp" is configured.Chris Caputo2009-06-021-54/+70
| | | | | Compiled on 32-bit and 64-bit linux gcc 4.1.2 platforms. No run-time testing on 32-bit and limited run-time testing on 64-bit.
* [ospfd] fix vty ospfd no ospf abr-type standardFrancesco Dolcini2009-06-021-1/+3
| | | | "no ospf abr-type standard" was broken
* Justified OSPF cost function names and added support for:Denis Ovsienko2009-04-101-8/+27
| | | | | ospf cost <1-65535> A.B.C.D no ospf cost <1-65535>
* [ospfd] Fix SEGV during startup introduced in recent commitJoakim Tjernlund2008-09-241-2/+2
| | | | | | | | | * ospfd/ospfd.c: (opsf_if_update) Check if ospf_lookup() returns NULL. Fixes bug introduced with recent ospf_network_run changes in a49eb30a, where SEGV will happen if not the "router ospf" command has been executed before the first interfaces are reported by zebra. Signed-off-by: Paul Jakma <paul@quagga.net>
* [ospfd] Move passive interface checkJoakim Tjernlund2008-09-241-18/+26
| | | | | | | * ospf_packet.c: Apply passive check and drop for all packages and not just Hellos. Signed-off-by: Paul Jakma <paul@quagga.net>
* [ospfd] Minor enhancements to recent self-host-routes suppression patchPaul Jakma2008-09-043-22/+33
| | | | | | | | | * ospf_spf.c: (ospf_spf_process_stubs) Track whether parent router vertex is the root, so that the host-route suppression logic need only be activated for such vertices. Move the actual logic to ospf_intra_add_stub. * ospf_route.c: (ospf_intra_add_stub) Main test of link moved here, notionally more appropriate.
* Merge commit 'remotes/jocke/delete_ghost_route'Paul Jakma2008-09-031-1/+15
|\
| * Ignore host routes to self.Joakim Tjernlund2008-08-251-1/+15
| | | | | | | | | | | | PtP links with /32 masks adds host routes to the remote host, see RFC 2328, 12.4.1.1, Option 1. Make sure that such routes are ignored
* | Merge commit '53d0deceeb855493aa03c59477f8af7f6bb75140'Paul Jakma2008-09-021-6/+14
|\ \
| * | Set destination for PtP links to OSPF_ALLSPFROUTERS.Joakim Tjernlund2008-08-251-6/+14
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update ospf_db_desc_send(), ospf_ls_upd_queue_send() and ospf_ls_req_send() to always use OSPF_ALLSPFROUTERS for PtP links. See RFC 2328, chap 8.1 for details: "The IP destination address for the packet is selected as follows. On physical point-to-point networks, the IP destination is always set to the address AllSPFRouters." Without this, it won't be possible to establish adjacencies on multiple unnumbered links to the same router. ChangeLog: 2008-07-25 Joakim Tjernlund <Joakim.Tjernlund@transmode.se> * ospfd/ospf_packet.c: Set destination for PtP links to OSPF_ALLSPFROUTERS.
* | [ospfd] Restructure opsf_if_update() and ospf_network_run()Joakim Tjernlund2008-09-023-121/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an struct interface paramenter and adjust the affected code accordingly. The old code was a mess looping over all interfaces several times when one interface was added/changed. * ospfd/ospfd.h: Add struct interface parameter to ospf_if_update() * ospfd/ospf_zebra.c: Add ifp arg to ospf_if_update() calls. (ospf_interface_address_delete) delete ospf_if_update() call, redundant as function calls ospf_if_free() itself. * ospfd/ospfd.c: (ospf_network_unset) handle deconfiguration here, rather than ospf_if_update. (ospf_network_run_interface) ospf_network_run, for any given interface. (ospf_network_run) move guts to previous, and use it. (ospf_if_update) Adjust to take struct interface as argument, as all callers have a specific ifp in mind. Iterate over ifp's connected list and call ospf_network_run_interface instead of ospf_network_run, turning this path into O(nm) rather than O(n^2). Adjust all code dealing with opsf_if_update and ospf_network_run to pass the new struct interface * arg. (some minor modifications and bug-additions by Paul Jakma). Signed-off-by: Paul Jakma <paul@quagga.net>
| |
| \
*-. \ Merge commit 'remotes/jocke/ospf_neighbour'; commit ↵Paul Jakma2008-09-012-2/+4
|\ \ \ | |_|/ |/| | | | | 'remotes/jocke/snmp_crosscompile'
| | * Make --enable-snmp cross compile and make libcrypto optional with ↵Joakim Tjernlund2008-08-251-1/+3
| |/ |/| | | | | | | | | | | --without-crypto Autoconfig work by me, the rest was done by "Kirill K. Smirnov" <lich@math.spbu.ru>
| * Fix SEGV in ip ospf neighbor allJoakim Tjernlund2008-08-251-1/+1
|/ | | | | Dont use vty->index in show_ip_ospf_neighbor_all_cmd(), It is invalid, use ospf_lookup() instead.
* [administrivia] Git should ignore backup files and .loT filesPaul Jakma2008-08-221-0/+3
|
* [trivia] Remove ChangeLog files, as this data is now maintained in SCMPaul Jakma2008-08-221-4984/+0
|
* [warnings] Fix various SOS warningsPaul Jakma2008-08-223-3/+3
| | | | | | | | | | | | | 2008-08-15 Paul Jakma <paul.jakma@sun.com> * */*: Fix various problems flagged by Sun Studio compiler. - '<qualifier> <storage>' obsolescent in declarations - empty statements (';' after ALIAS definitions) - implicit declarations (e.g printstack in lib/log.c) - "\%" in printf string instead of "%%" - loops that return on the first iteration (legitimately, but compiler can't really know), e.g. bgp_routemap.c - internal declarations which mask prototypes.
* [lib] mes_lookup string lookup table argument should be marked constStephen Hemminger2008-08-221-9/+2
| | | | | | | | | 2008-08-14 Stephen Hemminger <stephen.hemminger@vyatta.com> * lib/log.{c,h}: struct message argument should point to const * */*.c: adjust to suit, Signed-off-by: Paul Jakma <paul@quagga.net>
* [ospfd] Default route needs to be refreshed after neighbour state changeDaniel Ng2008-08-221-0/+5
| | | | | | | | | 2008-08-13 Daniel Ng <daniel_ng11@lycos.com> * ospf_nsm.c: (nsm_change_state) Refresh default route on state change - a hack, but it works. Signed-off-by: Paul Jakma <paul@quagga.net>
* [ospfd/isisd] Switch to lib/ Fletcher checksum, fixing bug in isisdJingjing Duan2008-08-221-33/+11
| | | | | | | | | | 2008-08-13 Jingjing Duan <Jingjing.Duan@sun.com> * ospfd/: Remove the old checksum implementation and use the consolidated version. * isisd/: ditto, thus fixing isisd checksuming on big-endian. Signed-off-by: Paul Jakma <paul@quagga.net>
* [administrivia] Add .gitignore files, based on .cvsignores.Paul Jakma2008-08-221-0/+14
|