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

Stop advertising IPv4 addresses when IPv4 and IPv6 ports do not match. #38057

Merged

Conversation

bzbarsky-apple
Copy link
Contributor

Our advertising backends only support advertising one port. In cases when the IPv4 and IPv6 ports do not match, advertising the IPv6 port along with IPv4 addresses does not make sense: that port does not correspond to the Matter stack on those addresses.

The fix is to only allow advertising IPv4 addresses when the port we are using for IPv6 matches the port we are using for IPv4.

Testing

Manually tested that starting chip-all-clusters-app normally advertises both IPv4 and IPv6 addresses, as does starting it with a fixed nonzero port, but starting it with --secured-device-port 0 only advertises the IPv6 addresses.

Our advertising backends only support advertising one port.  In cases when the
IPv4 and IPv6 ports do not match, advertising the IPv6 port along with IPv4
addresses does not make sense: that port does not correspond to the Matter stack
on those addresses.

The fix is to only allow advertising IPv4 addresses when the port we are using
for IPv6 matches the port we are using for IPv4.
Copy link

github-actions bot commented Mar 18, 2025

PR #38057: Size comparison from 22a979c to f595119

Full report (75 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 22a979c f595119 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1098418 1098468 50 0.0
RAM 94866 94866 0 0.0
bl702 lighting-app bl702+eth FLASH 653332 653398 66 0.0
RAM 33533 33533 0 0.0
bl702+wifi FLASH 830604 830654 50 0.0
RAM 22257 22257 0 0.0
bl706+mfd+rpc+littlefs FLASH 1063136 1063158 22 0.0
RAM 32181 32181 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 893918 893942 24 0.0
RAM 26920 26920 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 976814 976836 22 0.0
RAM 24668 24668 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 818580 818604 24 0.0
RAM 120296 120296 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 827492 827516 24 0.0
RAM 125392 125392 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 774344 774360 16 0.0
RAM 113764 113764 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 758628 758644 16 0.0
RAM 113972 113972 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 541934 541966 32 0.0
RAM 205152 205152 0 0.0
lock CC3235SF_LAUNCHXL FLASH 576034 576066 32 0.0
RAM 205400 205400 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 660157 660173 16 0.0
RAM 75436 75436 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 680017 680033 16 0.0
RAM 78076 78076 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 680017 680033 16 0.0
RAM 78076 78076 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 636941 636957 16 0.0
RAM 70504 70504 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 620397 620413 16 0.0
RAM 71676 71676 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 640041 640057 16 0.0
RAM 74220 74220 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 640041 640057 16 0.0
RAM 74220 74220 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 639893 639909 16 0.0
RAM 74684 74684 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 659609 659625 16 0.0
RAM 77228 77228 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 659609 659625 16 0.0
RAM 77228 77228 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 616233 616249 16 0.0
RAM 68772 68772 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 636093 636109 16 0.0
RAM 71412 71412 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 636093 636109 16 0.0
RAM 71412 71412 0 0.0
efr32 lock-app BRD4187C FLASH 941088 941120 32 0.0
RAM 159944 159944 0 0.0
BRD4338a FLASH 734504 734504 0 0.0
RAM 234844 234844 0 0.0
window-app BRD4187C FLASH 1033496 1033520 24 0.0
RAM 128048 128048 0 0.0
esp32 all-clusters-app c3devkit DRAM 103376 103384 8 0.0
FLASH 1785236 1785310 74 0.0
IRAM 83846 83846 0 0.0
m5stack DRAM 121964 121972 8 0.0
FLASH 1751754 1751830 76 0.0
IRAM 117043 117043 0 0.0
linux air-purifier-app debug unknown 4752 4752 0 0.0
FLASH 2659329 2659565 236 0.0
RAM 112304 112304 0 0.0
all-clusters-app debug unknown 5584 5584 0 0.0
FLASH 6124422 6124658 236 0.0
RAM 517552 517552 0 0.0
all-clusters-minimal-app debug unknown 5456 5456 0 0.0
FLASH 5317372 5317608 236 0.0
RAM 222680 222680 0 0.0
bridge-app debug unknown 5472 5472 0 0.0
FLASH 4631156 4631392 236 0.0
RAM 201000 201000 0 0.0
camera-app debug unknown 5456 5456 0 0.0
FLASH 4693690 4693926 236 0.0
RAM 196448 196448 0 0.0
camera-controller debug unknown 5776 5776 0 0.0
FLASH 11345651 11345883 232 0.0
RAM 597312 597312 0 0.0
chip-tool debug unknown 6112 6112 0 0.0
FLASH 13365709 13365941 232 0.0
RAM 605952 605952 0 0.0
chip-tool-ipv6only arm64 unknown 22120 22120 0 0.0
FLASH 11551528 11551624 96 0.0
RAM 658632 658632 0 0.0
fabric-admin debug unknown 5800 5800 0 0.0
FLASH 11636901 11637133 232 0.0
RAM 605736 605736 0 0.0
fabric-bridge-app debug unknown 4720 4720 0 0.0
FLASH 4462112 4462344 232 0.0
RAM 188200 188200 0 0.0
fabric-sync debug unknown 4976 4976 0 0.0
FLASH 5579237 5579525 288 0.0
RAM 471968 471968 0 0.0
lighting-app debug+rpc+ui unknown 6192 6192 0 0.0
FLASH 5525761 5526001 240 0.0
RAM 205200 205200 0 0.0
lock-app debug unknown 5424 5424 0 0.0
FLASH 4697900 4698136 236 0.0
RAM 192360 192360 0 0.0
ota-provider-app debug unknown 4760 4760 0 0.0
FLASH 4320110 4320342 232 0.0
RAM 181016 181016 0 0.0
ota-requestor-app debug unknown 4712 4712 0 0.0
FLASH 4450466 4450698 232 0.0
RAM 185504 185504 0 0.0
shell debug unknown 4240 4240 0 0.0
FLASH 2957900 2958124 224 0.0
RAM 145680 145680 0 0.0
thermostat-no-ble arm64 unknown 9456 9456 0 0.0
FLASH 4146936 4147160 224 0.0
RAM 229848 229848 0 0.0
tv-app debug unknown 5752 5752 0 0.0
FLASH 5918085 5918373 288 0.0
RAM 595400 595400 0 0.0
tv-casting-app debug unknown 5320 5320 0 0.0
FLASH 11538413 11538653 240 0.0
RAM 721744 721744 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 916432 916448 16 0.0
RAM 167463 167463 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 909208 909208 0 0.0
RAM 145707 145707 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 852912 852928 16 0.0
RAM 141243 141243 0 0.0
nxp contact k32w0+release FLASH 588592 588608 16 0.0
RAM 71004 71004 0 0.0
mcxw71+release FLASH 603800 603824 24 0.0
RAM 63144 63144 0 0.0
light k32w0+release FLASH 614388 614404 16 0.0
RAM 70292 70292 0 0.0
k32w1+release FLASH 687992 688008 16 0.0
RAM 72056 72056 0 0.0
lock mcxw71+release FLASH 752760 752776 16 0.0
RAM 67556 67556 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1661852 1661900 48 0.0
RAM 212352 212352 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1565812 1565876 64 0.0
RAM 208560 208560 0 0.0
light cy8ckit_062s2_43012 FLASH 1442548 1442596 48 0.0
RAM 197320 197320 0 0.0
lock cy8ckit_062s2_43012 FLASH 1471444 1471492 48 0.0
RAM 224984 224984 0 0.0
qpg lighting-app qpg6105+debug FLASH 665180 665196 16 0.0
RAM 105180 105180 0 0.0
lock-app qpg6105+debug FLASH 623632 623648 16 0.0
RAM 99792 99792 0 0.0
stm32 light STM32WB5MM-DK FLASH 461144 461160 16 0.0
RAM 141496 141496 0 0.0
telink bridge-app tl7218x FLASH 665938 665952 14 0.0
RAM 90712 90712 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 623516 623530 14 0.0
RAM 31488 31488 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 762296 762310 14 0.0
RAM 40420 40420 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 755404 755418 14 0.0
RAM 97540 97540 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 682454 682468 14 0.0
RAM 52192 52192 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 711012 711026 14 0.0
RAM 73400 73400 0 0.0
light-switch-app-ota-shell-factory-data tl3218x_retention FLASH 703562 703576 14 0.0
RAM 37664 37664 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 603054 603054 0 0.0
RAM 138640 138640 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 790470 790484 14 0.0
RAM 96388 96388 0 0.0
tizen all-clusters-app arm unknown 5152 5152 0 0.0
FLASH 1783584 1783876 292 0.0
RAM 94320 94320 0 0.0
chip-tool-ubsan arm unknown 11560 11560 0 0.0
FLASH 19092918 19094038 1120 0.0
RAM 8355044 8355536 492 0.0

@mergify mergify bot merged commit 4593aef into project-chip:master Mar 19, 2025
71 checks passed
@bzbarsky-apple bzbarsky-apple deleted the dont-advertise-bogus-ipv4-port branch March 19, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants