#5516 [dua] handle AddressError

Merged Simon Lin simonlingoogle
Coverage Reach
src/core/thread/mle_router.cpp src/core/thread/mle.cpp src/core/thread/lowpan.cpp src/core/thread/network_data_leader_ftd.cpp src/core/thread/mesh_forwarder.cpp src/core/thread/network_diagnostic.cpp src/core/thread/address_resolver.cpp src/core/thread/mesh_forwarder_ftd.cpp src/core/thread/network_data.cpp src/core/thread/dua_manager.cpp src/core/thread/mlr_manager.cpp src/core/thread/network_data_leader.cpp src/core/thread/indirect_sender.cpp src/core/thread/router_table.cpp src/core/thread/topology.cpp src/core/thread/network_data_tlvs.hpp src/core/thread/link_metrics.cpp src/core/thread/discover_scanner.cpp src/core/thread/network_data_local.cpp src/core/thread/child_table.cpp src/core/thread/mle_tlvs.hpp src/core/thread/neighbor_table.cpp src/core/thread/network_diagnostic_tlvs.hpp src/core/thread/key_manager.cpp src/core/thread/csl_tx_scheduler.cpp src/core/thread/link_quality.cpp src/core/thread/topology.hpp src/core/thread/energy_scan_server.cpp src/core/thread/mle.hpp src/core/thread/thread_netif.cpp src/core/thread/time_sync_service.cpp src/core/thread/src_match_controller.cpp src/core/thread/network_data_notifier.cpp src/core/thread/network_data.hpp src/core/thread/panid_query_server.cpp src/core/thread/lowpan.hpp src/core/thread/announce_sender.cpp src/core/thread/mle_router.hpp src/core/thread/mle_types.hpp src/core/thread/router_table.hpp src/core/thread/announce_begin_server.cpp src/core/thread/key_manager.hpp src/core/thread/child_table.hpp src/core/thread/address_resolver.hpp src/core/thread/link_quality.hpp src/core/thread/mle_types.cpp src/core/thread/link_metrics_tlvs.hpp src/core/thread/indirect_sender.hpp src/core/thread/csl_tx_scheduler.hpp src/core/thread/mesh_forwarder.hpp src/core/thread/mesh_forwarder_mtd.cpp src/core/thread/thread_tlvs.hpp src/core/thread/tmf.cpp src/core/thread/network_data_leader_ftd.hpp src/core/thread/time_sync_service.hpp src/core/thread/dua_manager.hpp src/core/thread/network_data_leader.hpp src/core/thread/tmf.hpp src/core/thread/thread_netif.hpp src/core/thread/discover_scanner.hpp src/core/thread/mlr_manager.hpp src/core/thread/neighbor_table.hpp src/core/thread/src_match_controller.hpp src/core/meshcop/commissioner.cpp src/core/meshcop/dtls.cpp src/core/meshcop/dataset_manager.cpp src/core/meshcop/border_agent.cpp src/core/meshcop/joiner.cpp src/core/meshcop/dataset.cpp src/core/meshcop/dataset_manager_ftd.cpp src/core/meshcop/meshcop_tlvs.hpp src/core/meshcop/joiner_router.cpp src/core/meshcop/meshcop.cpp src/core/meshcop/meshcop_leader.cpp src/core/meshcop/meshcop_tlvs.cpp src/core/meshcop/dataset_local.cpp src/core/meshcop/energy_scan_client.cpp src/core/meshcop/panid_query_client.cpp src/core/meshcop/announce_begin_client.cpp src/core/meshcop/meshcop.hpp src/core/meshcop/commissioner.hpp src/core/meshcop/timestamp.cpp src/core/meshcop/dataset.hpp src/core/meshcop/timestamp.hpp src/core/meshcop/dataset_manager.hpp src/core/meshcop/border_agent.hpp src/core/meshcop/dtls.hpp src/core/meshcop/dataset_local.hpp src/core/meshcop/meshcop_leader.hpp src/core/meshcop/joiner_router.hpp src/core/meshcop/joiner.hpp src/core/mac/mac.cpp src/core/mac/mac_frame.cpp src/core/mac/sub_mac.cpp src/core/mac/data_poll_sender.cpp src/core/mac/data_poll_handler.cpp src/core/mac/mac_frame.hpp src/core/mac/mac_filter.cpp src/core/mac/link_raw.cpp src/core/mac/mac_types.cpp src/core/mac/mac_types.hpp src/core/mac/channel_mask.cpp src/core/mac/mac.hpp src/core/mac/sub_mac_callbacks.cpp src/core/mac/channel_mask.hpp src/core/mac/sub_mac.hpp src/core/mac/data_poll_handler.hpp src/core/mac/link_raw.hpp src/core/mac/mac_filter.hpp src/core/net/ip6.cpp src/core/net/dhcp6_client.cpp src/core/net/ip6_address.cpp src/core/net/dns_client.cpp src/core/net/dhcp6_server.cpp src/core/net/udp6.cpp src/core/net/netif.cpp src/core/net/sntp_client.cpp src/core/net/ip6_mpl.cpp src/core/net/icmp6.cpp src/core/net/ip6_filter.cpp src/core/net/ip6_headers.hpp src/core/net/dhcp6.hpp src/core/net/netif.hpp src/core/net/checksum.cpp src/core/net/ip6_address.hpp src/core/net/dns_headers.hpp src/core/net/udp6.hpp src/core/net/socket.hpp src/core/net/ip6_mpl.hpp src/core/net/icmp6.hpp src/core/net/sntp_client.hpp src/core/net/ip6_headers.cpp src/core/net/dhcp6_server.hpp src/core/net/ip6.hpp src/core/net/checksum.hpp src/core/net/tcp.hpp src/core/net/dns_client.hpp src/core/net/ip6_filter.hpp src/core/common/message.cpp src/core/common/settings.cpp src/core/common/instance.hpp src/core/common/tlvs.cpp src/core/common/timer.cpp src/core/common/trickle_timer.cpp src/core/common/settings.hpp src/core/common/linked_list.hpp src/core/common/message.hpp src/core/common/encoding.hpp src/core/common/logging.cpp src/core/common/instance.cpp src/core/common/notifier.cpp src/core/common/random_manager.cpp src/core/common/timer.hpp src/core/common/string.hpp src/core/common/time_ticker.cpp src/core/common/tasklet.cpp src/core/common/random.hpp src/core/common/time.hpp src/core/common/notifier.hpp src/core/common/pool.hpp src/core/common/locator.hpp src/core/common/string.cpp src/core/common/bit_vector.hpp src/core/common/tlvs.hpp src/core/common/crc16.cpp src/core/common/tasklet.hpp src/core/common/random_manager.hpp src/core/common/locator-getters.hpp src/core/common/equatable.hpp src/core/common/new.hpp src/core/common/time_ticker.hpp src/core/common/crc16.hpp src/core/common/code_utils.hpp src/core/common/non_copyable.hpp src/core/common/trickle_timer.hpp src/core/common/clearable.hpp src/core/api/thread_api.cpp src/core/api/link_api.cpp src/core/api/thread_ftd_api.cpp src/core/api/link_raw_api.cpp src/core/api/ip6_api.cpp src/core/api/coap_api.cpp src/core/api/message_api.cpp src/core/api/commissioner_api.cpp src/core/api/backbone_router_ftd_api.cpp src/core/api/coap_secure_api.cpp src/core/api/dataset_api.cpp src/core/api/udp_api.cpp src/core/api/border_router_api.cpp src/core/api/netdata_api.cpp src/core/api/channel_manager_api.cpp src/core/api/jam_detection_api.cpp src/core/api/instance_api.cpp src/core/api/network_time_api.cpp src/core/api/server_api.cpp src/core/api/joiner_api.cpp src/core/api/channel_monitor_api.cpp src/core/api/crypto_api.cpp src/core/api/random_noncrypto_api.cpp src/core/api/tasklet_api.cpp src/core/api/netdiag_api.cpp src/core/api/icmp6_api.cpp src/core/api/child_supervision_api.cpp src/core/api/heap_api.cpp src/core/api/dataset_ftd_api.cpp src/core/api/diags_api.cpp src/core/api/logging_api.cpp src/core/api/sntp_api.cpp src/core/api/link_metrics_api.cpp src/core/api/random_crypto_api.cpp src/core/api/backbone_router_api.cpp src/core/api/dns_api.cpp src/core/api/entropy_api.cpp src/core/utils/channel_manager.cpp src/core/utils/slaac_address.cpp src/core/utils/flash.cpp src/core/utils/jam_detector.cpp src/core/utils/heap.cpp src/core/utils/child_supervision.cpp src/core/utils/channel_monitor.cpp src/core/utils/otns.cpp src/core/utils/heap.hpp src/core/utils/flash.hpp src/core/utils/parse_cmdline.cpp src/core/utils/child_supervision.hpp src/core/utils/channel_manager.hpp src/core/utils/jam_detector.hpp src/core/utils/otns.hpp src/core/utils/channel_monitor.hpp src/core/utils/slaac_address.hpp src/core/coap/coap.cpp src/core/coap/coap_message.cpp src/core/coap/coap_secure.cpp src/core/coap/coap_message.hpp src/core/coap/coap_secure.hpp src/core/coap/coap.hpp src/core/backbone_router/bbr_local.cpp src/core/backbone_router/bbr_manager.cpp src/core/backbone_router/bbr_leader.cpp src/core/backbone_router/multicast_listeners_table.cpp src/core/backbone_router/ndproxy_table.cpp src/core/backbone_router/ndproxy_table.hpp src/core/backbone_router/multicast_listeners_table.hpp src/core/backbone_router/backbone_tmf.cpp src/core/backbone_router/bbr_local.hpp src/core/backbone_router/bbr_leader.hpp src/core/backbone_router/bbr_manager.hpp src/core/backbone_router/backbone_tmf.hpp src/core/diags/factory_diags.cpp src/core/diags/factory_diags.hpp src/core/crypto/aes_ccm.cpp src/core/crypto/pbkdf2_cmac.cpp src/core/crypto/mbedtls.cpp src/core/crypto/ecdsa.cpp src/core/crypto/hmac_sha256.cpp src/core/crypto/sha256.cpp src/core/crypto/aes_ecb.cpp src/core/crypto/aes_ccm.hpp src/core/radio/radio_platform.cpp src/core/radio/radio.hpp src/core/radio/radio_callbacks.cpp src/core/radio/radio.cpp src/cli/cli.cpp src/cli/cli_dataset.cpp src/cli/cli_coap.cpp src/cli/cli_coap_secure.cpp src/cli/cli_commissioner.cpp src/cli/cli_udp.cpp src/cli/cli_network_data.cpp src/cli/cli_uart.cpp src/cli/cli_joiner.cpp src/cli/cli_console.cpp src/cli/cli.hpp src/cli/cli_coap.hpp src/cli/cli_dataset.hpp src/cli/cli_joiner.hpp src/cli/cli_commissioner.hpp src/ncp/ncp_base_mtd.cpp src/ncp/ncp_base.cpp src/ncp/ncp_base_ftd.cpp src/ncp/ncp_base_radio.cpp src/ncp/ncp_uart.cpp src/ncp/changed_props_set.cpp src/ncp/ncp_base_dispatcher.cpp src/ncp/changed_props_set.hpp src/ncp/ncp_base.hpp src/lib/spinel/radio_spinel_impl.hpp src/lib/spinel/spinel.c src/lib/spinel/spinel_buffer.cpp src/lib/spinel/spinel_decoder.cpp src/lib/spinel/spinel_encoder.cpp src/lib/spinel/spinel_encoder.hpp src/lib/spinel/spinel_decoder.hpp src/lib/spinel/radio_spinel.hpp src/lib/spinel/spinel_buffer.hpp src/lib/hdlc/hdlc.cpp src/lib/hdlc/hdlc.hpp src/lib/url/url.cpp src/lib/url/url.hpp src/lib/platform/exit_code.c src/posix/platform/netif.cpp src/posix/platform/hdlc_interface.cpp src/posix/platform/settings.cpp src/posix/platform/udp.cpp src/posix/platform/radio.cpp src/posix/platform/uart.cpp src/posix/platform/system.cpp src/posix/platform/virtual_time.cpp src/posix/platform/alarm.cpp src/posix/platform/misc.cpp src/posix/platform/logging.cpp src/posix/platform/entropy.cpp src/posix/platform/max_power_table.hpp src/posix/platform/backbone.cpp src/posix/platform/radio_url.cpp src/posix/platform/hdlc_interface.hpp src/posix/main.c src/posix/client.cpp src/posix/console_cli.cpp tests/unit/test_lowpan.cpp tests/unit/test_spinel_buffer.cpp tests/unit/test_hdlc.cpp tests/unit/test_spinel_decoder.cpp tests/unit/test_timer.cpp tests/unit/test_mac_frame.cpp tests/unit/test_platform.cpp tests/unit/test_link_quality.cpp tests/unit/test_spinel_encoder.cpp tests/unit/test_priority_queue.cpp tests/unit/test_child_table.cpp tests/unit/test_child.cpp tests/unit/test_message_queue.cpp tests/unit/test_linked_list.cpp tests/unit/test_ip6_address.cpp tests/unit/test_netif.cpp tests/unit/test_checksum.cpp tests/unit/test_string.cpp tests/unit/test_multicast_listeners_table.cpp tests/unit/test_flash.cpp tests/unit/test_heap.cpp tests/unit/test_message.cpp tests/unit/test_steering_data.cpp tests/unit/test_aes.cpp tests/unit/test_toolchain.cpp tests/unit/test_network_data.cpp tests/unit/test_pool.cpp tests/unit/test_lowpan.hpp tests/unit/test_ndproxy_table.cpp tests/unit/test_pskc.cpp tests/unit/test_util.cpp tests/unit/test_hmac_sha256.cpp tests/unit/test_toolchain_c.c examples/platforms/simulation/radio.c examples/platforms/simulation/virtual_time/platform-sim.c examples/platforms/simulation/virtual_time/alarm-sim.c examples/platforms/simulation/uart.c examples/platforms/simulation/alarm.c examples/platforms/simulation/system.c examples/platforms/simulation/flash.c examples/platforms/simulation/misc.c examples/platforms/simulation/diag.c examples/platforms/simulation/entropy.c examples/platforms/utils/soft_source_match_table.c examples/platforms/utils/mac_frame.cpp examples/platforms/utils/logging_rtt.c examples/platforms/utils/debug_uart.c examples/platforms/utils/otns_utils.cpp examples/apps/cli/main.c examples/apps/ncp/main.c tools/spi-hdlc-adapter/spi-hdlc-adapter.c include/openthread/coap.h

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -153,6 +153,12 @@
Loading
153 153
     *
