Commit Graph

151 Commits

Author SHA1 Message Date
Donald Sharp
16167b3146 isisd: Prevent use after free for isis_adj_state_change
When we call isis_adj_state_change with ISIS_ADJ_DOWN
we free the pointer, but we were still using the pointer
after it was freed.  Cleanup the api to prevent this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-18 08:30:33 -04: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
Emanuele Di Pascale
d2c970ffb2 isisd, yang: unified lsp-timers command
Yang constraints enforced by the northbound callbacks require that
the maximum lifetime be >= than (refresh interval + 300). When we are
moving from one config to another through frr-reload.py, we issue
a number of vtysh -c commands ('no lsp-refresh-interval level-1 500',
'no max-lsp-lifetime level-1 1000'), which reset these parameters to their
default values, respectively 900 and 1200. Depending on the actual
values in the current config, the order in which these commands are sent
might be the wrong one, in that we hit an invalid intermediate state and
make vtysh (and by extension frr-reload.py) return an error.

As a workaround, let's add a one-liner command that sets all these
inter-related parameters in one go, and make isisd display them as a
single line too, so that the diff will be computed as a single command.
The old individual commands are kept to ensure backwards compatibility.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2020-04-06 17:38:27 +02:00
Emanuele Di Pascale
26eb18e259 isisd, yang: set default is-type to level-1-2
Currently isisd has this strange (legacy) behavior where the
first area is created by default with level-1-2, while every
other subsequent area uses the default defined in the yang model,
which is level-1. This is a source of confusion when trying to
configure the daemon programatically, either with frr-reload
or using the transactional cli. Given how rare having multiple
IS-IS instances is anyway, the easiest solution is to remove
this behavior and default to level-1-2 for every area.

Note that this does not affect fabricd, which continues using
exclusively level-2-only areas.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-12-17 16:54:47 +01: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
260fcb956b isisd: Add vrf_id to the main isis structure
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-10 10:10:22 -04:00
Renato Westphal
363be4dd90 isisd: unify isis_nexthop and isis_nexthop6 into a single struct
This unification allows us to write code that works for both IPv4 and
IPv6, reducing duplication.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-08-21 01:04:03 -03:00
Christian Franke
5627d3fec2 isisd: Remove unnecessary use of strcpy
`strcpy` is a dangerous function and should not be used. In this
particular place, there is no need for copying strings at all, so let's
just stick to referencing static strings.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2019-05-29 14:45:10 +02:00
Emanuele Di Pascale
688ea1cbe2 isisd: del routes when area is unconfigured
attempt to fix #4399

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-05-29 11:53:45 +02:00
Lou Berger
31e944a8a7
Merge pull request #3045 from opensourcerouting/atoms
READY: lists/skiplists/rb-trees new API & sequence lock & atomic lists
2019-04-30 10:26:35 -04: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
Olivier Dugeon
2e2a8b9136 isisd: Add IS-IS-TE support per Area
Solve issue #4032

 - Change MPLS-TE from global to per Area
 - Add new mpls_te_area structure to area in replacement of global variable
isisMPLS_TE
 - Move mpls-te from global to instance in frr-isisd.yang
 - Change code in isis_te.c, isis_northbound.c, isis_cli.c, isis_pdu.c,
isis_lsp.c and isis_zebra.c accordingly

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2019-04-25 18:59:26 +02:00
Russ White
231e94e32a
Revert "isisd: Add IS-IS-TE support per Area" 2019-04-23 09:24:18 -04:00
Olivier Dugeon
9c95fe6986 Issue #4032: Add IS-IS-TE support per Area
- Change MPLS-TE from global to per Area
 - Add new mpls_te_area structure to area in replacement of global variable
isisMPLS_TE
 - Move mpls-te frmo global to instance in frr-isisd.yang
 - Change code in isis_te.c, isis_northbound.c, isis_cli.c, isis_pdu.c,
isis_lsp.c and isis_zebra.c accordingly

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2019-04-15 16:22:38 +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
9414b6f662 isisd: implement the 'database-overload' 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
2adf66ff35 isisd: retrofit the 'log-adjacency-changes' command
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:24:46 +01:00
Emanuele Di Pascale
22af6a806d isisd: retrofit the 'topology' command
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:23:49 +01:00
Emanuele Di Pascale
e0df3206f1 isisd: retrofit the 'metric-style' command
Note that some of the validation checks that were previously
executed in the code have been moved to the YANG model.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:21:52 +01:00
Emanuele Di Pascale
f084ea5523 isisd: retrofit the 'net' command
This is a simple command but with a complex callback, the only
one in isisd which uses the resource allocation API implemented
in the northbound (i.e. the PREPARE phase).

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:21:15 +01:00
Emanuele Di Pascale
aaf2fd21fc isisd: retrofit 'router isis' and 'ip router isis' cmds
These are complex commands to retrofit, partly due to the number of
different callbacks they touch. Additionally, in FRR adding
an interface to an IS-IS area that does not exist also creates that
area. To make sure that this behavior is kept, while at the same
time keeping the northbound api consistent, we need to take extra
care to call the appropriate callbacks to update the YANG tree.

