summaryrefslogtreecommitdiff
path: root/isisd/isis_circuit.c
AgeCommit message (Collapse)Author
2021-08-23*: explicitly print "exit" at the end of every node configIgor Ryzhov
There is a possibility that the same line can be matched as a command in some node and its parent node. In this case, when reading the config, this line is always executed as a command of the child node. For example, with the following config: ``` router ospf network 193.168.0.0/16 area 0 ! mpls ldp discovery hello interval 111 ! ``` Line `mpls ldp` is processed as command `mpls ldp-sync` inside the `router ospf` node. This leads to a complete loss of `mpls ldp` node configuration. To eliminate this issue and all possible similar issues, let's print an explicit "exit" at the end of every node config. This commit also changes indentation for a couple of existing exit commands so that all existing commands are on the same level as their corresponding node-entering commands. Fixes #9206. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-07-29*: cleanup interface node installationIgor Ryzhov
The only difference in daemons' interface node definition is the config write function. No need to define the node in every daemon, just pass the callback as an argument to a library function and define the node there. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-06-21fabricd: fix running configIgor Ryzhov
Daemons should not output warnings into the running config. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-06-18isis: fix double-adding a circuit to the areaIgor Ryzhov
isis_circuit_enable can be called for an already enabled circuit. In this case we would add the circuit to the area multiple times. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-28isisd: fix using vrf interface as a loopbackIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-13lib: adapt to version 2 of libyangChristian Hopps
Compile with v2.0.0 tag of `libyang2` branch of: https://github.com/CESNET/libyang staticd init load time of 10k routes now 6s vs ly1 time of 150s Signed-off-by: Christian Hopps <chopps@labn.net>
2021-05-07isisd: rework BFD integrationIgor Ryzhov
Rewrite the BFD integration code to use the new library. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29isisd: fix ldp-sync configurationIgor Ryzhov
YANG model and CLI commands allow user to configure LDP-sync per area. But the actual implementation is incorrect - all commands are changing the config for the whole VRF instead of a single area. This commit fixes this issue by actually implementing per area configuration. Fixes #8578. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29isisd: allow arbitrary order of area/interface configurationIgor Ryzhov
Currently we don't allow to configure the interface before the area is configured. This approach has the following issues: 1. The area config can be deleted even when we have an interface config relying on it. The code is not ready for that - we'll have a whole bunch of stale pointers if user does that. 2. The code doesn't correctly process the event of changing the VRF for an interface. There is no mechanism to ensure that the area exists in the new VRF so currently the circuit still stays in the old VRF. This commit allows an arbitrary order of area/interface configuration. There is no more need to configure the area before configuring the interface. This change fixes both the issues. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29isisd: update link params after circuit is upIgor Ryzhov
Call from isis_circuit_create works only if we enable isis on an already existing interface. If we configure isis on a pseudo interface and then actually create it - this call doesn't work. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29isisd: fix incorrect snmp-id gen/freeIgor Ryzhov
Necessary structures for snmp-id generation are currently stored in `struct isis`. When we generate the new circuit ID, we always use the instance from the default VRF. When we free the circuit ID, we use the instance from the circuit VRF. This causes the following problems: 1. If there is no instance in the default VRF, this code doesn't work. 2. When circuit in non-default VRF is deleted, the ID is not actually freed. This is fixed by using global structures instead. The code itself is moved to isis_snmp.c and linked to the main code using hooks. We should not call SNMP-related code when the SNMP module is not loaded at all. More than that, we don't allow to activate the circuit if we failed to generate the SNMP ID. Even if SNMP support is completely disabled! This check is removed. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-03-22isisd: kill isis_memory.h, use MTYPE_STATICDavid Lamparter
Convert most DEFINE_MTYPE into the _STATIC variant, and move the remaining non-static ones to appropriate places. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17*: require semicolon after DEFINE_QOBJ & co.David Lamparter
Again, see previous commits. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17*: require semicolon after DEFINE_HOOK & co.David Lamparter
See previous commit. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-02isisd: support for snmplynne
Add support for read only mib objects from RFC4444. Signed-off-by: Lynne Morrison <lynne@voltanet.io> Signed-off-by: Karen Schoener <karen@voltanet.io>
2021-01-19Merge pull request #7550 from volta-networks/fix_bfd_isisDonald Sharp
isisd: if IS-IS is configured for v6, prefer v6 bfd sessions
2021-01-14isisd: if IS-IS is configured for v6, prefer v6 bfd sessionsKaren Schoener
Signed-off-by: Lynne Morrison <lynne@voltanet.io> Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-11-24isisd: add support for classic LFA (RFC 5286)Renato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-10-29isisd: fix segfault in the circuit p2p/bcast unionEmanuele Di Pascale
The fields in the broadcast/p2p union struct in an isis circuit are initialized when the circuit goes up, but currently this step is skipped if the interface is passive. This can create problems if the circuit type (referred to as network type in the config) changes from broadcast to point-to-point. We can end up with the p2p neighbor pointer pointing at some garbage left by the broadcast struct in the union, which would then cause a segfault the first time we would dereference it - for example when building the lsp, or computing the SPF tree. compressed backtrace of a possible crash: #0 0x0000555555579a9c in lsp_build at frr/isisd/isis_lsp.c:1114 #1 0x000055555557a516 in lsp_regenerate at frr/isisd/isis_lsp.c:1301 #2 0x000055555557aa25 in lsp_refresh at frr/isisd/isis_lsp.c:1381 #3 0x00007ffff7b2622c in thread_call at frr/lib/thread.c:1549 #4 0x00007ffff7ad6df4 in frr_run at frr/lib/libfrr.c:1098 #5 0x000055555556b67f in main at frr/isisd/isis_main.c:272 isis_lsp.c: 1112 case CIRCUIT_T_P2P: { 1113 struct isis_adjacency *nei = circuit->u.p2p.neighbor; 1114 if (nei && nei->adj_state == ISIS_ADJ_UP Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2020-10-23*: unify thread/event cancel macrosMark Stapp
Replace all lib/thread cancel macros, use thread_cancel() everywhere. Only the THREAD_OFF macro and thread_cancel() api are supported. Also adjust thread_cancel_async() to NULL caller's pointer (if present). Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-22:* Convert prefix2str to %pFXDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-10-09isisd: circuit->area->isis to circuit->isisDonald Sharp
The code in isisd uses `circuit->area->isis` all the time but we know that circuit now has a valid `circuit->isis` pointer so let's use that and cleanup the long dereference. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-09isisd: Always set `circuit->isis` on creationDonald Sharp
There are code paths where we were not always setting the circuit->isis on creation. Fix that up so it will always happen. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-09-11Merge pull request #6789 from volta-networks/feat_ldp_igp_syncRenato Westphal
ldpd: Add support for LDP-IGP Synchronization
2020-09-09isisd: ldp-igp-sync feature: adding isis supportlynne
Signed-off-by: Lynne Morrison <lynne@voltanet.io> Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-09-01doc, yang, isisd : Support for different VRF in isisdharios_niral
1. Added isis with different vrf and it's dependecies. 2. Added new vrf leaf in yang. 3. A minor change for IF_DOWN_FROM_Z passing argrument is replaced with ifp pointer in api "isis_if_delete_hook()". 4. Minor fix in the isisd spf unit test. Co-authored-by: Kaushik <kaushik@niralnetworks.com>" Signed-off-by: harios_niral <hari@niralnetworks.com>
2020-08-14isisd : Transformational changes to support different VRFs.Kaushik
1. Created a structure "isis master". 2. All the changes are related to handle ISIS with different vrf. 3. A new variable added in structure "isis" to store the vrf name. 4. The display commands for isis is changed to support different VRFs. Signed-off-by: Kaushik <kaushik@niralnetworks.com>
2020-07-14*: un-split strings across linesDavid Lamparter
Remove mid-string line breaks, cf. workflow doc: .. [#tool_style_conflicts] For example, lines over 80 characters are allowed for text strings to make it possible to search the code for them: please see `Linux kernel style (breaking long lines and strings) <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#breaking-long-lines-and-strings>`_ and `Issue #1794 <https://github.com/FRRouting/frr/issues/1794>`_. Scripted commit, idempotent to running: ``` python3 tools/stringmangle.py --unwrap `git ls-files | egrep '\.[ch]$'` ``` Signed-off-by: David Lamparter <equinox@diac24.net>
2020-07-10isisd: fix Coverity warningEmanuele Di Pascale
no need to check cicuit->area, as all code paths leading there had already dereferenced it. Fixes CID 1496314 Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2020-07-01isisd: log adj change when circuit goes downEmanuele Di Pascale
if we shutdown an interface isisd will delete the adjacencies on the corresponding circuit, but it will not log the change. Fix it to make sure that each change is logged. Also specify the level of the adjacency in the log message, while we are at it. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2020-06-24ISIS VRF: ISIS Debug structure modificationsharios
1. The "isis->debug" variable dependency on debug logs print is removed. Signed-off-by: harios <hari@niralnetworks.com>
2020-06-10isisd: prevent segfault in isis_circuit_af_setEmanuele Di Pascale
before the last commit, it was possible under some circumstances to call isis_circuit_af_set on a circuit with a NULL area, e.g. if the circuit was deconfigured due to a validation error. While this should not happen now, let's add an explicit check to avoid crashing if a regression is introduced. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2020-05-29isisd: fix local address TE TLVEmanuele Di Pascale
we were not correctly checking the MPLS-TE status of the area when adding an IP address to a circuit, and this was preventing the local address TLV to be populated after an interfaced flap. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2020-05-19isisd: set TE link params on circuit creationEmanuele Di Pascale
if mpls-te is enabled in the area, on creating a circuit we must refresh the link params - else interfaces that are enabled for IS-IS after configuring 'mpls-te on' will not correctly advertise link parameters. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2020-04-23isisd: fix display of "isis bfd" in the running configurationRenato Westphal
Since this command is modeled using YANG, it's already displayed as part of the call to nb_cli_show_dnode_cmds(). Calling the 'isis_circuit_config_write' hook was only making that command to be displayed twice. The aforementioned hook is still necessary for fabricd, which wasn't converted to the new northbound model yet. Fixes #6281. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-16*: move CLI node names to cmd_node->nameDavid Lamparter
And again for the name. Why on earth would we centralize this, just so people can forget to update it? Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: move CLI parent data to cmd_node->parent_nodeDavid Lamparter
Same as before, instead of shoving this into a big central list we can just put the parent node in cmd_node. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: remove second parameter on install_node()David Lamparter
There is really no reason to not put this in the cmd_node. And while we're add it, rename from pointless ".func" to ".config_write". [v2: fix forgotten ldpd config_write] Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: remove cmd_node->vtyshDavid Lamparter
The only nodes that have this as 0 don't have a "->func" anyway, so the entire thing is really just pointless. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: clean up cmd_node initializersDavid Lamparter
... and use named assignments everywhere (so I can change the struct.) Signed-off-by: David Lamparter <equinox@diac24.net>
2020-03-24*: remove tabs from log messagesDavid Lamparter
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>
2020-02-19isisd: do not disable circuit on ifdownEmanuele Di Pascale
when zebra detects that an interface is gone, notify the circuit but do not disable it - the interface is still configured until it isn't. Without this fix, removing the interface in the kernel and then removing the circuit from the configuration would cause an assertion in isis_csm.c:78 Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-11-02*: Convert prefix_free to double pointerDonald Sharp
Have the prefix_free code take a double pointer to free the data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-29isisd: split northbound callbacks into multiple filesRenato Westphal
Rearrange the isisd northbound callbacks as following: * isis_nb.h: prototypes of all northbound callbacks. * isis_nb.c: definition of all northbound callbacks and their associated YANG data paths. * isis_nb_config.c: implementation of YANG configuration nodes. * isis_nb_state.c: implementation of YANG state nodes. * isis_nb_notifications.c: implementation of YANG notifications. This should help to keep to code more organized and easier to maintain. No behavior changes intended. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-09-19*: Convert zapi->interface_delete to ifp callbackDonald Sharp
Convert the callback of the interface_delete to the new ifp callback. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19*: Convert interface_down to interface down callbackDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19*: Convert from ->interface_up to the interface callbackDonald Sharp
For all the places we have a zclient->interface_up convert them to use the interface ifp_up callback instead. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19*: Switch all zclient->interface_add to interface create callbackDonald Sharp
Switch the zclient->interface_add functionality to have everyone use the interface create callback in lib/if.c Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19*: Add infrastructure to support zapi interface callbacksDonald Sharp
Start the conversion to allow zapi interface callbacks to be controlled like vrf creation/destruction/change callbacks. This will allow us to consolidate control into the interface.c instead of having each daemon read the stream and react accordingly. This will hopefully reduce a bunch of cut-n-paste stuff Create 4 new callback functions that will be controlled by lib/if.c create -> A upper level protocol receives an interface creation event The ifp is brand spanking newly created in the system. up -> A upper level protocol receives a interface up event This means the interface is up and ready to go. down -> A upper level protocol receives a interface down destroy -> A upper level protocol receives a destroy event This means to delete the pointers associated with it. At this point this is just boilerplate setup for future commits. There is no new functionality. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-17isisd: Update TLVs processing for TE, RI & SROlivier Dugeon
In preparation to Segment Routing: - Update the management of Traffic Engineering subTLVs to the new tlvs parser - Add Router Capability TLV 242 as per RFC 4971 & 7981 - Add Segment Routing subTLVs as per draft-isis-segment-routing-extension-25 Modified files: - isis_tlvs.h: add new structure to manage TE subTLVs, TLV 242 & SR subTLVs - isis_tlvs.c: add new functions (pack, copy, free, unpack & print) to process TE subTLVs, Router Capability TLV and SR subTLVs - isis_circuit.[c,h] & isis_lsp.[c,h]: update to new subTLVs & TLV processing - isis_te.[c,h]: remove all old TE structures and managment functions, and add hook call to set local and remote IP addresses as wellas update TE parameters - isis_zebra.[c,h]: add hook call when new interface is up - isis_mt.[c,h], isis_pdu.c & isis_northbound.c: adjust to new TE subTLVs - tests/isisd/test_fuzz_isis_tlv_tests.h.gz: adapte fuuz tests to new parser Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>