summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_te.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ospfd: Add Link-State supportOlivier Dugeon2021-03-231-27/+1749
| | | | | | | | | | | | | | | | This patch allows to store Link State Information received through the various LSAs into a dedicated Traffic Engineering Database (TED). This feature is automatically activated once mpls-te is enabled. A new CLI command `mpls-te export` permits to export the TED to other daemons through the new ZAPI Opaque Link State messages. In complement, a new CLI command `show ip ospf mpls-te database ...` output the contains of the TED to the console. Major modifications take place in ospf_te.[c, h]. File ospf_zebra.c has been modified to handle TED synchronisation request. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* ospfd: Correct Opaque Inter-AS LSA managementOlivier Dugeon2021-03-231-95/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch corrects two problems that affect Inter-AS LSA: 1/ Inter-LSA are never flood due to an incorrect setting of specific flag. 2/ When looking to the detail of the OSPF LSA with the command `show ip ospf database opaque-xxx`, it appears that only the Inter-AS advertising router is abble to show the detail of the Inter-AS LSA. Foreign routers are only abble to show the header of this Inster-AS LSA. The problem comes from the registration of Inter-AS management functions which is done only on the advetising router. So, the function `ospf_mpls_te_show_info()` is never call on neighbor routers that have not resgistered Inter-AS management callback functions. First, this patch modify functions `set_linkparams_inter_as()` and `unset_linkparams_inter_as()` to respectively set and unset flags that control the Inter-AS LSA flooding. Flag & Type from `struct mpls_te_link` have been redefined: Flag is used to determine if flooding is AS or not and Type is only used to determine the type of the LSA. Second, this patch register Inter-AS management functions for both AS and Area flooding with a different function for LSA origination as parameter is passed as void and it is mandatory to determine the flooding context: `struct *ospf` for AS flooding and `struct *ospf_area` for Area flooding. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* opsfd: Correct MPLS-TE bug with LSA FlushOlivier Dugeon2021-03-231-13/+33
| | | | | | | | | | | | | | | | | | When an interface goes down, if it is MPLS-TE enabled, the corresponding TE Opaque LSA is not flushed and continue to be advertised. The problem is due to bugs in ISM and NSM handler functions of ospf_te.c file: - ospf_mpls_te_ism_change(): - flag associated with Link Parameters is reset - ISM_Down state is not correctly handle - ospf_mpls_te_nsm_change(): - flag associated with Link Parameters is reset - NSM_Down and NSM_Delete states are not handle This patch correct this problem. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* ospfd: Improve MPLS-TE debugOlivier Dugeon2021-03-231-124/+105
| | | | | | Add Macro to ospf_te.h to ease debug message in ospf_te.c Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* ospfd: reset mpls-te prior to ospf router removalCarlo Galiotto2020-11-161-0/+12
| | | | | | | | | | | | | | | | | | This commits attempts to fix a problem that occurs when mpls-te gets removed from ospfd config. Mpls-te has an inter-as option, which can be set to Off/Area/AS. Whenever the inter-as takes "Area" or "AS" as a value, this value will not be cleaned after removing mpls-te or after removing the ospf router. Therefore, if mpls-te is configured with inter-as AS or Area and we remove mpls-te or the ospf router, the inter-as will still preserve its value; therefore, next time mpls-te is enabled, it will automatically inherits the previous inter-as value (either Area or AS). This leads to wrong configuration, which can be a problem for frr_reload.py. The commits forces mpls-te to reset inter-as to Off before it mpls-te gets removed from the configuration and before the ospf router gets removed. Signed-off-by: Carlo Galiotto <carlo@voltanet.io>
* ospfd: replace inet_ntoaMark Stapp2020-10-221-42/+36
| | | | | | Stop using inet_ntoa, use %pI4 etc or inet_ntop instead Signed-off-by: Mark Stapp <mjs@voltanet.io>
* *: Do not cast to the same typeDonatas Abraitis2020-04-081-1/+1
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* *: remove tabs from log messagesDavid Lamparter2020-03-241-1/+1
| | | | | | | Some logging systems are, er, "allergic" to tabs in log messages. (RFC5424: "The syslog application SHOULD avoid octet values below 32") Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: generously apply constDavid Lamparter2019-12-021-1/+1
| | | | | | const const const your boat, merrily down the stream... Signed-off-by: David Lamparter <equinox@diac24.net>
* Revert "Ospf missing interface handling 2"Donald Sharp2019-06-241-1/+1
|
* *: change if_lookup_by_name() api with vrfPhilippe Guibert2019-06-121-1/+1
| | | | | | | | | | the vrf_id parameter is replaced by struct vrf * parameter. this impacts most of the daemons that look for an interface based on the name and the vrf identifier. Also, it fixes 2 lookup calls in zebra and sharpd, where the vrf_id was ignored until now. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* ospfd: initialize maybe-uninitialized boolQuentin Young2019-05-291-1/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ospfd: Correct Link-ID and Remote IP for TE LSAOlivier Dugeon2019-04-301-97/+98
| | | | | | | | | | | | | | Solve issue #4198 Link-ID and Remote IP address must be set accordingly to the interface type (Point-to-Point or Broadcast) from the neighbor information. However, this information are only valid once the Network State Machine (NSM) is Full i.e. when the adjacency is up. The original TE code only look to Interface State Machine (ISM) change which not allow to collect valid neighbor information. The patch move setup of Link-ID and Remote-IP TE parameters from ospf_mpls_te_ism_change() to ospf_mpls_te_nsm_change() function. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* Treewide: use ANSI function definitionsRuben Kerkhof2019-01-241-1/+1
| | | | Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
* ospfd: remove call to if_lookup_all_vrfPhilippe Guibert2018-12-101-23/+22
| | | | | | | so as to isolate ospf contexts separately for each vrf, the interface used is cornered to the passed vrf context. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* ospf: unregister mpls-te inter-as only if mpls-te is enabledDmitrii Turlupov2018-11-091-4/+4
| | | | Signed-off-by: Dmitrii Turlupov <dturlupov@factor-ts.ru>
* *: spelchekDavid Lamparter2018-10-251-1/+1
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* *: list_delete_and_null() -> list_delete()David Lamparter2018-10-021-1/+1
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* ospfd: remove unnecessary housekeeping code when using linked listsRenato Westphal2018-09-241-4/+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-20/+20
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: style for flog_warn conversionsQuentin Young2018-09-061-30/+42
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ospfd: Add OSPF_WARN_LSA_INSTALL_FAILURE error codeDonald Sharp2018-09-061-3/+3
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospfd: Convert ospf_te.c to use new error-card subsystemDonald Sharp2018-09-061-46/+47
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospfd: Add OSPF_WARN_OPAQUE_REGISTRATIONDonald Sharp2018-09-061-4/+5
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospfd: Cleanup some warnings that were not warningsDonald Sharp2018-09-061-6/+3
| | | | | | | | | | 1) stream allocation cannot fail 2) some warnings were removed when functions safely ignored the calling parameters being wrong. 3) some warnings were removed when functions did not consider the state as an error since we did not return an error code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospfd: Add ospf_lsa_new_and_data function and abstract awayDonald Sharp2018-08-211-12/+1
| | | | | | | | | | | | | | In all but one instance we were following this pattern with ospf_lsa_new: ospf_lsa_new() ospf_lsa_data_new() so let's create a ospf_lsa_new_and_data to abstract this bit of fun and cleanup all the places where it assumes these function calls can fail. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: ALLOC calls cannot failDonald Sharp2018-08-111-5/+0
| | | | | | | | 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>
* ospfd: dead code (Coverity 1302500)paco2018-06-261-3/+2
| | | | Signed-off-by: F. Aragon <paco@voltanet.io>
* ospfd: lp may be null, make sure it isn'tDonald Sharp2018-06-051-2/+3
| | | | | | | | We lookup the lp value and lookup_linkparams_by_instance can return NULL if something has gone terribly wrong. Make sure that lp is not NULL. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospfd: use __func__ in ospf_te.cQuentin Young2018-04-171-2/+2
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ospfd: fix stylistic issueQuentin Young2018-04-171-10/+7
| | | | | | | | Macro that expands to be wrapped in parentheses was being used as a raw condition for an if statement, leading to some very weird and confusing formatting... Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-98/+97
| | | | | | | | | | | | | | | | | | | | | | 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-21/+19
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* OSPFd: Fix ospfd crash during CIOlivier Dugeon2018-02-031-0/+32
| | | | | | | | | | | | | | | | | 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-23/+0
| | | | | | | | | | | | | - 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>
* ospfd: fix coverity warnings - security best practices violationsRenato Westphal2017-10-241-1/+1
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Merge pull request #1298 from opensourcerouting/iface-rb-treeDonald Sharp2017-10-161-9/+10
|\ | | | | Use rb-trees to store interfaces instead of linked-lists
| * *: use the FOR_ALL_INTERFACES abstraction from babeldRenato Westphal2017-10-101-4/+3
| | | | | | | | | | | | | | | | | | | | This improves code readability and also future-proofs our codebase against new changes in the data structure used to store interfaces. The FOR_ALL_INTERFACES_ADDRESSES macro was also moved to lib/ but for now only babeld is using it. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * *: use rb-trees to store interfaces instead of sorted linked-listsRenato Westphal2017-10-101-9/+11
| | | | | | | | | | | | | | | | | | | | | | This is an important optimization for users running FRR on systems with a large number of interfaces (e.g. thousands of tunnels). Red-black trees scale much better than sorted linked-lists and also store the elements in an ordered way (contrary to hash tables). This is a big patch but the interesting bits are all in lib/if.[ch]. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | ospfd: Fix leak of streamDonald Sharp2017-10-101-1/+3
|/ | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Convert list_delete(struct list *) to ** to allow nullingDonald Sharp2017-10-051-2/+1
| | | | | | | | | | | | | | | | | | | 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 Changes IIChirag Shah2017-10-031-4/+7
| | | | | | Accomodate review comments Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* ospfd: OSPFv2 VRF SupportChirag Shah2017-10-031-19/+58
| | | | Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* *: fix assorted issues detected by Coverity ScanRenato Westphal2017-08-251-1/+1
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* ospfd: Fix MI-OSPF configuraton clisChirag Shah2017-08-041-3/+3
| | | | | | | | | | | | | | | | 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>
* Correct build TLV functionsOlivier Dugeon2017-07-311-3/+3
| | | | | | | | * Functions that build TLVs in ospf_te.c and ospf_te.c use 'tlvh + 1' to move the pointer to the TLV payload ifor strem_put(). * Correct this by using TLV_DATA() macro which is saffer. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* Update PR #839 following reviewOlivier Dugeon2017-07-271-67/+48
| | | | | | | | * Remove enum status_t opcode in ospfd.h * Replace enum status_t opcode by bool enabled in ospf_te.[c,h] and ospf_ri.c * Add missign parenthesis '()' around 'if CHECK_FLAG' in ospf_te.c and ospf_ri.c Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* Correct indentation and remove _opcode_t typedefOlivier Dugeon2017-07-211-3/+3
| | | | | | | | * Correct struct tlh_header indentation in opaque.h * Change typedef enum _opcode_t by enum lsa_opcode * Propagate change in ospf_te.[c,h) and ospf_ri.c Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* OSPF OPAQUE, TE and RI macro refactoring & cleanupOlivier Dugeon2017-07-201-140/+102
| | | | | | | | | | | * TLV macros where define itwice in ospf_te.h and in ospf_ri.h * Merge both definition in ospf_opaque.h and adjust accordingly RI and TE * Same for typedef status_t which is move in ospfd.h * Remove also all 'goto' statement in ospf_te.c and ospf_ri.c * Remove strange function lookup_oi_by_ifp() in ospf_te.c and replace it by a valid code in initialize_linkparams() function Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-2143/+2119
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>