154 154
     */
155 155
    void Restore(void);
156 +
157 +
    /**
158 +
     * This method notifies duplicated Domain Unicast Address.
159 +
     *
160 +
     */
161 +
    void NotifyDuplicateDomainUnicastAddress(void);
156 162
#endif
157 163
158 164
#if OPENTHREAD_CONFIG_TMF_PROXY_DUA_ENABLE

@@ -258,7 +258,18 @@
Loading
258 258
        UpdateTimeTickerRegistration();
259 259
    }
260 260
}
261 -
#endif
261 +
262 +
void DuaManager::NotifyDuplicateDomainUnicastAddress(void)
263 +
{
264 +
    RemoveDomainUnicastAddress();
265 +
    mDadCounter++;
266 +
267 +
    if (GenerateDomainUnicastAddressIid() == OT_ERROR_NONE)
268 +
    {
269 +
        AddDomainUnicastAddress();
270 +
    }
271 +
}
272 +
#endif // OPENTHREAD_CONFIG_DUA_ENABLE
262 273
263 274
void DuaManager::UpdateReregistrationDelay(void)
264 275
{
@@ -584,14 +595,7 @@
Loading
584 595
            RemoveDomainUnicastAddress();
585 596
            break;
586 597
        case ThreadStatusTlv::kDuaDuplicate:
587 -
            RemoveDomainUnicastAddress();
588 -
            mDadCounter++;
589 -
590 -
            if (GenerateDomainUnicastAddressIid() == OT_ERROR_NONE)
591 -
            {
592 -
                AddDomainUnicastAddress();
593 -
            }
594 -
598 +
            NotifyDuplicateDomainUnicastAddress();
595 599
            break;
596 600
        case ThreadStatusTlv::kDuaNoResources:
597 601
        case ThreadStatusTlv::kDuaNotPrimary:

@@ -704,7 +704,16 @@
Loading
704 704
        if (address->GetAddress() == target && Get<Mle::MleRouter>().GetMeshLocal64().GetIid() != meshLocalIid)
705 705
        {
706 706
            // Target EID matches address and Mesh Local EID differs
707 -
            Get<ThreadNetif>().RemoveUnicastAddress(*address);
707 +
#if OPENTHREAD_CONFIG_DUA_ENABLE
708 +
            if (Get<BackboneRouter::Leader>().IsDomainUnicast(address->GetAddress()))
709 +
            {
710 +
                Get<DuaManager>().NotifyDuplicateDomainUnicastAddress();
711 +
            }
712 +
            else
713 +
#endif
714 +
            {
715 +
                Get<ThreadNetif>().RemoveUnicastAddress(*address);
716 +
            }
708 717
            ExitNow();
709 718
        }
710 719
    }

