summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_opaque.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: spelchekDavid Lamparter2018-10-251-1/+1
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* *: list_delete_and_null() -> list_delete()David Lamparter2018-10-021-11/+11
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* ospfd: remove unnecessary housekeeping code when using linked listsRenato Westphal2018-09-241-8/+0
| | | | | | | | The head and tail pointers of linked lists should never be modified manually, the linked list API guarantees that these pointers are always valid and up-to-date. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* ospfd: OSPF_[ERR|WARN] -> EC_OSPFQuentin Young2018-09-131-39/+39
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: Convert ospf_opaque.c to use the err-card systemDonald Sharp2018-09-061-91/+107
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: ALLOC calls cannot failDonald Sharp2018-08-111-22/+7
| | | | | | | | There is no need to check for failure of a ALLOC call as that any failure to do so will result in a assert happening. So we can safely remove all of this code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-22/+22
| | | | | | | | | | | | | | | | | | | | | | The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger2018-03-061-40/+37
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* ospfd: Fix ospfd crashOlivier Dugeon2018-02-091-1/+35
| | | | | | | | | | | | | | | | - ospfd/ospf_opaque.c: Update issue #1652 by introducing a new function 'free_opaque_info_owner()' to clean list of callback owner and call this function in appropriate place where 'listdelete_and_null' is not used. - ospfd/ospf_packet.c: In case of crash, ospfd is not been able to flush LSA. In case of self Opaque LSA, when restarting, ospfd crash during the resynchronisation process with its neighbor due to an empty list of LSA to flood. Just add a control on the list count in 'ospf_ls_upd_queue_send()' to escape the function and avoid the problem. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* OSPFd: Fix ospfd crash during CIOlivier Dugeon2018-02-031-0/+9
| | | | | | | | | | | | | | | | | When preforming CI test, CLI command 'no router ospf' followed by a 'router ospf' is performed to clean up the previous configuration. Ospfd crash when configuring 'netwoark area'. This is due to opsf_opaque_term() introduce in previous commit that cause this crash. It remove not only Opaque LSA but also the list through the call to 'list_delete_and_null()' function. Same take place in 'ospf_mpls_te_term()', 'ospf_router_info_term()' and 'ospf_ext_term()' function. New set of 'ospf_XXX_finish()' has been introduced to solve this issue while keeping the possiblity to terminate properly the Opaque LSA and remove MPLS LFIB entries set by Segment Routing. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* OSPFd: Clean up Segment Routing patchOlivier Dugeon2018-01-301-1/+1
| | | | | | | | | | | | | - ospfd/ospf_te.c: Remove unregister function and call to ospf_delete_opaque_functab() following the introduction of ospf_opaque_term() function in ospfd.c for ospfd termination. - ospfd/ospf_sr.c: Set initial index value for node-msd CLI to avaoid crash when using this command - ospfd/ospf_ext.c: Disable call to ospf_sr_update_prefix() if Segment Routing, thus Extended Link/Prefix, is not enable - ospfd/ospf_opaque.c: Correct scheduling of Opaque LSA flooding Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* Merge remote-tracking 'frr/master' into SR-RoutingOlivier Dugeon2018-01-301-24/+0
|\
| * OSPFD: Solve Issue #1652Olivier Dugeon2018-01-231-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue 1652 was related to OSPF Crash on termination when ospf is configured to flood self Opaque LSA e.g TE or RI Opaque LSA. Analysis: The problem resides in free_opaque_info_per_type() line 576 of ospf_opaque.c. Once LSA flush, the function removes by calling listnode_delete() function the opaque_info_per_type data structure. However, this is also performed at the upper level function ospf_opaque_type10lsa_term() which call list_delete_and_null() function. This result into a double free pointer exception. Solution: Remove call to listnode_delete() calls in free_opaque_info_per_type() function as it is done by list_delete_and_null(). Delete lines 592 - 615. Remove also second call to ospf_opaque_type10lsa_term() in ospfd.c line 848. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* | OSPFd: Update Segment Routing PR following reviewOlivier Dugeon2018-01-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following various review, following files have been modfied: - All: Change u_intXX_t typedef to standard uintXX_t types - doc/OSPF-SR.rst: Update doc in particular the Linux Kernel configuration section - doc/ospfd.texi: Update CLI - ospfd/ospf_dump.[c,h]: Add new 'debug ospf sr' when performing 'sh run' - ospfd/ospf_ext.[c, h]: Various bug corrections notably to handle flooding of Extended Prefix at startup. iFix TLVs size for LAN Adjacency. Update Licence as per Community.md - ospfd/ospf_opaque.c: Add proper termination function call to remove MPLS entries - ospfd/ospf_ri.[c,h]: Bug corrections - ospfd/ospf_sr.[c,h]: Various bug corrections, notably to determine the nexthop SR Node. Add support to 'no-php-flag'. Update Licence as per Community.md - ospfd/ospfd.c: Add call to 'ospf_opaque_term()' Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* | OSPFD: Add Experimental Segment Routing supportOlivier Dugeon2018-01-181-3/+22
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an implementation of draft-ietf-ospf-segment-routing-extensions-24 and RFC7684 for Extended Link & Prefix Opaque LSA. Look to doc/OSPF_SR.rst for implementation details & known limitations. New files: - ospfd/ospf_sr.h: Segment Routing structure definition (SubTLVs + SRDB) - ospfd/ospf_sr.c: Main functions for Segment Routing support - ospfd/ospf_ext.h: TLVs and SubTLVs definition for RFC7684 - ospfd/ospf_ext.c: RFC7684 Extended Link / Prefix implementation - doc/OSPF-SRr.rst: Documentation Modified Files: - doc/ospfd.texi: Add new Segment Routing CLI command definition - lib/command.h: Add new string command for Segment Routing CLI - lib/mpls.h: Add default value for SRGB - lib/route_types.txt: Add new OSPF Segment Routing route type - ospfd/ospf_dump.[c,h]: Add OSPF SR debug - ospfd/ospf_memory.[c,h]: Add new Segment Routing memory type - ospfd/ospf_opaque.[c,h]: Add ospf_sr_init() starting function - ospfd/ospf_ri.c: Add new functions to Set/Get Segment Routing TLVs Add new ospf_router_info_lsa_upadte() to send Opaque LSA to ospf_sr.c() - ospfd/ospf_ri.h: Add new Router Information SR SubTLVs - ospfd/ospf_spf.c: Add new scheduler when running SPF to trigger update of NHLFE - ospfd/ospfd.h: Add new thread for Segment Routing scheduler - ospfd/subdir.am: Add new files - vtysh/Makefile.am: Add new ospf_sr.c file for vtysh - zebra/kernel_netlink.c: Add new OSPF_SR route type - zebra/rt_netlink.[c,h]: Add new OSPF_SR route type - zebra/zebra_mpls.h: Add new OSPF_SR route type Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* *: don't use deprecated stream.h macrosQuentin Young2017-12-011-1/+1
| | | | | | | Some of the deprecated stream.h macros see such little use that we may as well just remove them and use the non-deprecated macros. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: Convert list_delete(struct list *) to ** to allow nullingDonald Sharp2017-10-051-13/+11
| | | | | | | | | | | | | | | | | | | Convert the list_delete(struct list *) function to use struct list **. This is to allow the list pointer to be nulled. I keep running into uses of this list_delete function where we forget to set the returned pointer to NULL and attempt to use it and then experience a crash, usually after the developer has long since left the building. Let's make the api explicit in it setting the list pointer to null. Cynical Prediction: This code will expose a attempt to use the NULL'ed list pointer in some obscure bit of code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospfd: OSPFv2 VRF SupportChirag Shah2017-10-031-7/+9
| | | | Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* ospfd: Fix MI-OSPF configuraton clisChirag Shah2017-08-041-2/+2
| | | | | | | | | | | | | | | | Multi-Instance OSPF configuration CLI would fail because first client return error upon seeing qobj_index being 0. With new marco generate new error code to return from each instance (vtysh client) and if the command is intended for given instance, its qobj_index would be nonzero and process the command and push correct ospf context. Other instance would return the error. On vtysh end, check all instance return an error log a message to a file. Testing Done: Verfied various MI-OSPF configuration CLI with multi instances. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* Revert "*: reindent pt. 2"David Lamparter2017-07-221-15/+18
| | | | | | | | | This reverts commit c14777c6bfd0a446c85243d3a9835054a259c276. clang 5 is not widely available enough for people to indent with. This is particularly problematic when rebasing/adjusting branches. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: reindent pt. 2whitespace / reindent2017-07-171-18/+15
| | | | | | | | w/ clang 5 * reflow comments * struct members go 1 per line * binpack algo was adjusted
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-1664/+1651
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: ditch vty_outln(), part 1 of 2David Lamparter2017-07-131-4/+4
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: use vty_outlnQuentin Young2017-06-291-7/+6
| | | | | | Saves 400 lines Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-5/+4
| | | | | | | | | | | The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: update thread_add_* callsQuentin Young2017-05-091-9/+9
| | | | | | | | | | | | Pass pointer to pointer instead of assigning by return value. See previous commit message. To ensure that the behavior stays functionally correct, any assignments with the result of a thread_add* function have been transformed to set the pointer to null before passing it. These can be removed wherever the pointer is known to already be null. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: remove THREAD_ON macros, add nullity checkQuentin Young2017-05-091-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way thread.c is written, a caller who wishes to be able to cancel a thread or avoid scheduling it twice must keep a reference to the thread. Typically this is done with a long lived pointer whose value is checked for null in order to know if the thread is currently scheduled. The check-and-schedule idiom is so common that several wrapper macros in thread.h existed solely to provide it. This patch removes those macros and adds a new parameter to all thread_add_* functions which is a pointer to the struct thread * to store the result of a scheduling call. If the value passed is non-null, the thread will only be scheduled if the value is null. This helps with consistency. A Coccinelle spatch has been used to transform code of the form: if (t == NULL) t = thread_add_* (...) to the form thread_add_* (..., &t) The THREAD_ON macros have also been transformed to the underlying thread.c calls. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: kill useless if(...) after VTY_DECLVAR_CONTEXTDavid Lamparter2016-12-091-6/+0
| | | | | | | VTY_DECLVAR_CONTEXT already contains a NULL check, vty warning message and return statement. These are not needed. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: coccinelle-replace vty->indexDavid Lamparter2016-12-091-2/+2
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospf6d: scrubbed some argc CHECK MEsDaniel Walton2016-09-301-2/+0
| | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* all: added CHECK ME for DEFUNs that look at argcDaniel Walton2016-09-291-0/+2
| | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* ospfd: resolve CHECK ME'sQuentin Young2016-09-291-15/+19
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ALIAS removal for bgp, ospf, pim, isis, rip, ripng, lib and zebraDaniel Walton2016-09-231-13/+15
| | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* lib: migrate to new memory-type handlingDavid Lamparter2016-09-191-5/+4
| | | | | | | | | Move over to the new allocation counting added in the previous commit. (This commit is mostly mechanical.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
* Add support Router Capabilities support to OSPFOlivier Dugeon2016-09-031-0/+9
| | | | | | | | | | | This is an implementation of RFC4970 (Router Information) and RFC5088 (PCE Capabilities announcement) * ospfd/Makefile.am: Add new file ospf_ri.c and ospf_ri.h * ospfd/ospf_opaque.c: Add new Router Capabilities code point * ospfd/ospf_ri.[c,h]: Implementation of RFC4970 & RFC5088 Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* Update Traffic Engineering Support for OSPFDOlivier Dugeon2016-09-031-25/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOTE: I am squashing several commits together because they do not independently compile and we need this ability to do any type of sane testing on the patches. Since this series builds together I am doing this. -DBS This new structure is the basis to get new link parameters for Traffic Engineering from Zebra/interface layer to OSPFD and ISISD for the support of Traffic Engineering * lib/if.[c,h]: link parameters struture and get/set functions * lib/command.[c,h]: creation of a new link-node * lib/zclient.[c,h]: modification to the ZBUS message to convey the link parameters structure * lib/zebra.h: New ZBUS message Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com> Add support for IEEE 754 format * lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to safely convert between big-endian IEEE-754 single and double binary format, as used in IETF RFCs, and C99. Implementation depends on host using __STDC_IEC_559__, which should be everything we care about. Should correctly error out otherwise. * lib/network.[c,h]: Add ntohf and htonf converter * lib/memtypes.c: Add new memeory type for Traffic Engineering support Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com> Add link parameters support to Zebra * zebra/interface.c: - Add new link-params CLI commands - Add new functions to set/get link parameters for interface * zebra/redistribute.[c,h]: Add new function to propagate link parameters to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering. * zebra/redistribute_null.c: Add new function zebra_interface_parameters_update() * zebra/zserv.[c,h]: Add new functions to send link parameters Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com> Add support of new link-params CLI to vtysh In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue to use the ordered version for adding line i.e. config_add_line_uniq() to print Interface CLI commands as it completely break the new LINK_PARAMS_NODE. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com> Update Traffic Engineering support for OSPFD These patches update original code to RFC3630 (OSPF-TE) and add support of RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support of RFC6827 (ASON - GMPLS). * ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering * ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392 * ospfd/ospf_packet.c: Update checking of OSPF_OPTION * ospfd/ospf_vty.[c,h]: Update ospf_str2area_id * ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get Link Parameters information from the interface to populate Traffic Engineering metrics * ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN) * ospfd/ospf_te.[c,h]: Major modifications to update the code to new link parameters structure and new RFCs Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com> tmp
* ospfd: Remove HAVE_OSPF_TEDonald Sharp2016-08-161-6/+0
| | | | | | | | | Remove from ospf the HAVE_OSPF_TE define and just always have ospf traffic engineering. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Tested-by: NetDEF CI System <cisystem@netdef.org> (cherry picked from commit 693da6096a28eef5eadeea699771265987b3ec0c)
* ospfd: Remove HAVE_OPAQUE_LSADonald Sharp2016-08-161-2/+0
| | | | | | | | | HAVE_OPAQUE_LSA is used by default and you have to actively turn it off except that OPAQUE_LSA is an industry standard and used pretty much everywhere. There is no need to have special #defines for this anymore. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> (cherry picked from commit 36fef5708d074a3ef41f34d324c309c45bae119b)
* *: get rid of "MTYPE 0"David Lamparter2016-07-281-3/+3
| | | | | | | | | | | A few places are using 0 in place of the MTYPE_* argument. The following rewrite of the alloc tracking won't deal with that, so let's use MTYPE_TMP instead. Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com> [DL: v2: fix XFREE(0, foo) calls too] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospfd: Remove another odd flooding hack in opaque LSA codePaul Jakma2016-06-081-108/+0
| | | | | | | | | | | | | * ospf_opaque.c: (ospf_opaque_adjust_lsreq) Odd hack to general OSPF database exchange but made to act only on opaque LSAs. It's either covering up bugs in the flooding code or its wrong. If it's covering up bugs, those would affect all LSAs and should be fixed at a lower layer in ospfd, indeed perhaps those bugs are long fixed anyway (?). Alternatively, it's just plain wrong. Nuke. (ospf_opaque_exclude_lsa_from_lsreq) helper to above, nuke. * ospf_packet.c: Nuke call to ospf_opaque_adjust_lsreq. Tested-by: olivier.dugeon@orange.com
* ospfd: Remove the blocking of opaque LSAs origination & flooding 'optimisation'Paul Jakma2016-06-081-201/+4
| | | | | | | | | | | | | * Opaque support contains some kind of hack/optimisation to origination/flooding to suppress some origins/floods until an opaque LS Acks are received. Previous versions of the code have already been shown to have bugs in them (see e16fd8a5, e.g.). It seems over-complex and fragile, plus its conceptually the wrong place to try implement flooding hacks that, AFAICT, do not depend particularly on the semantics of opaque LSA. Nuke. Tested-by: Olivier Dugeon <olivier.dugeon@orange.com>
* ospfd: Fix initial Opaque LSA DB synchronisationOlivier Dugeon2016-05-261-7/+13
| | | | | | | | | | | | | | ospfd has issues resynchronising its Opaque LSA DB with neighbours after restart or interface events. The problem comes from opaque_lsa.c code that blocks subsequent opaque LSA flooding until the neighbour router acknowledge that, and removes the old opaque LSA from its LSDB. The bug comes from the fact that the lock is never release, thus avoiding subsequent opaque LSA flooding. More detail about the bugs and its solution is describeid in file doc/te-link-params.md Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com> (cherry picked from commit 149210656045c363d8f59b97ad9251b0c06a15df)
* configuration options for faster OSPF convergenceMichael Rossberg2015-07-311-16/+16
| | | | | | | | | | | Allow configuration of faster OSPF convergence via the min_ls_interval and min_ls_arrival timer lengths. This patch was originated by Michael, and cross-ported to Cumulus's Quagga. Signed-off-by: Michael Rossberg <michael.rossberg@tu-ilmenau.de> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Multi-Instance OSPF SummaryDonald Sharp2015-05-201-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ——————————————------------- - etc/init.d/quagga is modified to support creating separate ospf daemon process for each instance. Each individual instance is monitored by watchquagga just like any protocol daemons.(requires initd-mi.patch). - Vtysh is modified to able to connect to multiple daemons of the same protocol (supported for OSPF only for now). - ospfd is modified to remember the Instance-ID that its invoked with. For the entire life of the process it caters to any command request that matches that instance-ID (unless its a non instance specific command). Routes/messages to zebra are tagged with instance-ID. - zebra route/redistribute mechanisms are modified to work with [protocol type + instance-id] - bgpd now has ability to have multiple instance specific redistribution for a protocol (OSPF only supported/tested for now). - zlog ability to display instance-id besides the protocol/daemon name. - Changes in other daemons are to because of the needed integration with some of the modified APIs/routines. (Didn’t prefer replicating too many separate instance specific APIs.) - config/show/debug commands are modified to take instance-id argument as appropriate. Guidelines to start using multi-instance ospf --------------------------------------------- The patch is backward compatible, i.e for any previous way of single ospf deamon(router ospf <cr>) will continue to work as is, including all the show commands etc. To enable multiple instances, do the following: 1. service quagga stop 2. Modify /etc/quagga/daemons to add instance-ids of each desired instance in the following format: ospfd=“yes" ospfd_instances="1,2,3" assuming you want to enable 3 instances with those instance ids. 3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf and ospfd-3.conf. 4. service quagga start/restart 5. Verify that the deamons are started as expected. You should see ospfd started with -n <instance-id> option. ps –ef | grep quagga With that /var/run/quagga/ should have ospfd-<instance-id>.pid and ospfd-<instance-id>/vty to each instance. 6. vtysh to work with instances as you would with any other deamons. 7. Overall most quagga semantics are the same working with the instance deamon, like it is for any other daemon. NOTE: To safeguard against errors leading to too many processes getting invoked, a hard limit on number of instance-ids is in place, currently its 5. Allowed instance-id range is <1-65535> Once daemons are up, show running from vtysh should show the instance-id of each daemon as 'router ospf <instance-id>’ (without needing explicit configuration) Instance-id can not be changed via vtysh, other router ospf configuration is allowed as before. Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
* ospfd: compile warning cleanupsAndrew Certain2013-01-071-3/+9
| | | | | | | | | | | | | | A set of patches to clarify some comments as well as cleanup code that was causing warnings. After these patches, the code can be compiled with -Wall -Wsign-compare -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wchar-subscripts -Wcast-qual -Wextra -Wno-unused-parameter -Wno-missing-field-initializers (what is current in trunk plus -Wextra -Wno-unused-parameter -Wno-missing-field-initializers). Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
* ospfd: Compile fix for opaque supportPaul Jakma2011-03-221-6/+7
| | | | | | | | | | | | | | | | * ospfd: Refresher logic cleanup broke OSPF opaque, which does its own thing with regard to refresher logic and which also, in the protocol, requires implementations to keep state of which OI an LSA is received on (rather than providing information in the LSA to allow it to be looked up - as other LSAs requiring such assocation were careful to do). * ospf_lsa.h: (struct ospf_interface) Add back the pointer to oi, but only for type-9 now. * ospf_nsm.c: (ospf_db_summary_add) check the oi actually exists first - doesn't obviate the need for opaque to ensure oi pointers get cleaned up when ospf_interfaces disappear. * ospf_opaque.{c,h}: (ospf_opaque_functab,ospf_opaque_lsa_refresh) Refresher LSA functions now need to return the LSA to the general refresh logic, to indicate whether the LSA was refreshed.
* ospfd: Fix maxage/flush to not try flood twice, remember maxages for longerPaul Jakma2010-12-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2006-05-30 Paul Jakma <paul.jakma@sun.com> * (general) Fix confusion around MaxAge-ing and problem with high-latency networks. Analysis and suggested fixes by Phillip Spagnolo, in [quagga-dev 4132], on which this commit expands slightly. * ospf_flood.{c,h}: (ospf_lsa_flush) new function. Scope-general form of existing flush functions, essentially the dormant ospf_maxage_flood() but without the ambiguity of whether it is responsible for flooding. * ospf_lsa.c: (ospf_lsa_maxage) Role minimised to simply setup LSA on the Maxage list and schedule removal - no more. ospf_lsa_flush* being the primary way to kick-off flushes of LSAs. Don't hardcode the remover-timer value, which was too short for very high-latency networks. (ospf_maxage_lsa_remover) Just do what needs to be done to remove maxage LSAs from the maxage list, remove the call to ospf_flood_through(). Don't hardcode remove-timer value. (ospf_lsa_{install,flush_schedule}) ospf_lsa_flush is the correct entrypoint to flushing maxaged LSAs. (lsa_header_set) Use a define for the initial age, useful for testing. * ospf_opaque.c: (ospf_opaque_lsa_refresh) ditto. (ospf_opaque_lsa_flush_schedule) ditto. * ospfd.h: ({struct ospf,ospf_new}) Add maxage_delay parameter, interval to wait before running the maxage_remover. Supply a suitable default. Add a define for OSPF_LSA_INITIAL_AGE, see lsa_header_set().
* [ospfd] Allow ospf_lsa_unlock to NULL out callers' LSA pointers upon freePaul Jakma2006-07-261-7/+4
| | | | | | | | | | | | | | | | 2006-07-26 Paul Jakma <paul.jakma@sun.com> * ospf_lsa.{c,h}: (ospf_lsa_unlock) Change to take a double pointer to the LSA to be 'unlocked', so that, if the LSA is freed, the callers pointer to the LSA can be NULLed out, allowing any further use of that pointer to provoke a crash sooner rather than later. * ospf_*.c: (general) Adjust callers of ospf_lsa_unlock to match previous. Try annotate 'locking' somewhat to show which 'locks' are protecting what LSA reference, if not obvious. * ospf_opaque.c: (ospf_opaque_lsa_install) Trivial: remove useless goto, replace with return. * ospf_packet.c: (ospf_make_ls_ack) Trivial: merge two list loops, the dual-loop predated the delete-safe list-loop macro.
* 2005-09-17 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2005-09-171-9/+3
| | | | | | * ospf_opaque.c: (ospf_opaque_lsa_refresh_schedule,ospf_opaque_lsa_flush_schedule) No need to call ospf_lookup(), just use lsa0->area->ospf instead.
* 2005-05-11 Paul Jakma <paul.jakma@sun.com>paul2005-05-111-88/+66
| | | | | | | | | | | | | | | | | | | | | | | | | * (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.