summaryrefslogtreecommitdiffstats
path: root/isisd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* isisd: fix coverity SA warningMark Stapp2021-03-261-0/+2
| | | | | | Add assert to clear SA warning. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* isisd: Prevent OOM crash in isisDonald Sharp2021-03-251-38/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you set the isis mtu to 200, isis ends up in a infinite loop trying to fragment the tlv's. Specifically ( for me ) the extended reachability function for packing pack_item_extended_reach requires 11 + ISIS_SUBTLV_MAX_SIZE room in the packet. Which is 180 bytes. At this point we have 174 bytes that we can write into a packet. I created this by modifying the isis-topo1 topology to all the isis routers to have a lsp-mtu of 200 and immediately saw the crash. Effectively the pack_items_ function had no detection for when a part of the next bit it was writing into the stream could not even fit and it would go into an infinite loop allocating ~800 bytes at a time. This would cause the router to run out of memory very very fast and the OOM detector would kill the process. Modify the code to notice that we have insufficient space to even write any data into the stream. I suspect that pack_item_extended_reach could also be optimized to figure out exactly how much space is needed. But I also think we need this protection in the function if this ever happens again. I also do not understand the use case of saying the min mtu is 200. Fixes: #8289 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #8250 from idryzhov/fix-nb-running-get-entryRenato Westphal2021-03-241-1/+1
|\ | | | | Fix aborts when using nb_running_get_entry during validation stage
| * *: fix aborts when validating configurationIgor Ryzhov2021-03-161-1/+1
| | | | | | | | | | | | | | | | | | There are places in the code where function nb_running_get_entry is used with abort_if_not_found set to true during the config validation stage. This is incorrect because when used in transactional CLI, the running entry won't be set until the apply stage, and such usage leads to crash. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | Merge pull request #8325 from idryzhov/fix-ip-router-isisDavid Lamparter2021-03-241-1/+1
|\ \ | | | | | | isisd: fix extra space after "ip router isis"
| * | isisd: fix extra space after "ip router isis"Igor Ryzhov2021-03-241-1/+1
| | | | | | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | | isisd: kill isis_memory.h, use MTYPE_STATICDavid Lamparter2021-03-2221-131/+65
|/ / | | | | | | | | | | | | 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>
* | Merge pull request #8301 from donaldsharp/isis_spacingDavid Lamparter2021-03-221-5/+5
|\ \ | | | | | | isisd: Fix extra space after `router isis FOO`
| * | isisd: Fix extra space after `router isis FOO`Donald Sharp2021-03-211-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Fix places where we are outputing an extra space. This was because it was prepping for vrf but we may not have a vrf. Fixes: #8300 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | | Merge pull request #8298 from donaldsharp/isis_spellingDavid Lamparter2021-03-221-1/+1
|\ \ \ | | | | | | | | isisd: Fix spelling mistake
| * | | isisd: Fix spelling mistakeDonald Sharp2021-03-211-1/+1
| |/ / | | | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | | Merge pull request #8121 from opensourcerouting/macro-cleanupDonatas Abraitis2021-03-2223-91/+95
|\ \ \ | | | | | | | | *: require ISO C11 + semicolons after file-scope macros
| * | | *: require semicolon after FRR_DAEMON_INFO & co.David Lamparter2021-03-172-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | ... again ... Signed-off-by: David Lamparter <equinox@diac24.net>
| * | | *: require semicolon after DEFINE_<typesafe...>David Lamparter2021-03-174-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | Again, see previous commits. Signed-off-by: David Lamparter <equinox@diac24.net>
| * | | *: require semicolon after DEFINE_QOBJ & co.David Lamparter2021-03-174-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Again, see previous commits. Signed-off-by: David Lamparter <equinox@diac24.net>
| * | | *: require semicolon after DEFINE_HOOK & co.David Lamparter2021-03-178-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | See previous commit. Signed-off-by: David Lamparter <equinox@diac24.net>
| * | | *: require semicolon after DEFINE_MTYPE & coDavid Lamparter2021-03-179-58/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Back when I put this together in 2015, ISO C11 was still reasonably new and we couldn't require it just yet. Without ISO C11, there is no "good" way (only bad hacks) to require a semicolon after a macro that ends with a function definition. And if you added one anyway, you'd get "spurious semicolon" warnings on some compilers... With C11, `_Static_assert()` at the end of a macro will make it so that the semicolon is properly required, consumed, and not warned about. Consistently requiring semicolons after "file-level" macros matches Linux kernel coding style and helps some editors against mis-syntax'ing these macros. Signed-off-by: David Lamparter <equinox@diac24.net>
| * | | snmp: change -std=gnu99 to -std=gnu11David Lamparter2021-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The point of the `-std=gnu99` was to override a `-std=c99` that may be coming in from net-snmp. However, we want C11, not C99. Signed-off-by: David Lamparter <equinox@diac24.net>
* | | | Merge pull request #8282 from volta-networks/fix_isisd_bfd_ipv4Donald Sharp2021-03-213-25/+79
|\ \ \ \ | |_|/ / |/| | | isisd: fix BFD session when IPv6 not configured
| * | | isisd: add debug logs to troubleshoot BFD issuesEmanuele Di Pascale2021-03-181-10/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when we receive an event from BFDD and we end up throwing it away, make sure that we log (with debug guards) the reason for this, so we can troubleshoot issues like the one addressed by the previous commit. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
| * | | isisd: fix BFD session when IPv6 not configuredEmanuele Di Pascale2021-03-183-15/+22
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A wrong check was silently skipping the initialization of the bfd_session struct in the adjacency if the router was not configured for IPv6. This would cause BFD events to be ignored regardless of the configuration. Also add a function to return the "name" of an adjacency and use it in a couple of places, including the new log, instead of repeating the same code in a bunch of places. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* / / isisd: avoid lsp_sched loop when unstableEmanuele Di Pascale2021-03-191-5/+15
|/ / | | | | | | | | | | | | | | no point in scheduling an LSP refresh immediately if we know it is going to be postponed again due to the network still being in its instability grace period Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* / isisd: Fix coverity warningslynne2021-03-161-11/+11
|/ | | | Signed-off-by: Lynne Morrison <lynne@voltanet.io>
* Merge pull request #7945 from volta-networks/feat_isis_snmpRenato Westphal2021-03-1516-104/+3964
|\ | | | | isisd: add support for read-only snmp mibs objects
| * isisd: support for snmplynne2021-03-0216-104/+3964
| | | | | | | | | | | | | | 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>
* | isisd, yang, doc: combine config cmd for SRGB+SRLBEmanuele Di Pascale2021-03-105-129/+132
| | | | | | | | | | | | | | | | | | | | | | when changing both ranges at the same time the order of the commands matters, as we need to make sure that the intermediate state is valid. This represents a problem when pushing configuration via frr-reload. To fix this, the global-block command was extended to optionally allow setting the local-block range as well. The local-block command is deprecated with a 1-year notice. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* | isisd: added support for routemap match tag in redistributionEmanuele Altomare2021-03-054-4/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now it's possible to filter routes redistributed by another protocol using tag which comes from zebra daemon. Example of a possible configuration: ``` ! ipv6 route fd00::/48 blackhole tag 20 ipv6 route fd00::/60 blackhole tag 10 ! interface one ipv6 router isis COMMON isis circuit-type level-1 ! interface two ipv6 router isis COMMON isis circuit-type level-2-only ! router isis COMMON net fd.0000.0000.0000.0001.00 redistribute ipv6 static level-1 route-map static-l1 redistribute ipv6 static level-2 route-map static-l2 topology ipv6-unicast ! route-map static-l1 permit 10 match tag 10 ! route-map static-l2 permit 10 match tag 20 ! ``` Signed-off-by: Emanuele Altomare <emanuele@common-net.org>
* | isisd: handle corner case involving TI-LFA and the SR No-PHP flagRenato Westphal2021-02-261-0/+15
| | | | | | | | | | | | | | | | | | | | | | When the last SID in the TI-LFA repair list is an Adj-SID from the penultimate hop router towards the final hop, the No-PHP flag of the original Prefix-SID must be honored in the repair list itself since the penultimate hop router won't have a chance to process that SID and pop it if necessary. Reported-by: Fredi Raspall <fredi@voltanet.io> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | isisd: remove assert from the TI-LFA repair list computation algorithmRenato Westphal2021-02-261-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases it's possible that the TI-LFA algorithms will try to compute a SID repair list more than once for the same backup nexthop [1]. This of course shouldn't be allowed, as a backup nexthop can't have multiple label stacks. When that happens, we should just ignore the new repair list if one is already applied, instead of asserting and crashing the daemon. [1] One scenario this can happen is when there's ECMP involving different P-nodes in the PQ-space intersection. Reported-by: Fredi Raspall <fredi@voltanet.io> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | Merge pull request #8035 from qlyoung/remove-more-sprintfMark Stapp2021-02-234-39/+56
|\ \ | |/ |/| *: remove more sprintf()
| * *: remove more sprintf()Quentin Young2021-02-094-39/+56
| | | | | | | | | | | | | | Should be just a couple non-development, non-test occurrences of this function left now. Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
* | *: remove tabs & newlines from log messagesDavid Lamparter2021-02-141-1/+1
| | | | | | | | | | | | | | Neither tabs nor newlines are acceptable in syslog messages. They also break line-based parsing of file logs. Signed-off-by: David Lamparter <equinox@diac24.net>
* | *: Fix usage of bfd_adj_eventDonald Sharp2021-02-071-3/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Valgrind reports: 469901-==469901== 469901-==469901== Conditional jump or move depends on uninitialised value(s) 469901:==469901== at 0x3A090D: bgp_bfd_dest_update (bgp_bfd.c:416) 469901-==469901== by 0x497469E: zclient_read (zclient.c:3701) 469901-==469901== by 0x4955AEC: thread_call (thread.c:1684) 469901-==469901== by 0x48FF64E: frr_run (libfrr.c:1126) 469901-==469901== by 0x213AB3: main (bgp_main.c:540) 469901-==469901== Uninitialised value was created by a stack allocation 469901:==469901== at 0x3A0725: bgp_bfd_dest_update (bgp_bfd.c:376) 469901-==469901== 469901-==469901== Conditional jump or move depends on uninitialised value(s) 469901:==469901== at 0x3A093C: bgp_bfd_dest_update (bgp_bfd.c:421) 469901-==469901== by 0x497469E: zclient_read (zclient.c:3701) 469901-==469901== by 0x4955AEC: thread_call (thread.c:1684) 469901-==469901== by 0x48FF64E: frr_run (libfrr.c:1126) 469901-==469901== by 0x213AB3: main (bgp_main.c:540) 469901-==469901== Uninitialised value was created by a stack allocation 469901:==469901== at 0x3A0725: bgp_bfd_dest_update (bgp_bfd.c:376) On looking at bgp_bfd_dest_update the function call into bfd_get_peer_info when it fails to lookup the ifindex ifp pointer just returns leaving the dest and src prefix pointers pointing to whatever was passed in. Let's do two things: a) The src pointer was sometimes assumed to be passed in and sometimes not. Forget that. Make it always be passed in b) memset the src and dst pointers to be all zeros. Then when we look at either of the pointers we are not making decisions based upon random data in the pointers. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #7998 from volta-networks/fix_isis_attach_bitDonald Sharp2021-02-054-17/+90
|\ | | | | isisd: When adjacencies go up and down add support to modify attached-bit
| * isisd: When adjacencies go up and down add support to modify attached-bitlynne2021-02-014-17/+90
| | | | | | | | | | | | | | | | | | | | | | | | When adjacencies change state the attached-bits in LSPs in other areas on the router may need to be modified. 1. If a router no longer has a L2 adjacency to another area the attached-bit must no longer be sent in the LSP 2. If a new L2 adjacency comes up in a different area then the attached-bit should be sent in the LSP Signed-off-by: Lynne Morrison <lynne@voltanet.io>
* | Merge pull request #6766 from opensourcerouting/xrefRuss White2021-02-021-1/+2
|\ \ | | | | | | lib: xrefs - general cross-references & unique IDs
| * | lib/xref: use to transport thread_* file/line/funcDavid Lamparter2021-02-011-1/+2
| |/ | | | | | | | | | | Just a better way of doing what was previously the "debugargdef" macro. Signed-off-by: David Lamparter <equinox@diac24.net>
* / isisd: Prevent sending of uninited data to zebraDonald Sharp2021-01-301-0/+1
|/ | | | | | | | | | | | | | | | | | | | | | Valgrind reports: 2172861-==2172861== 2172861-==2172861== Syscall param write(buf) points to uninitialised byte(s) 2172861:==2172861== at 0x49B4FB3: write (write.c:26) 2172861-==2172861== by 0x48A4EA0: buffer_write (buffer.c:475) 2172861-==2172861== by 0x4915AD9: zclient_send_message (zclient.c:298) 2172861-==2172861== by 0x12AE08: isis_ldp_sync_state_req_msg (isis_ldp_sync.c:152) 2172861-==2172861== by 0x12B74B: isis_ldp_sync_adj_state_change (isis_ldp_sync.c:305) 2172861-==2172861== by 0x16DE04: hook_call_isis_adj_state_change_hook.isra.0 (isis_adjacency.c:141) 2172861-==2172861== by 0x16EE27: isis_adj_state_change (isis_adjacency.c:371) 2172861-==2172861== by 0x16F1F3: isis_adj_process_threeway (isis_adjacency.c:242) 2172861-==2172861== by 0x13BCCA: process_p2p_hello (isis_pdu.c:283) 2172861-==2172861== by 0x13BCCA: process_hello (isis_pdu.c:781) 2172861-==2172861== by 0x13BCCA: isis_handle_pdu (isis_pdu.c:1700) Sending of request includes uninited memory at the end of the interface name string. Fix Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* isisd: Remove #if 0 codeDonald Sharp2021-01-282-11/+0
| | | | | | | | Looks like the #if 0 code in this place was for ESI support on solaris. We do not support solaris anymore. So let's remove with prejudice. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* isisd: Fix Attach-bit processinglynne2021-01-2010-40/+223
| | | | | | | | | | | | | | | | | | | | | | | The purpose of the Attach-bit is to accomplish inter-area routing. In other venders, the Attached-bit is automatically set when a router is configured as a L1|L2 router and has two adjacencies. When a L1 router receives a LSP with the Attached-bit set it is supposed to create a default route pointing toward the neighbor to provide a default path out of the L1 area. ISIS implementation has been fixed to support the above definition: Setting the Attach-bit is now the default behavior and we allow the user to turn it off. We will only set the Default Attach-bit when creating a L1 LSP, if we are a L1|L2 router and have a L2 adjacency up. When a L1 router receives a LSP with the Attach-bit set, we will create a default route pointing to the L1|L2 router as the nexthop. The default route will be removed if the LSP is received with the Attach-bit cleared. Signed-off-by: Lynne Morrison <lynne@voltanet.io>
* Merge pull request #7550 from volta-networks/fix_bfd_isisDonald Sharp2021-01-204-0/+57
|\ | | | | isisd: if IS-IS is configured for v6, prefer v6 bfd sessions
| * isisd: if IS-IS is configured for v6, prefer v6 bfd sessionsKaren Schoener2021-01-144-0/+57
| | | | | | | | | | Signed-off-by: Lynne Morrison <lynne@voltanet.io> Signed-off-by: Karen Schoener <karen@voltanet.io>
* | Merge pull request #7707 from opensourcerouting/isisd-rlfaOlivier Dugeon2021-01-1219-57/+1243
|\ \ | | | | | | isisd, ldpd: add Remote LFA support
| * | isisd: remove two overly verbose LFA debug messagesRenato Westphal2021-01-091-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | These two debug messages are so verbose to a point they impact performance when testing RLFA/TI-LFA on large-scale networks. Remove them since they aren't really useful. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | isisd: fix logging of uninitialized data in the TI-LFA codeRenato Westphal2021-01-091-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Always call vid2string() whenever necessary instead of trying to be too clever and call it only once. The original assumption was that "buf" only needed to be initialized when LFA debugging was enabled, but we also need that buffer when logging one error message. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | isisd: implement Remote LFARenato Westphal2021-01-0916-113/+890
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remote LFA (RFC 7490) is an extension to the base LFA mechanism that uses dynamically determined tunnels to extend the IP-FRR protection coverage. RLFA is similar to TI-LFA in that it computes a post-convergence SPT (with the protected interface pruned from the network topology) and the P/Q spaces based on that SPT. There are a few differences however: * RLFAs can push at most one label, so the P/Q spaces need to intersect otherwise the destination can't be protected (the protection coverage is topology dependent). * isisd needs to interface with ldpd to obtain the labels it needs to create a tunnel to the PQ node. That interaction needs to be done asynchronously to prevent blocking the daemon for too long. With TI-LFA all required labels are already available in the LSPDB. RLFA and TI-LFA have more similarities than differences though, and thanks to that both features share a lot of code. Limitations: * Only RLFA link protection is implemented. The algorithm used to find node-protecting RLFAs (RFC 8102) is too CPU intensive and doesn't always work. Most vendors implement RLFA link protection only. * RFC 7490 says it should be a local matter whether the repair path selection policy favors LFA repairs over RLFA repairs. It might be desirable, for instance, to prefer RLFAs that satisfy the downstream condition over LFAs that don't. In this implementation, however, RLFAs are only computed for destinations that can't be protected by local LFAs. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | yang, isisd: add RLFA nodes, skeleton callbacks and CLI commandsRenato Westphal2021-01-094-0/+418
| | | | | | | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | isisd: fix LFA command to use correct operationsRenato Westphal2021-01-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "load-sharing" node is a boolean leaf that has a default value. As such, it doesn't make sense to either create or delete it. That node always exists in the configuration tree. Its value should only be modified. Change the corresponding CLI wrapper command to reflect that fact. This commit doesn't introduce any change of behavior as the NB API maps create/destroy edit operations to modify operations whenever that makes sense. However it's better to not rely on that behavior and always use the correct operations in the CLI commands. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | | isisd: ignore routes w/ incompatible metric styleEmanuele Di Pascale2021-01-091-33/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the transition metric style is redundant because isis will always read both reachability TLVs regardless of the configured metric style. Correct this by only considering TLVs matching our configuration. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* | | isisd: When last area address is removed, resign if we were DRKaren Schoener2021-01-081-0/+9
|/ / | | | | | | | | | | | | | | | | When last area address is removed, resign if we were DR. This fixes an issue where: when the ISIS area address is changed, ISIS fails to elect a new DR. Signed-off-by: Karen Schoener <karen@voltanet.io>