Learn more Showing 17 files with coverage changes found.

Changes in src/core/mac/data_poll_handler.cpp
-4
+4
Loading file...
Changes in src/posix/main.c
-3
+3
Loading file...
Changes in src/posix/platform/alarm.cpp
-1
+1
Loading file...
Changes in src/core/thread/router_table.cpp
-2
+2
Loading file...
Changes in src/core/thread/mesh_forwarder.cpp
-4
+4
Loading file...
Changes in src/core/net/ip6.cpp
-3
+3
Loading file...
Changes in src/core/mac/mac.cpp
-3
+3
Loading file...
Changes in src/lib/spinel/radio_spinel_impl.hpp
-1
+1
Loading file...
Changes in src/core/thread/mle_router.cpp
-2
+2
Loading file...
Changes in src/core/thread/mle.cpp
-1
+1
Loading file...
Changes in src/core/thread/address_resolver.cpp
-1
+1
Loading file...
Changes in src/core/thread/mesh_forwarder_ftd.cpp
-1
+1
Loading file...
Changes in src/cli/cli.cpp
-11
+11
Loading file...
Changes in src/posix/platform/hdlc_interface.cpp
-2
+2
Loading file...
Changes in src/core/thread/time_sync_service.cpp
-1
+1
Loading file...
Changes in src/core/api/thread_ftd_api.cpp
-5
+5
Loading file...
Changes in src/lib/platform/exit_code.c
-3
+3
Loading file...
Files Coverage
examples 80.82%
src 0.01% 85.74%
tests/unit 90.22%
include/openthread/coap.h 100.00%
tools/spi-hdlc-adapter/spi-hdlc-adapter.c 0.00%
Project Totals (371 files) 84.78%
Loading