summaryrefslogtreecommitdiffstats
path: root/isisd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* isisd: avoid fast-reroute from running twice on a down interface eventLouis Scalbert2022-05-241-1/+2
| | | | | | | | | isis_ifp_down() may in some circumstances be called twice on a down interface event. Avoid applying fast-reroute on an already down interface. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* isisd: avoid fast-reroute on down adjacency when the interface is downLouis Scalbert2022-05-243-2/+7
| | | | | | | | | | | | When an IS-IS interface is coming down, fast-reroute may be triggered twice: a first time after the detection of the interface down event and a second time after the detection of the adjacency down (because of the expiration of the ISIS Hello or BFD timers). Avoid a BFD down event from running fast-reroute another time if the interface was already detected down. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* isisd: apply fast-reroute when an interface falls downLouis Scalbert2022-05-231-0/+5
| | | | | | | | | | | | | | | | Backup routes are sent to zebra by routing daemons such as isisd so that the dataplane can pre-install them with a lower priority. When an interface comes down, the associated primary routes are discarded by the dataplane and the backup ones take over. However, some dataplanes (e.g. Netlink ones) do not pre-install the backup routes. Associated prefixes have no next-hop until SPF is recomputed. Apply fast-reroute as soon as an interface falls down by sending route UPDATEs to zebra. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* isisd: allow nexthop lookup on interface onlyLouis Scalbert2022-05-231-2/+8
| | | | | | | Allow the nexthoplookup function to return the first nexthop found on ifindex interface if the IP is unspecified. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* isisd: remove previous labels before fast-rerouteLouis Scalbert2022-05-231-11/+17
| | | | Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* isisd: apply fast-reroute on an adjacency failureLouis Scalbert2022-05-2310-1/+155
| | | | | | | | | | | | | | | | | When a adjacency falls down, the primary routes are not deleted on the dataplane until the SPF is recomputed. Even the backup routes are pre-installed on the dataplane, there is no fast-route optimization. Reasons for an adjacency to come down are: - BFD down - Hello timer timeout - User adjacency clear Apply the backup route switchover for fast-reroute as soon an IS-IS adjacency falls down before the first SPF re-computation. Pre-computed backup routes are applied sooner. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* *: Properly use memset() when zeroingDonatas Abraitis2022-05-113-7/+7
| | | | | | | Wrong: memset(&a, 0, sizeof(struct ...)); Good: memset(&a, 0, sizeof(a)); Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* Merge pull request #11163 from opensourcerouting/fix/same_type_castingIgor Ryzhov2022-05-091-1/+1
|\ | | | | *: Avoid casting to the same type as on the left
| * *: Avoid casting to the same type as on the leftDonatas Abraitis2022-05-081-1/+1
| | | | | | | | | | | | Just not necessary. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* | isisd: Prevent direct copy of different size prefix'esDonald Sharp2022-05-071-1/+1
| | | | | | | | | | | | | | | | | | Memory is allocated for a `struct prefix_ipv6` but it was directly copied into a `struct prefix` via direct pointer copy, which leads to a read past end of memory. Fix by using prefix_copy Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | isisd: Remove unneeded pre-declarationsDonald Sharp2022-05-071-19/+0
| | | | | | | | | | | | I don't know what was going on. Removing the weird c structures. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | isisd: Fix read past end of stringDonald Sharp2022-05-071-1/+1
|/ | | | | | using a memcpy for a strdup'ed string. bad mojo Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: remove the checking returned value for hash_get()anlan_cs2022-05-022-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Firstly, *keep no change* for `hash_get()` with NULL `alloc_func`. Only focus on cases with non-NULL `alloc_func` of `hash_get()`. Since `hash_get()` with non-NULL `alloc_func` parameter shall not fail, just ignore the returned value of it. The returned value must not be NULL. So in this case, remove the unnecessary checking NULL or not for the returned value and add `void` in front of it. Importantly, also *keep no change* for the two cases with non-NULL `alloc_func` - 1) Use `assert(<returned_data> == <searching_data>)` to ensure it is a created node, not a found node. Refer to `isis_vertex_queue_insert()` of isisd, there are many examples of this case in isid. 2) Use `<returned_data> != <searching_data>` to judge it is a found node, then free <searching_data>. Refer to `aspath_intern()` of bgpd, there are many examples of this case in bgpd. Here, <returned_data> is the returned value from `hash_get()`, and <searching_data> is the data, which is to be put into hash table. Signed-off-by: anlan_cs <vic.lan@pica8.com>
* isisd: ldp cleaning issue on invalid sptreeFrancois Dumontet2022-04-221-0/+5
| | | | | | | | | | | | | | | | | | | That commit aim is to fix an invalid isis access to sptree when lpd is stopping. isisd is running. lpd and isisd are running. isis is L1 type configured. isis_ldp_rlfa_handle_client_close function try to clear uninitialized spftree. Expected behavior: isisd not crashing and running. isis_ldp_rlfa_handle_client_close not trying to clear spftree that are not initializes due tio the configuration. Fix: test the configured area's type avoiding to deleted an unconfigured sptree. function isis_rlfa_handle_client_close will be aligned on spftree_area_del function Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
* Merge pull request #11061 from pguibert6WIND/debug_isis_bfd_tooDonald Sharp2022-04-201-0/+2
|\ | | | | isisd: enable BFD messaging debug when isis bfd is used
| * isisd: enable BFD messaging debug when isis bfd is usedPhilippe Guibert2022-04-201-0/+2
| | | | | | | | | | | | | | | | In addition to turning on isis bfd debugging traces, the internal bfd messaging debug is also enabled. Reversely, when isis bfd traces are off, the internal messaging debug traces are off too. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | Merge pull request #11060 from pguibert6WIND/isis_dr_resign_debugDonald Sharp2022-04-201-1/+2
|\ \ | | | | | | isisd: isis_dr_resign() trace braced with debug isis events
| * | isisd: isis_dr_resign() trace braced with debug isis eventsPhilippe Guibert2022-04-201-1/+2
| |/ | | | | | | | | | | | | debug isis events will also be used to not display isis_dr_resign() event trace. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | Merge pull request #10961 from opensourcerouting/build-ms-extDonald Sharp2022-04-201-1/+2
|\ \ | | | | | | build: enable `-fms-extensions`
| * | build: first header *must* be zebra.h or config.hDavid Lamparter2022-04-041-1/+2
| |/ | | | | | | | | | | | | | | This has already been a requirement for Solaris, it is still a requirement for some of the autoconf feature checks to work correctly, and it will be a requirement for `-fms-extensions`. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | Merge pull request #11051 from donaldsharp/speell_moreDonatas Abraitis2022-04-204-6/+6
|\ \ | | | | | | Speell more
| * | *: Fix spelling of accomodateDonald Sharp2022-04-192-2/+2
| | | | | | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | *: Fix spelling of non-existantDonald Sharp2022-04-191-1/+1
| | | | | | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | *: Fix spelling of specifedDonald Sharp2022-04-191-3/+3
| | | | | | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | | Merge pull request #10983 from pguibert6WIND/show_isis_nbr_bfdRuss White2022-04-191-0/+10
|\ \ \ | |/ / |/| | isisd: add bfd information on isis neighbor show command
| * | isisd: add bfd information on isis neighbor show commandPhilippe Guibert2022-04-081-0/+10
| |/ | | | | | | | | | | Add bfd information on show isis neighbor command. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* / isisd: Fix crash in ISIS when mtu mismatch occurslynnemorrison2022-04-182-50/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When lsp-mtu is configured larger than interface mtu and the interface is brought up, the ISIS code would crash. When other vendors have this misconfiguration they just continue ISIS running and allow the LSP packets to be created but not sent. When the misconfiguration is corrected the LSP packets start being sent. This change creates that same behavior in FRR. The startup issue I am hitting is when the isis lsp-mtu is larger that the interfaces mtu. We run into this case when we are in the process of changing the mtu on a tunnel. I issue a shutdown/no shutdown on the interface, because the tunnel MTU is smaller than the lsp-mtu, it is considered an error and calls circuit_if_del. This deletes part of the circuit information, which includes the circuit->ip_addr list. Later on we get an address update from zebra and try to add the interface address to this list and crash. 2022/04/07 20:19:52.032 ISIS: [GTRPJ-X68CG] CSM_EVENT for tun_gw2: IF_UP_FROM_Z calls isis_circuit_if_add this initialize the circuit->ip_addrs isis_circuit_up has the mtu check circuit->area->lsp_mtu > isis_circuit_pdu_size(circuit) and fails returns ISIS_ERROR on failure call isis_circuit_if_del this deletes the circiut->ip_addrs list <---- 2022/04/07 20:19:52.032 ZEBRA: [NXYHN-ZKW2V] zebra_if_addr_update_ctx: INTF_ADDR_ADD: ifindex 3, addr 192.168.0.1/24 message to isisd to add address isis_zebra_if_address_add isis_circuit_add_addr circuit->ip_addr we try to add the ip address to the list, but it was deleted above and isisd crashes Signed-off-by: Lynne Morrison <lynne.morrison@ibm.com>
* *: Fix spelling of FollowingDonald Sharp2022-04-011-2/+2
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #10944 from pguibert6WIND/isis_misc_fixesDonald Sharp2022-04-012-1/+3
|\ | | | | Isis misc fixes
| * isisd: fix typo in show debuggingPhilippe Guibert2022-03-311-1/+1
| | | | | | | | | | | | fix typo in show debugging. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
| * isisd: prevent from accessing a non initialised pointerPhilippe Guibert2022-03-311-0/+2
| | | | | | | | | | | | | | When using bfd on a single level, one may access a null pointer list. Prevent from using it. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | isisd, lib, ospfd, pathd: Null out free'd pointerDonald Sharp2022-03-311-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commands: router isis 1 mpls-te on no mpls-te on mpls-te on no mpls-te on ! Will crash Valgrind gives us this: ==652336== Invalid read of size 8 ==652336== at 0x49AB25C: typed_rb_min (typerb.c:495) ==652336== by 0x4943B54: vertices_const_first (link_state.h:424) ==652336== by 0x493DCE4: vertices_first (link_state.h:424) ==652336== by 0x493DADC: ls_ted_del_all (link_state.c:1010) ==652336== by 0x47E77B: isis_instance_mpls_te_destroy (isis_nb_config.c:1871) ==652336== by 0x495BE20: nb_callback_destroy (northbound.c:1131) ==652336== by 0x495B5AC: nb_callback_configuration (northbound.c:1356) ==652336== by 0x4958127: nb_transaction_process (northbound.c:1473) ==652336== by 0x4958275: nb_candidate_commit_apply (northbound.c:906) ==652336== by 0x49585B8: nb_candidate_commit (northbound.c:938) ==652336== by 0x495CE4A: nb_cli_classic_commit (northbound_cli.c:64) ==652336== by 0x495D6C5: nb_cli_apply_changes_internal (northbound_cli.c:250) ==652336== Address 0x6f928e0 is 272 bytes inside a block of size 320 free'd ==652336== at 0x48399AB: free (vg_replace_malloc.c:538) ==652336== by 0x494BA30: qfree (memory.c:141) ==652336== by 0x493D99D: ls_ted_del (link_state.c:997) ==652336== by 0x493DC20: ls_ted_del_all (link_state.c:1018) ==652336== by 0x47E77B: isis_instance_mpls_te_destroy (isis_nb_config.c:1871) ==652336== by 0x495BE20: nb_callback_destroy (northbound.c:1131) ==652336== by 0x495B5AC: nb_callback_configuration (northbound.c:1356) ==652336== by 0x4958127: nb_transaction_process (northbound.c:1473) ==652336== by 0x4958275: nb_candidate_commit_apply (northbound.c:906) ==652336== by 0x49585B8: nb_candidate_commit (northbound.c:938) ==652336== by 0x495CE4A: nb_cli_classic_commit (northbound_cli.c:64) ==652336== by 0x495D6C5: nb_cli_apply_changes_internal (northbound_cli.c:250) ==652336== Block was alloc'd at ==652336== at 0x483AB65: calloc (vg_replace_malloc.c:760) ==652336== by 0x494B6F8: qcalloc (memory.c:116) ==652336== by 0x493D7D2: ls_ted_new (link_state.c:967) ==652336== by 0x47E4DD: isis_instance_mpls_te_create (isis_nb_config.c:1832) ==652336== by 0x495BB29: nb_callback_create (northbound.c:1034) ==652336== by 0x495B547: nb_callback_configuration (northbound.c:1348) ==652336== by 0x4958127: nb_transaction_process (northbound.c:1473) ==652336== by 0x4958275: nb_candidate_commit_apply (northbound.c:906) ==652336== by 0x49585B8: nb_candidate_commit (northbound.c:938) ==652336== by 0x495CE4A: nb_cli_classic_commit (northbound_cli.c:64) ==652336== by 0x495D6C5: nb_cli_apply_changes_internal (northbound_cli.c:250) ==652336== by 0x495D23E: nb_cli_apply_changes (northbound_cli.c:268) Let's null out the pointer. After this change. Valgrind no longer reports issues and isisd no longer crashes. Fixes: #10939 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #10913 from louis-oui/lsp-parseRuss White2022-03-291-8/+20
|\ | | | | isisd: fix infinite loop when parsing LSPs
| * isisd: fix infinite loop when parsing LSPsLouis Scalbert2022-03-291-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixing the crash: > #0 0x0000560aa80f8e30 in lspdb_const_find (h=<error reading variable: Cannot access memory at address 0x7fff5e95efe8>, item=<error reading variable: Cannot access memory at address 0x7fff5e95efe0>) at ./isisd/isis_lsp.h:64 > #1 0x0000560aa80f8e9d in lspdb_find (h=0x560aaa1ed3b8, item=0x7fff5e95f050) at ./isisd/isis_lsp.h:64 > #2 0x0000560aa80f92f9 in lsp_search (head=0x560aaa1ed3b8, id=0x7fff5e95f200 "") at isisd/isis_lsp.c:100 > #3 0x0000560aa8113d69 in spf_adj_list_parse_tlv (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, id=0x560aad331a78 "", desig_is_id=0x0, pseudo_metric=0, metric=3, oldmetric=false, subtlvs=0x0) at isisd/isis_spf.c:1330 > #4 0x0000560aa811419d in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1f4e50, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1429 > #5 0x0000560aa81141fe in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1ff8e0, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1442 > #6 0x0000560aa81141fe in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1f4e50, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1442 > (...) > #65507 0x0000560aa81141fe in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1ff8e0, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1442 > #65508 0x0000560aa81141fe in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1f4e50, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1442 > #65509 0x0000560aa81141fe in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1ff8e0, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1442 > #65510 0x0000560aa81141fe in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1f4e50, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1442 > #65511 0x0000560aa8114313 in isis_spf_build_adj_list (spftree=0x560aaa1f09d0, lsp=0x560aaa1f4e50) at isisd/isis_spf.c:1455 > #65512 0x0000560aa8114f09 in isis_run_spf (spftree=0x560aaa1f09d0) at isisd/isis_spf.c:1775 > #65513 0x0000560aa8115057 in isis_run_spf_with_protection (area=0x560aaa1ed3b0, spftree=0x560aaa1f09d0) at isisd/isis_spf.c:1801 > #65514 0x0000560aa8115311 in isis_run_spf_cb (thread=0x7fff5f15e5a0) at isisd/isis_spf.c:1859 > #65515 0x00007f90bac66dcc in thread_call (thread=0x7fff5f15e5a0) at lib/thread.c:2002 > #65516 0x00007f90bac013ee in frr_run (master=0x560aa9f5cb40) at lib/libfrr.c:1196 > #65517 0x0000560aa80e7da2 in main (argc=2, argv=0x7fff5f15e7b8, envp=0x7fff5f15e7d0) at isisd/isis_main.c:273 Fixes: 7b36d36e0e ("isisd: make the SPF code more modular") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* | isisd: add guard debug when compiling with EXTREME_DEBUGPhilippe Guibert2022-03-233-44/+68
|/ | | | Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* Merge pull request #10701 from rampxxxx/feat_isis_json_show_cmdsRuss White2022-03-0813-412/+1997
|\ | | | | Feat isis json show cmds
| * isisd: Add json to show isis database command.Javier Garcia2022-03-027-360/+1164
| | | | | | | | Signed-off-by: Javier Garcia <javier.martin.garcia@ibm.com>
| * isisd: Add json to show isis neighbor command.Javier Garcia2022-03-013-37/+373
| | | | | | | | Signed-off-by: Javier Garcia <javier.martin.garcia@ibm.com>
| * isisd: Add json to show isis interface command.Javier Garcia2022-02-253-17/+287
| | | | | | | | Signed-off-by: Javier Garcia <javier.martin.garcia@ibm.com>
| * isisd. Add json to show summary command.Javier Garcia2022-02-253-5/+180
| | | | | | | | Signed-off-by: Javier Garcia <javier.martin.garcia@ibm.com>
* | Merge pull request #10566 from whichbug/masterRuss White2022-02-281-8/+8
|\ \ | | | | | | isisd: use base64 to encode the binary data.
| * | isisd: fix #10505 using base64 encodingwhichbug2022-02-221-8/+8
| |/ | | | | | | | | | | | | Using base64 instead of the raw string to encode the binary data. Signed-off-by: whichbug <whichbug@github.com>
* | *: Change thread->func to return void instead of intDonald Sharp2022-02-2417-89/+59
| | | | | | | | | | | | | | The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | isisd: Drop deprecated `segment-routing local-block` commandDonatas Abraitis2022-02-231-44/+0
|/ | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* Merge pull request #10517 from idryzhov/isis_router_cap_tlv_fixesRuss White2022-02-082-11/+60
|\ | | | | isisd: fix router capability TLV parsing issues
| * isisd: fix router capability TLV parsing issuesJuraj Vijtiuk2022-02-082-11/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | isis_tlvs.c would fail at multiple places if incorrect TLVs were received causing stream assertion violations. This patch fixes the issues by adding missing length checks, missing consumed length updates and handling malformed Segment Routing subTLVs. Signed-off-by: Juraj Vijtiuk <juraj.vijtiuk@sartura.hr> Small adjustments by Igor Ryzhov: - fix incorrect replacement of srgb by srlb on lines 3052 and 3054 - add length check for ISIS_SUBTLV_ALGORITHM - fix conflict in fuzzing data during rebase Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | isisd: Fixup IS-IS-TE bugOlivier Dugeon2022-02-021-0/+1
|/ | | | | | | Default metric is not correctly propagated to Link State client due to a missing flag on Link State Attributes. This patch correct the problem. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* bgpd,pimd,isisd,nhrpd: Convert to vty_json()Donatas Abraitis2022-01-311-6/+2
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* isisd: remove deprecated commandIgor Ryzhov2022-01-271-18/+0
| | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* *: do not print vrf name for interface config when using vrf-liteIgor Ryzhov2022-01-241-2/+2
| | | | | | | VRF name should not be printed in the config since 574445ec. The update was done for NB config output but I missed it for regular vty output. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>