Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LWIP IPv6 zone index in chip::Inet::IPAddress #36387

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

db-shelly
Copy link

If using LWIP without any patches and with LWIP_IPV6_SCOPES=1, outbound connections cannot be routed to the correct interface, because zone index is missing in chip::Inet::IPAddress.

This is a simple fix to keep the ip6_addr_t zone in IPAddress if needed.

Copy link

Review changes with  SemanticDiff

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions bot added the inet label Nov 6, 2024
src/inet/IPAddress.h Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Nov 6, 2024

PR #36387: Size comparison from da2b767 to f86577f

Increases above 0.2%:

platform target config section da2b767 f86577f change % change
bl602 lighting-app bl602+mfd+littlefs+rpc RAM 104080 104480 400 0.4
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 RAM 123628 123980 352 0.3
lock-ftd LP_EM_CC1354P10_6 RAM 125516 125868 352 0.3
pump-app LP_EM_CC1354P10_6 RAM 113984 114336 352 0.3
pump-controller-app LP_EM_CC1354P10_6 RAM 114192 114544 352 0.3
cc32xx air-purifier CC3235SF_LAUNCHXL RAM 205780 206548 768 0.4
lock CC3235SF_LAUNCHXL RAM 205932 206700 768 0.4
psoc6 all-clusters cy8ckit_062s2_43012 RAM 212056 212824 768 0.4
all-clusters-minimal cy8ckit_062s2_43012 RAM 208856 209616 760 0.4
light cy8ckit_062s2_43012 RAM 200840 201600 760 0.4
lock cy8ckit_062s2_43012 RAM 225200 225960 760 0.3
Full report (66 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section da2b767 f86577f change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1351454 1351580 126 0.0
RAM 104080 104480 400 0.4
bl702 lighting-app bl702+eth FLASH 649058 649152 94 0.0
RAM 25321 25321 0 0.0
bl702+wifi FLASH 826638 826736 98 0.0
RAM 14053 14053 0 0.0
bl706+mfd+rpc+littlefs FLASH 1056298 1056298 0 0.0
RAM 23901 23901 0 0.0
bl702l lighting-app bl702l+mfd+littlefs FLASH 976464 976464 0 0.0
RAM 16556 16556 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 837924 838604 680 0.1
RAM 123628 123980 352 0.3
lock-ftd LP_EM_CC1354P10_6 FLASH 823696 824400 704 0.1
RAM 125516 125868 352 0.3
pump-app LP_EM_CC1354P10_6 FLASH 770436 771148 712 0.1
RAM 113984 114336 352 0.3
pump-controller-app LP_EM_CC1354P10_6 FLASH 754640 755344 704 0.1
RAM 114192 114544 352 0.3
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 627382 627962 580 0.1
RAM 205780 206548 768 0.4
lock CC3235SF_LAUNCHXL FLASH 667126 667702 576 0.1
RAM 205932 206700 768 0.4
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 679585 679585 0 0.0
RAM 78684 78684 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 699437 699437 0 0.0
RAM 81324 81324 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 699437 699437 0 0.0
RAM 81324 81324 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 656373 656373 0 0.0
RAM 73752 73752 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 616289 616289 0 0.0
RAM 71644 71644 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 635917 635917 0 0.0
RAM 74188 74188 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 635917 635917 0 0.0
RAM 74188 74188 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 635753 635753 0 0.0
RAM 74692 74692 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 655469 655469 0 0.0
RAM 77236 77236 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 655469 655469 0 0.0
RAM 77236 77236 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 611157 611157 0 0.0
RAM 68772 68772 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 631009 631009 0 0.0
RAM 71412 71412 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 631009 631009 0 0.0
RAM 71412 71412 0 0.0
efr32 lock-app BRD4187C FLASH 928556 928556 0 0.0
RAM 160164 160164 0 0.0
BRD4338a FLASH 743448 744008 560 0.1
RAM 233288 233752 464 0.2
window-app BRD4187C FLASH 1018584 1018584 0 0.0
RAM 128260 128260 0 0.0
linux air-purifier-app debug unknown 4688 4688 0 0.0
FLASH 2698549 2698549 0 0.0
RAM 129616 129616 0 0.0
all-clusters-app debug unknown 5528 5528 0 0.0
FLASH 5990696 5990696 0 0.0
RAM 523872 523872 0 0.0
all-clusters-minimal-app debug unknown 5424 5424 0 0.0
FLASH 5328004 5328004 0 0.0
RAM 242448 242448 0 0.0
bridge-app debug unknown 5408 5408 0 0.0
FLASH 4670416 4670416 0 0.0
RAM 218384 218384 0 0.0
chip-tool debug unknown 5960 5960 0 0.0
FLASH 12871656 12871656 0 0.0
RAM 584466 584466 0 0.0
chip-tool-ipv6only arm64 unknown 21400 21400 0 0.0
FLASH 11001840 11001840 0 0.0
RAM 635368 635368 0 0.0
fabric-admin debug unknown 5792 5792 0 0.0
FLASH 11278901 11278901 0 0.0
RAM 584922 584922 0 0.0
fabric-bridge-app debug unknown 4632 4632 0 0.0
FLASH 4497280 4497280 0 0.0
RAM 205368 205368 0 0.0
fabric-sync debug unknown 4856 4856 0 0.0
FLASH 5303941 5303941 0 0.0
RAM 466864 466864 0 0.0
lighting-app debug+rpc+ui unknown 6056 6056 0 0.0
FLASH 5609185 5609185 0 0.0
RAM 228520 228520 0 0.0
lock-app debug unknown 5344 5344 0 0.0
FLASH 4719890 4719890 0 0.0
RAM 204520 204520 0 0.0
ota-provider-app debug unknown 4720 4720 0 0.0
FLASH 4345322 4345322 0 0.0
RAM 198240 198240 0 0.0
ota-requestor-app debug unknown 4656 4656 0 0.0
FLASH 4483724 4483724 0 0.0
RAM 202808 202808 0 0.0
shell debug unknown 4216 4216 0 0.0
FLASH 3013773 3013773 0 0.0
RAM 160336 160336 0 0.0
thermostat-no-ble arm64 unknown 9440 9440 0 0.0
FLASH 4089072 4089072 0 0.0
RAM 242904 242904 0 0.0
tv-app debug unknown 5624 5624 0 0.0
FLASH 5942037 5942037 0 0.0
RAM 596304 596304 0 0.0
tv-casting-app debug unknown 5208 5208 0 0.0
FLASH 11078813 11078813 0 0.0
RAM 694536 694536 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 915000 915000 0 0.0
RAM 143281 143281 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 887560 887560 0 0.0
RAM 141468 141468 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 849064 849064 0 0.0
RAM 142189 142189 0 0.0
nxp contact k32w0+release FLASH 584112 584112 0 0.0
RAM 71044 71044 0 0.0
mcxw71+release FLASH 598656 598656 0 0.0
RAM 63144 63144 0 0.0
light k32w0+release FLASH 611156 611156 0 0.0
RAM 70436 70436 0 0.0
k32w1+release FLASH 684952 684952 0 0.0
RAM 48776 48776 0 0.0
lock mcxw71+release FLASH 748488 748488 0 0.0
RAM 67300 67300 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1642828 1643420 592 0.0
RAM 212056 212824 768 0.4
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1550356 1550964 608 0.0
RAM 208856 209616 760 0.4
light cy8ckit_062s2_43012 FLASH 1466956 1467564 608 0.0
RAM 200840 201600 760 0.4
lock cy8ckit_062s2_43012 FLASH 1464684 1465276 592 0.0
RAM 225200 225960 760 0.3
qpg lighting-app qpg6105+debug FLASH 662240 662240 0 0.0
RAM 105380 105380 0 0.0
lock-app qpg6105+debug FLASH 620196 620196 0 0.0
RAM 99832 99832 0 0.0
stm32 light STM32WB5MM-DK FLASH 483056 483056 0 0.0
RAM 144844 144844 0 0.0
telink bridge-app tlsr9258a FLASH 684318 684318 0 0.0
RAM 91528 91528 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 622362 622362 0 0.0
RAM 50464 50464 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 710292 710292 0 0.0
RAM 73804 73804 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 628478 628478 0 0.0
RAM 145384 145384 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 814302 814302 0 0.0
RAM 100004 100004 0 0.0
tizen all-clusters-app arm unknown 4932 4932 0 0.0
FLASH 1721588 1721588 0 0.0
RAM 90608 90608 0 0.0
chip-tool-ubsan arm unknown 10820 10820 0 0.0
FLASH 18006430 18006430 0 0.0
RAM 7857244 7857244 0 0.0

@andy31415
Copy link
Contributor

@db-shelly please sign the CLA

@andy31415
Copy link
Contributor

It seems that we cannot set an assigment, we should modify all constructors instead....

INFO    ../../examples/light-switch-app/asr/third_party/connectedhomeip/src/inet/IPAddress.h:714:43: error: static assertion failed: IPAddress is not trivial
INFO      714 | static_assert(std::is_trivial<IPAddress>::value, "IPAddress is not trivial");

Copy link

github-actions bot commented Nov 7, 2024

PR #36387: Size comparison from da2b767 to 55e5740

Increases above 0.2%:

platform target config section da2b767 55e5740 change % change
linux fabric-bridge-app debug unknown 4632 4664 32 0.7
lighting-app debug+rpc+ui unknown 6056 6072 16 0.3
Full report (30 builds for linux, nrfconnect, qpg, stm32, telink, tizen)
platform target config section da2b767 55e5740 change % change
linux air-purifier-app debug unknown 4688 4688 0 0.0
FLASH 2698549 2698549 0 0.0
RAM 129616 129616 0 0.0
all-clusters-app debug unknown 5528 5528 0 0.0
FLASH 5990696 5990696 0 0.0
RAM 523872 523872 0 0.0
all-clusters-minimal-app debug unknown 5424 5424 0 0.0
FLASH 5328004 5328004 0 0.0
RAM 242448 242448 0 0.0
bridge-app debug unknown 5408 5408 0 0.0
FLASH 4670416 4670416 0 0.0
RAM 218384 218384 0 0.0
chip-tool debug unknown 5960 5960 0 0.0
FLASH 12871656 12871656 0 0.0
RAM 584466 584466 0 0.0
chip-tool-ipv6only arm64 unknown 21400 21400 0 0.0
FLASH 11001840 11001840 0 0.0
RAM 635368 635368 0 0.0
fabric-admin debug unknown 5792 5784 -8 -0.1
FLASH 11278901 11276737 -2164 -0.0
RAM 584922 584890 -32 -0.0
fabric-bridge-app debug unknown 4632 4664 32 0.7
FLASH 4497280 4494682 -2598 -0.1
RAM 205368 205368 0 0.0
fabric-sync debug unknown 4856 4856 0 0.0
FLASH 5303941 5303941 0 0.0
RAM 466864 466864 0 0.0
lighting-app debug+rpc+ui unknown 6056 6072 16 0.3
FLASH 5609185 5607089 -2096 -0.0
RAM 228520 228520 0 0.0
lock-app debug unknown 5344 5344 0 0.0
FLASH 4719890 4719890 0 0.0
RAM 204520 204520 0 0.0
ota-provider-app debug unknown 4720 4720 0 0.0
FLASH 4345322 4345322 0 0.0
RAM 198240 198240 0 0.0
ota-requestor-app debug unknown 4656 4656 0 0.0
FLASH 4483724 4483724 0 0.0
RAM 202808 202808 0 0.0
shell debug unknown 4216 4216 0 0.0
FLASH 3013773 3013773 0 0.0
RAM 160336 160336 0 0.0
thermostat-no-ble arm64 unknown 9440 9440 0 0.0
FLASH 4089072 4089072 0 0.0
RAM 242904 242904 0 0.0
tv-app debug unknown 5624 5624 0 0.0
FLASH 5942037 5942037 0 0.0
RAM 596304 596304 0 0.0
tv-casting-app debug unknown 5208 5208 0 0.0
FLASH 11078813 11078813 0 0.0
RAM 694536 694536 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 915000 915000 0 0.0
RAM 143281 143281 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 887560 887560 0 0.0
RAM 141468 141468 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 849064 849064 0 0.0
RAM 142189 142189 0 0.0
qpg lighting-app qpg6105+debug FLASH 662240 662240 0 0.0
RAM 105380 105380 0 0.0
lock-app qpg6105+debug FLASH 620196 620196 0 0.0
RAM 99832 99832 0 0.0
stm32 light STM32WB5MM-DK FLASH 483056 483056 0 0.0
RAM 144844 144844 0 0.0
telink bridge-app tlsr9258a FLASH 684318 684318 0 0.0
RAM 91528 91528 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 622362 622362 0 0.0
RAM 50464 50464 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 710292 710292 0 0.0
RAM 73804 73804 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 628478 628478 0 0.0
RAM 145384 145384 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 814302 814204 -98 -0.0
RAM 100004 100004 0 0.0
tizen all-clusters-app arm unknown 4932 4932 0 0.0
FLASH 1721588 1721588 0 0.0
RAM 90608 90608 0 0.0
chip-tool-ubsan arm unknown 10820 10820 0 0.0
FLASH 18006430 18006430 0 0.0
RAM 7857244 7857244 0 0.0

@@ -201,6 +201,9 @@ class DLL_EXPORT IPAddress
* address in network byte order.
*/
uint32_t Addr[4];
#if CHIP_SYSTEM_CONFIG_USE_LWIP && LWIP_IPV6_SCOPES
uint8_t Zone = IP6_NO_ZONE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does LwIP use zones for non-link-local bits?

Because for link-local, PeerAddress is supposed to have an interface ID already, which is what the zone bits are, no? Is that not being handled correctly in our LwIP integration? Because if that's what's going on, the right fix is to fix it there, not to add things to IPAddress that are also duplicated-but-unused-it's-a-trap in PeerAddress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants