Commit Graph

163 Commits

Author SHA1 Message Date
Emanuele Di Pascale
93bdc36757 isisd: fix segfault in the circuit p2p/bcast union
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-29 09:51:27 +01:00
Mark Stapp
5047884528 *: unify thread/event cancel macros
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-23 12:16:52 -04:00
Donatas Abraitis
2dbe669bdf :* Convert prefix2str to %pFX
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-10-22 09:07:41 +03:00
Donald Sharp
99e5d4af38 isisd: circuit->area->isis to circuit->isis
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-09 08:18:21 -04:00
Donald Sharp
bfa5145757 isisd: Always set circuit->isis on creation
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-10-09 08:14:00 -04:00
Renato Westphal
beb91114ec
Merge pull request #6789 from volta-networks/feat_ldp_igp_sync
ldpd: Add support for LDP-IGP Synchronization
2020-09-11 15:55:04 -03:00
lynne
1cbf96a8ad isisd: ldp-igp-sync feature: adding isis support
Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-09-09 14:38:44 -04:00
harios_niral
65251ce80f doc, yang, isisd : Support for different VRF in isisd
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-09-01 00:48:05 -07:00
Kaushik
eab88f3655 isisd : Transformational changes to support different VRFs.
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-08-14 13:46:22 -07:00
David Lamparter
3efd0893d0 *: un-split strings across lines
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-14 10:37:25 +02:00
Emanuele Di Pascale
5e69d308a1 isisd: fix Coverity warning
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-10 15:55:54 +02:00
Emanuele Di Pascale
7145d5bb3a isisd: log adj change when circuit goes down
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-07-01 21:48:38 +02:00
harios
e740f9c159 ISIS VRF: ISIS Debug structure modifications
1. The "isis->debug" variable dependency on debug logs print is removed.

Signed-off-by: harios <hari@niralnetworks.com>
2020-06-24 14:45:06 +05:30
Emanuele Di Pascale
e8cff6d14c isisd: prevent segfault in isis_circuit_af_set
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-06-10 16:34:33 +02:00
Emanuele Di Pascale
d80e23f8d3 isisd: fix local address TE TLV
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-29 16:41:16 +02:00
Emanuele Di Pascale
89cf2f2096 isisd: set TE link params on circuit creation
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-05-19 18:56:30 +02:00
Renato Westphal
05e4ec3798 isisd: fix display of "isis bfd" in the running configuration
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-23 13:05:51 -03:00
David Lamparter
f4b8291fcb *: move CLI node names to cmd_node->name
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 12:53:59 +02:00
David Lamparter
243895805a *: move CLI parent data to cmd_node->parent_node
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 12:53:00 +02:00
David Lamparter
612c2c15d8 *: remove second parameter on install_node()
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 12:53:00 +02:00
David Lamparter
249a771b63 *: remove cmd_node->vtysh
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 12:53:00 +02:00
David Lamparter
62b346eefa *: clean up cmd_node initializers
... and use named assignments everywhere (so I can change the struct.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
David Lamparter
d6951e5ef9 *: remove tabs from log messages
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-03-24 18:47:12 +01:00
Emanuele Di Pascale
a46b50daec isisd: do not disable circuit on ifdown
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>
2020-02-19 18:34:45 +01:00
Donald Sharp
63265b5c1f *: Convert prefix_free to double pointer
Have the prefix_free code take a double pointer to free the data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-02 16:13:44 -04:00
Renato Westphal
2a1c520e9f isisd: split northbound callbacks into multiple files
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-10-29 21:49:14 -03:00
Donald Sharp
3c3c325203 *: Convert zapi->interface_delete to ifp callback
Convert the callback of the interface_delete to the new
ifp callback.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19 13:34:06 -04:00
Donald Sharp
b0b69e59f4 *: Convert interface_down to interface down callback
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19 13:34:06 -04:00
Donald Sharp
ddbf3e6060 *: Convert from ->interface_up to the interface callback
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 13:34:06 -04:00
Donald Sharp
ef7bd2a3d5 *: Switch all zclient->interface_add to interface create callback
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 13:34:06 -04:00
Donald Sharp
138c5a7450 *: Add infrastructure to support zapi interface callbacks
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-19 13:34:06 -04:00
Olivier Dugeon
1b3f47d04c isisd: Update TLVs processing for TE, RI & SR
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>
2019-09-17 17:35:50 +02:00
Renato Westphal
81fddbe7ae *: rename new ForEach macros from the typesafe API
This is necessary to avoid a name collision with std::for_each
from C++.

Fixes the compilation of the gRPC northbound module.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-05-21 15:59:08 -03:00
David Lamparter
4bef0ec4fb isisd: replace dict_* with DECLARE_RBTREE
Historically, isisd has been carrying around its own red-black tree to
manage its LSP DB in.  This replaces that with the newly-added
DECLARE_RBTREE_*.  This allows completely removing the dict_* code.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-04-27 19:33:45 +02:00
Quentin Young
e28544ed99 isisd: strncpy -> strlcpy
strncpy is a byte copy function not a string copy function

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-26 20:50:13 +00:00
Ruben Kerkhof
4d762f2607 Treewide: use ANSI function definitions
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2019-01-24 11:21:59 +01:00
Emanuele Di Pascale
cc50ddb273 isisd: retrieve default values from the yang model
also fix a minor issue with isis_config_write where we were
not incrementing the write variable, which is used to append
a new line at the end of the vty string

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:25:57 +01:00
Emanuele Di Pascale
392b89f39d isisd: implement the 'if-state-change' notification
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:24:46 +01:00
Emanuele Di Pascale
20600086b2 isisd: modify config_write funcs to use the northbound
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:24:46 +01:00
Emanuele Di Pascale
d082076585 isisd: retrofit the 'isis network' command
remove the return value and redundant validations from
isis_circuit_circ_type_set(), since they are no longer needed.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:24:46 +01:00
Christian Franke
c6476defc5 isisd: Remove unused t_send_lsp timer
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07 19:45:14 +00:00
Christian Franke
a0a707ee6c isisd: add send_hello_sched function
Add a function send_hello_sched so that the logic for scheduling a
hello is not replicated inconsistently into different locations.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-04 16:13:24 +01:00
Christian Franke
7c4f7aabc5 isisd: reduce code duplication for levels
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-04 12:49:25 +01:00
Christian Franke
7da4aa3c7a isisd: Add level&circuit thread argument to circuit
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-04 12:49:25 +01:00
Christian Franke
5489eb4563 isisd: Address code-style warnings 2018-10-12 16:45:32 +02:00
Christian Franke
d56afe53aa isisd: Add a hook when writing interface config
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-10-05 14:05:31 +02:00
David Lamparter
6a154c8812 *: list_delete_and_null() -> list_delete()
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-02 11:40:52 +02:00
Lou Berger
b4657ea44c
Merge pull request #3031 from pacovn/static_analysis__Wcomma
bgpd isisd zebra: misuse of comma operator
2018-09-17 06:03:49 -04:00
F. Aragon
1445b43c41
bgpd isisd zebra: misuse of comma operator
Detected using ./configure CFLAGS=-Wcomma CC=clang

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-09-14 15:55:56 +02:00
Quentin Young
1a7ecb9630 isisd: ISIS_[ERR|WARN] -> EC_ISIS
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13 19:12:08 +00:00