summaryrefslogtreecommitdiff
path: root/ospfd/ospf_lsa.c
AgeCommit message (Collapse)Author
2006-07-04[ospfd] CID #13, dont try print out fields of LSA we know to be NULL.Paul Jakma
2006-07-02 Paul Jakma <paul.jakma@sun.com> * ospf_lsa.c: (ospf_translated_nssa_refresh) CID #13.
2006-06-26[ospfd] NSSA translate-enabled ABR should declare itself as ASBRPaul Jakma
2006-06-26 Paul Jakma <paul.jakma@sun.com> * ospf_abr.c: (general) NSSA translate-candidate ABRs need to be ASBRs, or other routers may rightfully refuse to install translated type-5s LSAs. reported by dendroot@gmail.com. (ospf_abr_nssa_check_status) Detect change in translator state when ABR, and inc/dec redistribute count as when we leave/enter the disabled state - so that translate-enabled ABR properly sets ASBR bit on non-NSSA areas. Run the resulting function through indent to clean it up. * ospf_lsa.c: (router_lsa_flags) For purposes of ASBR bit, NSSA area is same as stub area.
2006-06-15[ospfd] lsdb_delete/discard_from_db should be more robust to bad argsPaul Jakma
2006-05-31 Paul Jakma <paul.jakma@sun.com> * ospf_lsdb.c: (ospf_lsdb_delete) robustify against NULL arguments, print warning. * ospf_lsa.c: (ospf_discard_from_db) ditto. (ospf_maxage_lsa_remover) Check lsa->lsdb for validity, possible mitigation (but not solution) for bug #269.
2006-05-12[ospfd] Fix small error in CID #13 commitPaul Jakma
2006-05-13 Paul Jakma <paul.jakma@sun.com> * ospf_lsa.c: (ospf_translated_nssa_refresh) fix the sanity check to match the assert, small error in CID #13 fix.
2006-05-12[ospfd] CID #13, debug for NULL type7 LSA should not print out data from itPaul Jakma
2006-05-12 Paul Jakma <paul.jakma@sun.com> * ospf_lsa.c: (ospf_translated_nssa_refresh) Add non-assert sanity check, in case DEBUG isn't defined. Debug message when no type7 exists should print the ID from the type5, not the type7, fixes CID #13.
2006-05-12[ospfd] CID #29, fix missing NULL check by removing unused code.Paul Jakma
2006-05-12 Paul Jakma <paul.jakma@sun.com> * ospf_lsa.c: (ospf_lsa_action) Get rid of the ospf_lookup call, which is not checked for NULL return, by stripping out functionality which is never used, hence fixing Coverity CID #29. (struct lsa_action) remove unused member.
2006-05-12[ospfd] Squash another ospf_lookup callPaul Jakma
2006-05-11 Paul Jakma <paul.jakma@sun.com> * ospf_lsa.c: (ospf_default_originate_timer) Let the thread take (struct ospf *) as thread argument, rather than (struct ospf *)->default_originate, thus avoiding having to call ospf_lookup. * ospf_zebra.c: (ospf_redistribute_default_set) change setup of ospf_default_originate_timer thread to match. * ospfd.c: (ospf_router_id_update) ditto.
2006-03-30[ospfd] Fix failure of Fletcher checksum with certain compilersPaul Jakma
2006-03-27 Paul Jakma <paul.jakma@sun.com> * ospf_lsa.c: (ospf_lsa_checksum) Add an explicit cast to avoid the ambiguities of ANSI and C99 C with respect to type conversion. Detailed problem report and test case with example data supplied by Dmitry Ivanov <dimss@telecentrs.lv>.
2006-03-30[ospfd] Fix incorrect byte-order conversion of OSPF_MAX_SEQUENCE_NUMBERPaul Jakma
2006-03-23 Steve Lawson <steve.lawson@aheadcomusa.com> * ospf_lsa.c: (ospf_lsa_install) Fix incorrect byte-order conversion of OSPF_MAX_SEQUENCE_NUMBER
2006-01-19[compiler] miscellaneous trivial compiler warning fixespaul
2006-01-19 Paul Jakma <paul.jakma@sun.com> * (general) various miscellaneous compiler warning fixes. Remove redundant break statements from switch clauses which return. return from main, not exit, cause it annoys SOS. Remove stray semi-colons which cause empty-statement warnings. * zebra/main.c: (sighup) remove private declaration of external function.
2006-01-18[ospfd] Add support for oversized LSAs.paul
2006-01-18 Juergen Kammer <j.kammer@eurodata.de> * ospf_lsa.c: (ospf_router_lsa_new) dont take reference to the stream data until it is constructed, data reference is volatile due to the potential resize in link_info_set 2006-01-18 Paul Jakma <paul.jakma@sun.com> * ospf_lsa.c: (link_info_set) Resize the stream if required and possible. Return number of links added. (lsa_link_*_set) use return value from previous. * ospf_lsa.h: Add OSPF_ROUTER_LSA_LINK_SIZE define.
2005-11-202005-11-20 Paul Jakma <paul.jakma@sun.com>paul
* ospf_abr.c: (ospf_abr_announce_network_to_area) check returned LSA of ospf_summary_lsa_refresh and print warning if it failed. (ospf_abr_announce_network_to_area) similar (ospf_abr_announce_rtr_to_area) similar * ospf_lsa.c: (ospf_router_lsa_new) check LSA returned is valid. (ospf_router_lsa_originate) similar (ospf_router_lsa_refresh, ospf_network_lsa_new) similar (ospf_summary_lsa_new) Check ID is valid. (ospf_summary_lsa_originate) ditto, and check returned LSA from previous function is !NULL. (ospf_summary_lsa_refresh) check ospf_summary_lsa_new return is !NULL. (ospf_summary_asbr_lsa_new) ID valid check. (ospf_summary_asbr_lsa_originate) similar.
2005-10-292005-10-29 Paul Jakma <paul.jakma@sun.com>paul
* (general) RFC3137 stub-router support * ospfd.h: Add OSPF_OUTPUT_COST_INFINITE define. (struct ospf_master) Add a OSPF_MASTER_SHUTDOWN flag for options, to allow shutdown to distinguish between complete shutdown and shutdown of a subset of ospf instances. (struct ospf) Add stub_router_{startup,shutdown_}time, configuration of startup and shutdown time for stub-router. Add t_graceful_shutdown struct thread, timer for graceful shutdown, if needed. (struct ospf_area) Add stub_router_state - run time state of stub-router for an area. Add flags for ADMIN, IS and WAS states. Add t_stub_router, timer thread to resend router-lsa for an area. * ospf_lsa.c: (ospf_link_cost) new simple function to spit out either the given lnks cost or infinite cost if stub-router is in effect. (lsa_link_{ptop,broadcast,virtuallink,ptomp}_set) use previous function for transit-links. (ospf_stub_router_timer) timer thread for end of startup stub router. Change state as required for the area and setup re-origination of router-lsa. (ospf_stub_router_check) Check/do whether stub-router should be enabled, and whether it requires timer to be setup. (ospf_router_lsa_new) call previous function at top. (ospf_router_lsa_originate) no external callers, made static. * ospf_lsa.h: (ospf_router_lsa_originate) removed. * ospf_main.c: (sigint) make static. remove call to exit, as ospf_terminate now deals with exiting. * ospf_route.c: (ospf_terminate) removed, now in ospfd.c. * ospf_vty.c: (show_ip_ospf_area) print out state of stub-router, if active. (show_ip_ospf) print out configuration of stub-router support, and details of graceful-shutdown if the timer is active. ((no)?ospf_max_metric_router_lsa_{admin,startup,shutdown}) new commands to (de-)?configure stub-router support. (config_write_stub_router) write out config of stub-router. (ospf_config_write) call previous. (ospf_vty_init) install the new stub-router commands. * ospfd.c: various functions made static. (ospf_new) Set defaults for stub-router. Graceful shutdown is made to default on, just to be adventerous. (ospf_graceful_shutdown_finish) new function, final part of shutdown. (ospf_graceful_shutdown_timer) timer thread wrapper for graceful-shutdown. (ospf_graceful_shutdown_check) check whether to setup timer for shutdown or proceed directly to final shutdown. (ospf_terminate) moved here from ospf_route.c, call ospf_finish for each instance. (ospf_finish) renamed to ospf_finish_final and made static. (ospf_finish) new function, exported wrapper around ospf_graceful_shutdown_check. (ospf_finish_final) complete shutdown of an instance. Add missing TIMER_OFF's of two timer threads. (ospf_area_free) opaque self lsa timer should be turned off.
2005-09-192005-09-19 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* ospf_lsa.h: (ospf_external_lsa_flush) Comment out the 5th argument (nexthop) since it is not used in the function (except inside some commented-out code). * ospf_lsa.c: (ospf_external_lsa_flush,ospf_external_lsa_refresh) Comment out the 5th argument to ospf_external_lsa_flush. * ospf_asbr.c: (ospf_redistribute_withdraw) Comment out 5th arg to ospf_external_lsa_flush. * ospf_vty.c: (no_ospf_default_information_originate) Eliminate 5th uninitialized nexthop arg to ospf_external_lsa_flush. * ospf_zebra.c: (ospf_zebra_read_ipv4) Comment out 5th arg to ospf_external_lsa_flush. * ospfd.c: (ospf_network_set) Comment out 5th arg to ospf_external_lsa_flush.
2005-05-112005-05-11 Paul Jakma <paul.jakma@sun.com>paul
* (general) Fix memory leaks in opaque AS-scope LSAs, reported and with much debugging done by by scott collins <scollins@agile.tv>. (possible backport candidate?) * ospf_lsa.c: (ospf_discard_from_db) dont call ospf_ase_unregister_external_lsa for opaque-lsa's, opaques are never registered with ase in the first place. * ospf_packet.c: (general) Disabuse opaque related code of its tendency to try gather up things into temporary lists. (ospf_ls_upd) remove the temporary lists opaque uses, call opaque functions inline, just like all other types. (ospf_ls_ack) ditto. (ospf_recv_packet) fixup sign warning. * ospf_opaque.c: (general) fix the unneeded use of lists, and untwist some of the logic. (ospf_opaque_self_originated_lsa_received) take a single LSA as argument, not a list of them. Remove the list loop. Logic otherwise unchanged. (ospf_opaque_ls_ack_received) Mostly ditto. But untwist the logic, move the actions up into the switch block, remove the goto's and sanitise the logic near the end a bit. * ospf_opaque.h: Adjust definitions of aforementioned functions in ospf_opaque.c to match.
2005-05-062005-05-06 Paul Jakma <paul.jakma@sun.com>paul
* (general) extern and static qualifiers added. unspecified arguments in definitions fixed, typically they should be 'void'. function casts added for callbacks. Guards added to headers which lacked them. Proper headers included rather than relying on incomplete definitions. gcc noreturn function attribute where appropriate. * ospf_opaque.c: remove the private definition of ospf_lsa's ospf_lsa_refresh_delay. * ospf_lsa.h: export ospf_lsa_refresh_delay * ospf_packet.c: (ospf_make_md5_digest) make *auth_key const, correct thing to do - removes need for the casts later. * ospf_vty.c: Use vty.h's VTY_GET_INTEGER rather than ospf_vty's home-brewed versions, shuts up several warnings. * ospf_vty.h: remove VTY_GET_UINT32. VTY_GET_IPV4_ADDRESS and VTY_GET_IPV4_PREFIX moved to lib/vty.h. * ospf_zebra.c: (ospf_distribute_list_update_timer) hacky overloading of the THREAD_ARG pointer should at least use uintptr_t.
2005-04-072005-04-07 Paul Jakma <paul.jakma@sun.com>paul
* (global): Fix up list loops to match changes in lib/linklist, and some basic auditing of usage. * configure.ac: define QUAGGA_NO_DEPRECATED_INTERFACES * HACKING: Add notes about deprecating interfaces and commands. * lib/linklist.h: Add usage comments. Rename getdata macro to listgetdata. Rename nextnode to listnextnode and fix its odd behaviour to be less dangerous. Make listgetdata macro assert node is not null, NULL list entries should be bug condition. ALL_LIST_ELEMENTS, new macro, forward-referencing macro for use with for loop, Suggested by Jim Carlson of Sun. Add ALL_LIST_ELEMENTS_RO for cases which obviously do not need the "safety" of previous macro. LISTNODE_ADD and DELETE macros renamed to ATTACH, DETACH, to distinguish from the similarly named functions, and reflect their effect better. Add a QUAGGA_NO_DEPRECATED_INTERFACES define guarded section with the old defines which were modified above, for backwards compatibility - guarded to prevent Quagga using it.. * lib/linklist.c: fix up for linklist.h changes. * ospf6d/ospf6_abr.c: (ospf6_abr_examin_brouter) change to a single scan of the area list, rather than scanning all areas first for INTER_ROUTER and then again for INTER_NETWORK. According to 16.2, the scan should be area specific anyway, and further ospf6d does not seem to implement 16.3 anyway.
2005-03-132005-03-13 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* ospf_lsa.c: (ospf_lsa_refresh_walker) If the system clock jumps backward, then current time may be less than ospf->lsa_refresher_started. This was causing invalid values for ospf->lsa_refresh_queue.index resulting in infinite loops. Problem fixed by casting the expression to unsigned before taking the modulus. [backport candidate]
2005-02-092005-02-09 Paul Jakma <paul.jakma@sun.com>paul
* (global) Update code to match stream.h changes. stream_get_putp effectively replaced with stream_get_endp. stream_forward renamed to stream_forward_getp. stream_forward_endp introduced to replace some previous setting/manual twiddling of putp by daemons. * lib/stream.h: Remove putp. Update reference to putp with endp. Add stream_forward_endp, which daemons were doing manually. Rename stream_forward to stream_forward_getp. lib/stream.c: Remove/update references to putp. introduce stream_forward_endp.
2004-12-22Show sums of checksums in "show ip ospf" output. Okayed by Paul and Jameshasso
R. Leu (author of original idea).
2004-12-082004-12-08 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* *.c: Change level of debug messages to LOG_DEBUG.
2004-10-19OK. Here it is - PtP patch from Andrew J. Schorr. No problems with ospfd,hasso
ripd might need some more testing though.
2004-10-08Compiler warnings fixes round 1.hasso
2004-09-26Compiler warnings fixes.hasso
2004-09-23Remove usage of evil list and listnode typedefs.hasso
2004-06-20Remove ifdef's HAVE_NSSA. NSSA support is stable enough.hasso
2004-06-062004-06-06 Paul Jakma <paul@dishone.st>paul
* ospf_dump.c,ospf_lsa.c: Fix typos of merge of previous. ospf_flood.c: (ospf_process_self_originated_lsa) fix zlog format.
2004-05-312004-05-31 Sagun Shakya <sagun.shakya@sun.com>paul
* ospf_dump.c: (ospf_lsa_header_dump) LOOKUP can return null if index is out of range. ospf_flood.c: endianness fix ospf_lsa.c: Missing ntohl's on (struct lsa *)->data->ls_seqnum in various places.
2003-10-132003-10-13 sowmini.varadhan@sun.compaul
* ospf_lsa.h: Add OSPF_LSA_PREMATURE_AGE flag. * ospf_lsa.c: added better debug comments. check sequence number in ospf_lsa_install. ospf_maxage_lsa_remover() checks for OSPF_LSA_PREMATURE_AGE and re-originates the lsa after ls_acks are received. * ospf_flood.c: improve debug statement- print ls_seqnum.
2003-07-132003-07-13 Paul Jakma <paul@dishone.st>paul
* ospf_lsa.c: fix up some places where an NSSA specific define, (OSPF_LSA_LOCAL_XLT) was referenced in if statements without being ifdef'ed by HAVE_NSSA.
2003-07-122003-07-12 Paul Jakma <paul@dishone.st>paul
* (global): Add/fixup NSSA ABR translation functionality * ospfd.h: Adjust the NSSA ROLE defines. Rename STATE to TRANSLATE. Rename the LSA_NSSA_GET define to LSA_OPTIONS_NSSA_GET. * ospfd.c: Adjust to match changes to ospfd.h * ospf_te.c: Adjust to match change to LSA_NSSA_GET. * ospf_lsa.h: slights reformatting. Add new NSSA functions, ospf_translated_nssa_compare() (not currently used), ospf_translated_nssa_refresh() and ospf_translated_nssa_originate(). * ospf_lsa.c: Implemented aforementioned new functions. Fix up several NSSA hooks to /not/ be called for Type-5s which are translated. Add additional hooks. Set the ROUTER_LSA_NT bit in router-lsa flags if ABR does translation. New function, ospf_lsa_translated_nssa_new() implemented. Dont register translated LSAs for refreshing - instead we implicitly rely on the ASBR refreshing the Type-7, and refresh the translated Type-5 at the same time. Some minor reformatting. Extra debug info added. Also, existing debug statements modified to report LSA Id. * ospf_flood.c: call ospf_translated_nssa_refresh() when refreshing Type-7. minor reformatting. * ospf_dump.c: Dump NSSA LSAs. * ospf_asbr.h: slight reformatting. Export ospf_external_route_lookup() (though, not used. probably will undo this). * ospf_abr.c: Slight reformatting in many places. Update to match ospfd.h changes. (ospf_abr_translate_nssa): make it work, using the new ospf_lsa translation functions. (Several places): change struct prefix * to struct prefix_ipv4 *. (might as well do the casts at higher levels). Add more debug info. (ospf_abr_announce_stub_defaults): announce default to NSSA areas too. (ospf_abr_announce_nssa_defaults): do nothing. this function probably should die. (see ospf_abr_announce_stub_defaults). (ospf_abr_task_timer): run NSSA tasks.
2003-07-03Don't install Type-7 LSA's into nonNSSA area.hasso
2003-06-222003-06-19 Paul Jakma <paul@dishone.st>paul
* ospf_lsa.c (router_lsa_flags): Set the correct flags for router-lsa's. Eg OSPF_FLAG_ASBR is /not/ an LSA flag, its an internal ospfd flag (just happens to have same value as ROUTER_LSA_EXTERNAL). Set ROUTER_LSA_EXTERNAL for ASBRs, ROUTER_LSA_BORDER for ABRs and ROUTER_LSA_NT for NSSA ABRs which are OSPF_NSSA_ROLE_ALWAYS translators.
2003-05-16From: Hasso Tepper <hasso@estpak.ee>paul
Subject: [zebra 19091] [PATCH] NSSA fixes try2 NSSA didn't work without problems even after my previous fixes. Seems that I tracked down problems finally.
2003-05-11Fix merge error of Hasso's patch "case case" :)paul
2003-05-10From: Hasso Tepperpaul
Fix removal of Type-7 LSAs, http://bugzilla.dishone.st/show_bug.cgi?id=18
2003-05-06Reverting the NSSA maxage walker loop addition for now, until all the otherpaul
problems with NSSA are resolved, and we can determine whether this had any point.
2003-05-06NSSA /might/ be missing this. I'm not sure.paul
It didnt solve a particular problem of Hasso's, but i'm committing it just for posterities sakes, so i dont lose it (i'll revert it immediately).
2003-04-13From: Hasso Tepper <hasso@estpak.ee>paul
To: zebra@zebra.org Subject: [zebra 18648] [PATCH] Selforiginated Type-7 LSA's are not flushed from lsdb
2003-04-13Author: amirpaul
Date: 2003-04-10 14:32:31 +0200 (Thu, 10 Apr 2003) New Revision: 212 Modified: zebra-ag/trunk/ospfd/ospf_lsa.c Log: I've fixed a small opaque lsa bug which got triggered when deleting opaque lsa of type 11. It used area->ospf->.. when area was null. This was replaced by a ospf = ospf_lookyp(); ospf->...
2003-04-05Add tests for debug enabled to PtMP LSA creation functionspaul
2003-04-042003-04-04 Paul Jakma <paul@dishone.st>paul
* Sync to Zebra CVS * Fix lib/thread.h leak * Fix small Opaque LSA leak * Do not configure OSPF interfaces for secondary addresses * vtysh fixes from Hasso * Dave Watson's missing ntohs fix
2003-04-03From: David Watson <dwatson@eecs.umich.edu>paul
Subject: [zebra 18573] PATCH ospfd: byte order error in assert statement I found a bug in the ospfd code tickled this morning by a Type 1 LSA with exactly 62 entries (LSA length of 768, or 0x0300). A missing ntohs in ospf_lsa.c:ospf_lsa_different() causes an assert statement to fail, stopping ospfd. > assert (l1->data->length > OSPF_LSA_HEADER_SIZE); So, a length of type 768 turns into a length of 3 which is obviously less than 20. David
2003-03-252003-03-25 Paul Jakma <paul@dishone.st>paul
* sync to latest zebra CVS * spec file: updated and added define for ospf-api/client NB: OSPF-API has been broken by the zebra.org changes, which has added struct ospf * as a new arg to many functions
2003-02-13Fix debug statement in ospf_packet.c and merge error in ospf_lsa.cpaul
2003-02-03Merge to zebra.org CVS 20030203 16:30GMTpaul
2003-01-18Date: Fri, 20 Dec 2002 17:28:45 +0900paul
From: Masahiko Endo <endo@suri.co.jp> Reply-To: zebra@zebra.org To: zebra@zebra.org Cc: kunihiro@zebra.org, yokota@kddlabs.co.jp Subject: [zebra 16823] [PATCH] Bugfix and new feature in Opaque-LSA handling. ----- * ----- * ----- * ----- * ----- * ----- * ----- * ----- * ----- * ----- Changes 2002.12.20 1. Bug fixes 1.1 When an opaque LSA is being removed from (or added to) the LSDB, it does not mean a change in network topology. Therefore, SPF recalculation should not be triggered in that case. There was an assertion failure problem "assert (rn && rn->info)" inside the function "ospf_ase_incremental_update()", because the upper function "ospf_lsa_maxage_walker_remover()" called it when a type-11 opaque LSA is removed due to MaxAge. 1.2 Type-9 LSA is defined to have "link-local" flooding scope. In the Database exchange procedure with a new neighbor, a type-9 LSA was added in the database summary of a DD message, even if the link is different from the one that have bound to. 2. Feature enhancements 2.1 Though a "wildcard" concept to handle type-9/10/11 LSAs altogether has introduced about a year ago, it was only a symbol definition and actual handling mechanism was not implemented. Now it works.
2002-12-13 Kevin C Miller <kevinm@andrew.cmu.edu>paul
[zebra 16681] OSPF NSSA Patches
2002-12-13zebra link state detection supportpaul
2002-12-13ospfd Point-to-Multipoint supportpaul