summaryrefslogtreecommitdiffstats
path: root/ospf6d (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ospf6d: Prevent crash in adj_okDonald Sharp2021-11-053-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The adj_ok thread event is being added but not killed when the underlying interface is deleted. I am seeing this crash: OSPF6: Received signal 11 at 1636142186 (si_addr 0x0, PC 0x561d7fc42285); aborting... OSPF6: zlog_signal+0x18c 7f227e93519a 7ffdae024590 /lib/libfrr.so.0 (mapped at 0x7f227e884000) OSPF6: core_handler+0xe3 7f227e97305e 7ffdae0246b0 /lib/libfrr.so.0 (mapped at 0x7f227e884000) OSPF6: funlockfile+0x50 7f227e863140 7ffdae024800 /lib/x86_64-linux-gnu/libpthread.so.0 (mapped at 0x7f227e84f000) OSPF6: ---- signal ---- OSPF6: need_adjacency+0x10 561d7fc42285 7ffdae024db0 /usr/lib/frr/ospf6d (mapped at 0x561d7fbc6000) OSPF6: adj_ok+0x180 561d7fc42f0b 7ffdae024dc0 /usr/lib/frr/ospf6d (mapped at 0x561d7fbc6000) OSPF6: thread_call+0xc2 7f227e989e32 7ffdae024e00 /lib/libfrr.so.0 (mapped at 0x7f227e884000) OSPF6: frr_run+0x217 7f227e92a7f3 7ffdae024ec0 /lib/libfrr.so.0 (mapped at 0x7f227e884000) OSPF6: main+0xf3 561d7fc0f573 7ffdae024fd0 /usr/lib/frr/ospf6d (mapped at 0x561d7fbc6000) OSPF6: __libc_start_main+0xea 7f227e6b0d0a 7ffdae025010 /lib/x86_64-linux-gnu/libc.so.6 (mapped at 0x7f227e68a000) OSPF6: _start+0x2a 561d7fc0f06a 7ffdae0250e0 /usr/lib/frr/ospf6d (mapped at 0x561d7fbc6000) OSPF6: in thread adj_ok scheduled from ospf6d/ospf6_interface.c:678 dr_election() The crash is in the on->ospf6_if pointer is NULL. The only way this could happen from what I can tell is that the event is added to the system and then we immediately delete the interface, removing the memory but not freeing up the adj_ok thread event. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* ospf6d: Prevent use after freeDonald Sharp2021-11-053-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I am seeing a crash of ospf6d with this stack trace: OSPF6: Received signal 11 at 1636042827 (si_addr 0x0, PC 0x55efc2d09ec2); aborting... OSPF6: zlog_signal+0x18c 7fe20c8ca19a 7ffd08035590 /lib/libfrr.so.0 (mapped at 0x7fe20c819000) OSPF6: core_handler+0xe3 7fe20c90805e 7ffd080356b0 /lib/libfrr.so.0 (mapped at 0x7fe20c819000) OSPF6: funlockfile+0x50 7fe20c7f8140 7ffd08035800 /lib/x86_64-linux-gnu/libpthread.so.0 (mapped at 0x7fe20c7e4000) OSPF6: ---- signal ---- OSPF6: ospf6_neighbor_state_change+0xdc 55efc2d09ec2 7ffd08035d90 /usr/lib/frr/ospf6d (mapped at 0x55efc2c8e000) OSPF6: exchange_done+0x15c 55efc2d0ab4a 7ffd08035dc0 /usr/lib/frr/ospf6d (mapped at 0x55efc2c8e000) OSPF6: thread_call+0xc2 7fe20c91ee32 7ffd08035df0 /lib/libfrr.so.0 (mapped at 0x7fe20c819000) OSPF6: frr_run+0x217 7fe20c8bf7f3 7ffd08035eb0 /lib/libfrr.so.0 (mapped at 0x7fe20c819000) OSPF6: main+0xf3 55efc2cd7573 7ffd08035fc0 /usr/lib/frr/ospf6d (mapped at 0x55efc2c8e000) OSPF6: __libc_start_main+0xea 7fe20c645d0a 7ffd08036000 /lib/x86_64-linux-gnu/libc.so.6 (mapped at 0x7fe20c61f000) OSPF6: _start+0x2a 55efc2cd706a 7ffd080360d0 /usr/lib/frr/ospf6d (mapped at 0x55efc2c8e000) OSPF6: in thread exchange_done scheduled from ospf6d/ospf6_message.c:2264 ospf6_dbdesc_send_newone() The stack trace when decoded is: (gdb) l *(ospf6_neighbor_state_change+0xdc) 0x7bec2 is in ospf6_neighbor_state_change (ospf6d/ospf6_neighbor.c:200). warning: Source file is more recent than executable. 195 on->name, ospf6_neighbor_state_str[prev_state], 196 ospf6_neighbor_state_str[next_state], 197 ospf6_neighbor_event_string(event)); 198 } 199 200 /* Optionally notify about adjacency changes */ 201 if (CHECK_FLAG(on->ospf6_if->area->ospf6->config_flags, 202 OSPF6_LOG_ADJACENCY_CHANGES) 203 && (CHECK_FLAG(on->ospf6_if->area->ospf6->config_flags, 204 OSPF6_LOG_ADJACENCY_DETAIL) OSPFv3 is creating the event without a managing thread and as such if the event is not run before a deletion event comes in memory will be freed up and we'll start trying to access memory we should not. Modify ospfv3 to track the thread and appropriately stop it when the memory is deleted or it is no longer need to run that bit of code. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #9833 from idryzhov/cleanup-if-by-index-all-vrfRuss White2021-11-051-11/+13
|\ | | | | *: fix usage of if_lookup_by_index_all_vrf
| * ospf6d: don't use if_lookup_by_index_all_vrfIgor Ryzhov2021-10-281-11/+13
| | | | | | | | | | | | | | | | | | | | if_lookup_by_index_all_vrf doesn't work correctly with netns VRF backend as the same index may be used in multiple netns simultaneously. We always know the OSPF6 instance we work with, so use its VRF id for the interface lookup. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | ospf6d: avoid writing dumb ospf6 info at startupPhilippe Guibert2021-11-031-0/+4
| | | | | | | | | | | | | | | | | | in show: 'show ipv6 ospf6' handler command, the reason of SPF executation is looked up and displayed. At startup, SPF has been started, but shows no specific reason. Instead of dumping non initialised string context, reset the string context. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | Merge pull request #9863 from ton31337/feature/prefix-list_autocompleteIgor Ryzhov2021-10-291-2/+2
|\ \ | | | | | | lib: Add autocomplete for prefix-list under route-maps
| * | ospf6d: Add autocomplete for `area X filter-list prefix`Donatas Abraitis2021-10-281-2/+2
| | | | | | | | | | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* | | Merge pull request #9831 from manojvn/379909_383518Igor Ryzhov2021-10-284-10/+12
|\ \ \ | |/ / |/| | ospf6d: minor code enhancements.
| * | ospf6d: remove unnecessary break.Manoj Naragund2021-10-261-1/+0
| | | | | | | | | | | | Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
| * | ospf6d: prefix structure compare changes.Manoj Naragund2021-10-261-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | Description: Code changes involve replacing memcmp with prefix_same, for comparing prefix structures. Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
| * | ospf6d: minor code enhancements.Manoj Naragund2021-10-262-6/+11
| |/ | | | | | | | | | | | | | | Description: code changes involve removal of increment and decrement operators during function calls. These expressions make code less readable. Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
* | Merge pull request #9837 from idryzhov/cleanup-if-by-name-vrf-allRuss White2021-10-271-2/+4
|\ \ | | | | | | *: fix usage of if_lookup_by_name_all_vrf
| * | ospf6d: don't use if_lookup_by_name_all_vrfIgor Ryzhov2021-10-151-2/+4
| |/ | | | | | | | | | | | | | | | | if_lookup_by_name_all_vrf doesn't work correctly with netns VRF backend as the same index may be used in multiple netns simultaneously. Use the appropriate VRF when looking for the interface. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | *: convert zclient callbacks to tableDavid Lamparter2021-10-201-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | This removes a giant `switch { }` block from lib/zclient.c and harmonizes all zclient callback function types to be the same (some had a subset of the args, some had a void return, now they all have ZAPI_CALLBACK_ARGS and int return.) Apart from getting rid of the giant switch, this is a minor security benefit since the function pointers are now in a `const` array, so they can't be overwritten by e.g. heap overflows for code execution anymore. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | Merge pull request #9752 from opensourcerouting/ospf6d-nssa-rangesRuss White2021-10-2013-364/+315
|\ \ | | | | | | ospf6d: add support for NSSA Type-7 address ranges
| * | ospf6d: add support for NSSA Type-7 address rangesRenato Westphal2021-10-066-25/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement NSSA address ranges as specified by RFC 3101: NSSA border routers may be configured with Type-7 address ranges. Each Type-7 address range is defined as an [address,mask] pair. Many separate Type-7 networks may fall into a single Type-7 address range, just as a subnetted network is composed of many separate subnets. NSSA border routers may aggregate Type-7 routes by advertising a single Type-5 LSA for each Type-7 address range. The Type-5 LSA resulting from a Type-7 address range match will be distributed to all Type-5 capable areas. Syntax: area A.B.C.D nssa range X:X::X:X/M [<not-advertise|cost (0-16777215)>] Example: router ospf6 ospf6 router-id 1.1.1.1 area 1 nssa area 1 nssa range 2001:db8:1000::/64 area 1 nssa range 2001:db8:2000::/64 ! Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospf6d: fix lookup of translated Type-5 LSARenato Westphal2021-10-061-19/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Type-7 LSAs and their corresponding Type-5 LSAs don't share the same LS IDs (unlike in the case of OSPFv2). As such, do not attempt to find a translated Type-5 LSA using the LS ID of a Type-7 LSA. Instead, use the LS-ID stored in the OSPF routing table. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospf6d: assorted code cleanupRenato Westphal2021-10-063-81/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commits consists of several changes that positively impact code reability without introducing any logical change. Summary of the changes: * Return earlier in ospf6_abr_range_update() in order to reduce one level of indentation; * Remove ospf6_translated_nssa_originate() since it's nothing other than a useless wrapper around ospf6_lsa_translated_nssa_new(); * Change ospf6_abr_translate_nssa() to return void; * Change ospf6_abr_process_nssa_translates() checking for NSSA areas before anything else; * Remove ospf6_abr_remove_unapproved_translates_apply() since it's a small function that is only called in one place; * Change ospf6_abr_check_translate_nssa() to avoid an LSDB lookup when the router isn't an ABR. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospf6d: remove unnecessary check when translating Type-7 LSARenato Westphal2021-10-061-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | In addition to being unnecessary, this check is problematic for the upcoming NSSA ranges feature since NSSA ranges aren't added to the OSPF routing table. Remove this for simplicity. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospf6d: fix memleak when translating NSSA LSARenato Westphal2021-10-061-2/+3
| | | | | | | | | | | | | | | | | | Stop leaking 4096 bytes for each translated LSA. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospf6d: remove incomplete support for NSSA rangesRenato Westphal2021-10-061-83/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This code tries to summarize NSSA Type-7 LSAs using normal ranges which are intended to summarize Type-3 LSAs only. This is not only wrong, but the code is incomplete and lacking lots of things. Better to remove it before implementing NSSA ranges correctly. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospf6d: fix processing of translated AS-external LSAsRenato Westphal2021-10-061-20/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The iteration performed on ospf6_abr_unapprove_translates() was wrong since AS-external LSAs are stored in the global LSDB and not in the area LSDBs. As such, the "unapproved" flag wasn't being set in any translated AS-external LSA, leading them to linger forever. Fix the LSDB iteration and make the required changes to unset the "unapproved" flag for AS-external LSAs that shouldn't be removed. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospf6d: be careful to not refresh translated Type-5 LSAs twiceRenato Westphal2021-10-061-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | The ABR task already takes care of refreshing translated Type-5 LSAs that correspond to self-originated Type-7 LSAs. There's no need to do that in ospf_external_lsa_install() as well. The ospfd NSSA code takes the same precaution. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospf6d: fix selection of NSSA forwarding addressRenato Westphal2021-10-062-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change ospf6_get_nssa_fwd_addr() to try finding a global address on any interface of the area and not on the first one only. Additionally, do a micro-optimization in ospf6_interface_get_global_address() to return as soon as a global address is found. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospf6d: add "nssa" option to the "debug ospf6 lsa" commandRenato Westphal2021-10-061-2/+4
| | | | | | | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospf6d: remove unnecessary codeRenato Westphal2021-10-062-106/+0
| | | | | | | | | | | | | | | | | | | | | Every received or originated LSA is automatically scheduled to be refreshed periodically, there's no need to do that manually here. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospf6d: declare neighbor memtype as staticRenato Westphal2021-10-061-1/+1
| | | | | | | | | | | | | | | | | | This is the only ospf6d memtype that wasn't being declared as static. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospf6d: remove unused bitfieldRenato Westphal2021-10-063-4/+0
| | | | | | | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospf6d: remove redundant loopRenato Westphal2021-10-061-7/+5
| | | | | | | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospf6d: remove unguarded debug messageRenato Westphal2021-10-061-2/+0
| | | | | | | | | | | | | | | | | | | | | This debug message is of little use so remove it instead of adding a debug guard for it. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospf6d: remove unused function parameterRenato Westphal2021-10-061-14/+9
| | | | | | | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | | lib: allow to create interfaces in non-existing VRFsIgor Ryzhov2021-10-191-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It allows FRR to read the interface config even when the necessary VRFs are not yet created and interfaces are in "wrong" VRFs. Currently, such config is rejected. For VRF-lite backend, we don't care at all about the VRF of the inactive interface. When the interface is created in the OS and becomes active, we always use its actual VRF instead of the configured one. So there's no need to reject the config. For netns backend, we may have multiple interfaces with the same name in different VRFs. So we care about the VRF of inactive interfaces. And we must allow to preconfigure the interface in a VRF even before it is moved to the corresponding netns. From now on, we allow to create multiple configs for the same interface name in different VRFs and the necessary config is applied once the OS interface is moved to the corresponding netns. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | | Merge pull request #9813 from opensourcerouting/ospf-gr-fixesDonald Sharp2021-10-151-1/+1
|\ \ \ | | | | | | | | ospfd: more GR fixes
| * | | ospf6d: fix LSA name in debug messageRenato Westphal2021-10-121-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | | | ospf6d: remove no-opIgor Ryzhov2021-10-141-1/+0
| |_|/ |/| | | | | | | | | | | | | | ospf6_route_create already sets route->ospf6. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | | Merge pull request #9676 from donaldsharp/import_registerDavid Lamparter2021-10-131-4/+5
|\ \ \ | |/ / |/| |
| * | ospf6d: Make ospfv3 use normal address resolution instead of import routeDonald Sharp2021-09-271-3/+3
| | | | | | | | | | | | | | | | | | | | | OSPFv3 recently introduced the usage of import route. Switch it back to using the normal ZEBRA_NEXTHOP_REGISTER command. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | *: Add resolve via default flagDonald Sharp2021-09-271-1/+2
| | |
* | | Merge pull request #9763 from ton31337/fix/more_thread_nullRuss White2021-10-125-14/+0
|\ \ \ | | | | | | | | More struct thread null
| * | | ospf6d: Do not explicitly set the thread pointer to NULLDonatas Abraitis2021-10-085-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FRR should only ever use the appropriate THREAD_ON/THREAD_OFF semantics. This is espacially true for the functions we end up calling the thread for. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* | | | ospf6d: add missing vrf parameter to "clear ipv6 ospf6 interface"Igor Ryzhov2021-10-091-9/+21
|/ / / | | | | | | | | | | | | | | | Currently, it's not possible to run this command in any VRF other than default. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | | Merge pull request #9740 from caracall/forked-upstream/debug_ospf6Igor Ryzhov2021-10-071-2/+4
|\ \ \ | | | | | | | | ospf6: add the ability of specifying router-id/area-id in no debug ospf6
| * | | ospf6: add the ability of specifying router-id/area-id in no debug ospf6Ahmad Caracalli2021-10-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the ability to specify the router-id/area-id when deleting the debug ospf6 configuration. The new commands are as follow: no debug ospf6 border-routers router-id [A.B.C.D] no debug ospf6 border-routers area-id [A.B.C.D] Update the doc as well. Signed-off-by: Ahmad Caracalli <ahmad.caracalli@6wind.com>
* | | | Merge pull request #9699 from manojvn/379032-devRuss White2021-10-077-27/+22
|\ \ \ \ | | | | | | | | | | ospf6d: minor struct compare issues.
| * | | | ospf6d: code cleanup.Manoj Naragund2021-10-067-24/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | removal of some of the deadcode in ospf6d. Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
| * | | | ospf6d: minor struct compare issues.Manoj Naragund2021-09-304-16/+19
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem Statement: Multiple struct compare using memcmp, which might result in issue due to structure padding/alignment. Fix: The code changes involve structure member by member comparison to remove any issues related to padding/alignment. Signed-off-by: Manoj Naragund <mnaragund@vmware.com> (cherry picked from commit 67db821a1d6d68b19862d50b68ed19278c5f2422)
* | | | Merge pull request #9738 from rgirada/ospfv3_crashRuss White2021-10-071-7/+8
|\ \ \ \ | |_|_|/ |/| | | ospf6d: ospf6d is crashing upon receiving duplicated Grace LSA.
| * | | ospf6d: ospf6d is crashing upon receiving duplicated Grace LSA.rgirada2021-10-051-7/+8
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Description: When grace lsa received, DUT is adding the copy of the lsas to all nbrs retransmission list as part of flooding procedure and subsequently incrementing the rmt counter in the original the LSA. This counter is supposed to be decremented when ack is received by nbr and the lsa will be removed from retransmission list. But in our current scenario, Step-1: When GR helper is disabled, if DUT receives the grace lsa it adds the lsa copy to nbrs retransmission list but original LSA will be discarded since GR helper disabled. Step-2: GR helper enabled and DUT receives the grace lsa, as part of flooding process all nbrs have same copy of lsa in their corresponding rmt list which was added in step -1 due to this the corresponding rmt counter in the original lsa is not getting incremented. Step-3: If the same copy of the grace lsa received by DUT, It considers as implicit ack from nbr if the same copy of the lsa exits in its rmt list and subsequently decrement the rmt counter. Since counter is zero (because of step-1 and 2) , it is asserting while decrement. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
* | | Merge pull request #9731 from ton31337/fix/thread_null_setRuss White2021-10-066-15/+0
|\ \ \ | |_|/ |/| | cleanup: struct thread = NULL
| * | ospf6d: Do not explicitly set the thread pointer to NULLDonatas Abraitis2021-10-046-16/+0
| |/ | | | | | | | | | | | | | | FRR should only ever use the appropriate THREAD_ON/THREAD_OFF semantics. This is espacially true for the functions we end up calling the thread for. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>