Note that many callbacks rely on the existence of the corresponding
IS-IS area; when these callbacks are joined together in a single
transaction, we need to ensure that the area creation is performed
first, or the config will fail. For this reason, the isis instance
create callback has been given a slightly lower priority than the
others.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:20:20 +01:00
Christian Franke
6f004b60ed isisd: Provide statistics over number of generated purges
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07 19:45:14 +00:00
Christian Franke
062f4d3691 isisd: Provide statistics over number of LSP regenerations
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07 19:45:14 +00:00
Christian Franke
86d6f80d5d isisd: Provide statistics about retransmitted LSPs
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07 19:45:14 +00:00
Christian Franke
39bb53d67a isisd: Provide statistics about sent/received PDU count
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07 19:45:14 +00:00
Christian Franke
eb2bcb2800 isisd: Move code to find LSP out of show database
Finding an LSP by its id is useful not only for the
`show isis database` command.

So move it out into its own function to make it reusable.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07 19:45:14 +00:00
Christian Franke
ddb33326ff isisd: Provide better flooding debugging
Show from where LSP flooding is triggered.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07 19:45:14 +00:00
Christian Franke
161fa356fb isisd: Add debug output for tx-queues
To allow easier debugging of LSP transmission scheduling, add a debug
mode where all tx-queue insertions/deletions are logged.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07 19:45:14 +00:00
Christian Franke
26687d255d isisd: Remove unused debug flags
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-08 20:30:55 +01:00
Christian Franke
9196731f9d isisd: Combine lsp_l1/l2_refresh
lsp_l1_refresh and lsp_l2_refresh are identical apart from the
hardcoded IS-IS level they are referring to. So merge them and
pass the level as part of the argument.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-10-24 07:52:44 +02:00
Christian Franke
2815f817e5 isisd: Add debugging for BFD
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-10-05 14:08:23 +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
Christian Franke
2c92bee499 isisd: add purge originator identification support
Implement RFC 6232, optionally allowing to flood isisd's NET and
hostname in purges it originates.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05 11:38:13 +02:00
Christian Franke
d4cff91a06 fabricd: add flooding algorithm debugging
Add a command `debug openfabric flooding` to allow verification of
correct operation of the OpenFabric flooding optimization algorithm.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05 11:38:13 +02:00
Christian Franke
92ed0cdef5 fabricd: allow to configure tier-level advertisement
While OpenFabric calculates most tier numbers automatically by the
fabric locality calculation algorithm, that algorithm requires two
systems to be manually configured as tier 0, so it has reference points.

Also, completely manual configuration is possible.

To support this, introduce appropriate CLI commands and flood the
configured information.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05 11:38:13 +02:00
Christian Franke
b30e837b3f fabricd: run a hop-by-hop spf
OpenFabric uses an spf with the metric for all links set to one,
both for flooding optimization and for fabric locality detection.

So extend isisd's spf code to allow running it with such a metric
and have it run whenever normal spf runs.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05 11:38:13 +02:00
Christian Franke
8e6fb83b4b fabricd: adjacency formation optimization as per section 2.4
OpenFabric changes IS-IS's initial database synchronization. While
regular IS-IS will simultaneuously exchange LSPs with all neighboring
routers during startup, this is considered too much churn for a densely
connected fabric.

To mitigate this, OpenFabric prescribes that a router should only
bring up an adjacency with a single neighbor and perform a full
synchronization with that neighbor, before bringing up further
adjacencies.

This is implemented by having a field `initial_sync_state` in the
fabricd datastructure which tracks whether an initial sync is still
pending, currently in progress, or complete.

When an initial sync is pending, the state will transition to the
in-progress state when the first IIH is received.

During this state, all IIHs from other routers are ignored. Any
IIHs transmitted on any link other than the one to the router with
which we are performing the initial sync will always report the far
end as DOWN in their threeway handshake state, avoiding the formation of
additional adjacencies.

The state will be left if all the SRM and SSN flags on the
initial-sync circuit are cleared (meaning that initial sync has
completed). This is checked in `lsp_tick`. When this condition occurrs,
we progress to the initial-sync-complete state, allowing other
adjacencies to form.

The state can also be left if the initial synchronization is taking too
long to succeed, for whatever reason. In that case, we fall back to the
initial-sync-pending state and will reattempt initial synchronization
with a different neighbor.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05 11:38:13 +02:00
Christian Franke
65f1815711 fabricd: adjust IS-IS defaults as per draft
OpenFabric specifies that it should always be run with wide metrics via
P2P links and only as Level-2. Implement this as default and remove all
the knobs from fabricd which allow other configuration.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05 11:38:13 +02:00
Christian Franke
7c0cbd0e88 fabricd: add new daemon as build of isisd
fabricd is built using the sources of isisd. To allow differentiation
in the code, -DFABRICD=1 is added to its preprocessor flags.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05 11:38:12 +02:00
Christian Franke
321c1bbb94 isisd: make spf code dst-src aware
Take the source-prefix sub-TLV into consideration when running SPF
and support creation/deletion of dst-src routes as result.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-08-03 13:25:39 +02:00
Christian Franke
be985ba059 isisd: make use of advanced concepts like arrays and loops
Have an array of spftrees instead of a separate spftree and an
spftree6 for which all the code gets duplicated.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-08-03 13:25:39 +02:00
Christian Franke
3dace42de9 isisd: move route_table into spftree
As isisd's route_tables are directly related to spf trees, move
the route tables into the spftree instead of maintaining them
alongside of the spftrees.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-08-03 13:25:39 +02:00
paco
a2b6e694b1
bgpd isisd ldpd lib ospfd pimd: redundancy (infer)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-20 22:25:28 +02:00