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

Inet implementations assume BYTE_ORDER is defined. make sure that it is #26460

Merged

Conversation

jmartinez-silabs
Copy link
Member

BYTE_ORDER was not defined in Silabs Thread apps. But the inet implementation assumes it is for some endianness conversion.

Recent changes to GCC highlighted this missing define as we were now using the big-endian implementation of hotnl on the Silabs platform due to #if BYTE_ORDER == BIG_ENDIAN evaluating to true when both of the defines didn't exist.
This, ultimately, led to IPAddress::IPAddress::MakeIPv6Multicast returning an invalid Multicast address.

Anyhow, this PR adds some checks on the existence of the BYTE_ORDER defined.

for CHIP_SYSTEM_CONFIG_USE_OPEN_THREAD_ENDPOINT inet implementation, Try at least to define BYTE_ORDER to the right endianness of the system if the definition doesn't exist already.

Note: Platforms using lwip usually define BYTE_ORDER, BIG_ENDIAN, LITTLE_ENDIAN in arch/cc.h

@github-actions
Copy link

github-actions bot commented May 9, 2023

PR #26460: Size comparison from 7b5ecb2 to 58d9277

Increases (1 build for cc32xx)
platform target config section 7b5ecb2 58d9277 change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 19674627 19674628 1 0.0
Full report (1 build for cc32xx)
platform target config section 7b5ecb2 58d9277 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 605002 605002 0 0.0
(read/write) 204164 204164 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197576 197576 0 0.0
.comment 206 206 0 0.0
.data 1468 1468 0 0.0
.debug_abbrev 957619 957619 0 0.0
.debug_aranges 101232 101232 0 0.0
.debug_frame 342080 342080 0 0.0
.debug_info 19674627 19674628 1 0.0
.debug_line 2671903 2671903 0 0.0
.debug_line_str 513 513 0 0.0
.debug_loc 33340 33340 0 0.0
.debug_loclists 1491139 1491139 0 0.0
.debug_ranges 4984 4984 0 0.0
.debug_rnglists 94412 94412 0 0.0
.debug_str 3131828 3131828 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 104314 104314 0 0.0
.shstrtab 265 265 0 0.0
.stack 2048 2048 0 0.0
.strtab 483089 483089 0 0.0
.symtab 287232 287232 0 0.0
.text 498564 498564 0 0.0

@github-actions
Copy link

PR #26460: Size comparison from 7b5ecb2 to 7d09a84

Full report (1 build for cc32xx)
platform target config section 7b5ecb2 7d09a84 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 605002 605002 0 0.0
(read/write) 204164 204164 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197576 197576 0 0.0
.comment 206 206 0 0.0
.data 1468 1468 0 0.0
.debug_abbrev 957619 957619 0 0.0
.debug_aranges 101232 101232 0 0.0
.debug_frame 342080 342080 0 0.0
.debug_info 19674627 19674627 0 0.0
.debug_line 2671903 2671903 0 0.0
.debug_line_str 513 513 0 0.0
.debug_loc 33340 33340 0 0.0
.debug_loclists 1491139 1491139 0 0.0
.debug_ranges 4984 4984 0 0.0
.debug_rnglists 94412 94412 0 0.0
.debug_str 3131828 3131828 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 104314 104314 0 0.0
.shstrtab 265 265 0 0.0
.stack 2048 2048 0 0.0
.strtab 483089 483089 0 0.0
.symtab 287232 287232 0 0.0
.text 498564 498564 0 0.0

src/inet/arpa-inet-compatibility.h Outdated Show resolved Hide resolved
src/inet/arpa-inet-compatibility.h Outdated Show resolved Hide resolved
src/inet/arpa-inet-compatibility.h Outdated Show resolved Hide resolved
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
@jmartinez-silabs jmartinez-silabs enabled auto-merge (squash) May 10, 2023 11:14
@github-actions
Copy link

PR #26460: Size comparison from 7b5ecb2 to 114800e

Increases (4 builds for cc13x2_26x2, k32w, nrfconnect, qpg)
platform target config section 7b5ecb2 114800e change % change
cc13x2_26x2 pump-app LP_CC2652R7 (read only) 692611 692619 8 0.0
.text 602368 602376 8 0.0
k32w lock k32w0+release (read only) 555820 555836 16 0.0
.text 555284 555300 16 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1176336 1176352 16 0.0
text 807272 807276 4 0.0
qpg lighting-app qpg6105+debug (read/write) 1169616 1169624 8 0.0
.text 616716 616724 8 0.0
Decreases (3 builds for bl602, cc13x2_26x2)
platform target config section 7b5ecb2 114800e change % change
bl602 lighting-app bl602 (read/write) 1354998 1354990 -8 -0.0
.text 1035978 1035976 -2 -0.0
bl602+rpc .text 1067334 1067330 -4 -0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 678967 678959 -8 -0.0
.text 591864 591856 -8 -0.0
Full report (23 builds for bl602, bl702, cc13x2_26x2, cc32xx, k32w, linux, mbed, nrfconnect, qpg)
platform target config section 7b5ecb2 114800e change % change
bl602 lighting-app bl602 (read/write) 1354998 1354990 -8 -0.0
.bss 87886 87886 0 0.0
.data 9648 9648 0 0.0
.text 1035978 1035976 -2 -0.0
bl602+rpc (read/write) 1401266 1401266 0 0.0
.bss 95934 95934 0 0.0
.data 10040 10040 0 0.0
.text 1067334 1067330 -4 -0.0
bl702 lighting-app bl702 0 0 0 0.0
(read only) 3358 3358 0 0.0
(read/write) 1185759 1185759 0 0.0
.bleromro 6342 6342 0 0.0
.bleromrw 124 124 0 0.0
.boot2 328 328 0 0.0
.bss 67585 67585 0 0.0
.bss_psram 24368 24368 0 0.0
.comment 48 48 0 0.0
.data 3952 3952 0 0.0
.debug_abbrev 1550204 1550204 0 0.0
.debug_aranges 132944 132944 0 0.0
.debug_frame 488804 488804 0 0.0
.debug_info 40943088 40943088 0 0.0
.debug_line 5301455 5301455 0 0.0
.debug_loc 3424613 3424613 0 0.0
.debug_ranges 372344 372344 0 0.0
.debug_str 3708223 3708223 0 0.0
.hbn 536 536 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 140 140 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 106304 106304 0 0.0
.rsvd 4 4 0 0.0
.sha_ocram 72 72 0 0.0
.shstrtab 304 304 0 0.0
.stack 2048 2048 0 0.0
.strtab 580786 580786 0 0.0
.symtab 175264 175264 0 0.0
.tcm_data 28 28 0 0.0
.tcmcode 3358 3358 0 0.0
.text 965470 965470 0 0.0
bl702+rpc 0 0 0 0.0
(read only) 3358 3358 0 0.0
(read/write) 1273555 1273555 0 0.0
.bleromro 6342 6342 0 0.0
.bleromrw 124 124 0 0.0
.boot2 328 328 0 0.0
.bss 75633 75633 0 0.0
.bss_psram 24768 24768 0 0.0
.comment 48 48 0 0.0
.data 4504 4504 0 0.0
.debug_abbrev 1706954 1706954 0 0.0
.debug_aranges 141224 141224 0 0.0
.debug_frame 516776 516776 0 0.0
.debug_info 45848902 45848902 0 0.0
.debug_line 5716360 5716360 0 0.0
.debug_loc 3626917 3626917 0 0.0
.debug_ranges 397648 397648 0 0.0
.debug_str 4133328 4133328 0 0.0
.hbn 536 536 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 156 156 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 120144 120144 0 0.0
.rsvd 4 4 0 0.0
.sha_ocram 72 72 0 0.0
.shstrtab 304 304 0 0.0
.stack 2048 2048 0 0.0
.strtab 641456 641456 0 0.0
.symtab 193600 193600 0 0.0
.tcm_data 28 28 0 0.0
.tcmcode 3358 3358 0 0.0
.text 1038096 1038096 0 0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 678967 678959 -8 -0.0
(read/write) 158620 158620 0 0.0
.bss 81192 81192 0 0.0
.data 3316 3316 0 0.0
.rodata 86783 86783 0 0.0
.text 591864 591856 -8 -0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 644847 644847 0 0.0
(read/write) 157860 157860 0 0.0
.bss 80432 80432 0 0.0
.data 3316 3316 0 0.0
.rodata 76767 76767 0 0.0
.text 567760 567760 0 0.0
lock-ftd LP_CC2652R7 (read only) 680023 680023 0 0.0
(read/write) 156136 156136 0 0.0
.bss 78744 78744 0 0.0
.data 3280 3280 0 0.0
.rodata 75639 75639 0 0.0
.text 603896 603896 0 0.0
lock-mtd LP_CC2652R7 (read only) 667411 667411 0 0.0
(read/write) 151312 151312 0 0.0
.bss 73920 73920 0 0.0
.data 3280 3280 0 0.0
.rodata 102459 102459 0 0.0
.text 564464 564464 0 0.0
pump-app LP_CC2652R7 (read only) 692611 692619 8 0.0
(read/write) 156588 156588 0 0.0
.bss 78720 78720 0 0.0
.data 3244 3244 0 0.0
.rodata 89755 89755 0 0.0
.text 602368 602376 8 0.0
pump-controller-app LP_CC2652R7 (read only) 678107 678107 0 0.0
(read/write) 157004 157004 0 0.0
.bss 78856 78856 0 0.0
.data 3268 3268 0 0.0
.rodata 85531 85531 0 0.0
.text 592088 592088 0 0.0
shell LP_CC2652R7 (read only) 672166 672166 0 0.0
(read/write) 160692 160692 0 0.0
.bss 83280 83280 0 0.0
.data 3300 3300 0 0.0
.rodata 85078 85078 0 0.0
.text 586764 586764 0 0.0
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 605002 605002 0 0.0
(read/write) 204164 204164 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197576 197576 0 0.0
.comment 206 206 0 0.0
.data 1468 1468 0 0.0
.debug_abbrev 957619 957619 0 0.0
.debug_aranges 101232 101232 0 0.0
.debug_frame 342080 342080 0 0.0
.debug_info 19674627 19674627 0 0.0
.debug_line 2671903 2671903 0 0.0
.debug_line_str 513 513 0 0.0
.debug_loc 33340 33340 0 0.0
.debug_loclists 1491139 1491139 0 0.0
.debug_ranges 4984 4984 0 0.0
.debug_rnglists 94412 94412 0 0.0
.debug_str 3131828 3131828 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 104314 104314 0 0.0
.shstrtab 265 265 0 0.0
.stack 2048 2048 0 0.0
.strtab 483089 483089 0 0.0
.symtab 287232 287232 0 0.0
.text 498564 498564 0 0.0
k32w contact k32w0+release (read only) 583444 583444 0 0.0
(read/write) 82704 82704 0 0.0
.bss 65888 65888 0 0.0
.data 2192 2192 0 0.0
.text 582908 582908 0 0.0
light k32w0+release (read only) 582300 582300 0 0.0
(read/write) 82356 82356 0 0.0
.bss 65552 65552 0 0.0
.data 2180 2180 0 0.0
.text 581764 581764 0 0.0
lock k32w0+release (read only) 555820 555836 16 0.0
(read/write) 80352 80352 0 0.0
.bss 63624 63624 0 0.0
.data 2104 2104 0 0.0
.text 555284 555300 16 0.0
linux chip-tool-ipv6only arm64 (read only) 12258652 12258652 0 0.0
(read/write) 746696 746696 0 0.0
.bss 34392 34392 0 0.0
.data 3008 3008 0 0.0
.data.rel.ro 688336 688336 0 0.0
.dynamic 560 560 0 0.0
.got 15752 15752 0 0.0
.init 24 24 0 0.0
.init_array 216 216 0 0.0
.rodata 570096 570096 0 0.0
.text 9915812 9915812 0 0.0
thermostat-no-ble arm64 (read only) 2528308 2528308 0 0.0
(read/write) 145816 145816 0 0.0
.bss 56392 56392 0 0.0
.data 1784 1784 0 0.0
.data.rel.ro 78048 78048 0 0.0
.dynamic 560 560 0 0.0
.got 5472 5472 0 0.0
.init 24 24 0 0.0
.init_array 432 432 0 0.0
.rodata 130136 130136 0 0.0
.text 2133440 2133440 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2495056 2495056 0 0.0
.bss 216304 216304 0 0.0
.data 5144 5144 0 0.0
.text 1457740 1457740 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1176336 1176352 16 0.0
bss 155563 155563 0 0.0
rodata 132752 132752 0 0.0
text 807272 807276 4 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read only) 4 4 0 0.0
(read/write) 1123444 1123444 0 0.0
bss 154757 154757 0 0.0
rodata 109748 109748 0 0.0
text 778212 778212 0 0.0
all-clusters-app nrf7002dk_nrf5340_cpuapp (read only) 4 4 0 0.0
(read/write) 1436080 1436080 0 0.0
bss 135303 135303 0 0.0
rodata 228768 228768 0 0.0
text 777936 777936 0 0.0
qpg lighting-app qpg6105+debug (read/write) 1169616 1169624 8 0.0
.bss 99632 99632 0 0.0
.data 856 856 0 0.0
.text 616716 616724 8 0.0
lock-app qpg6105+debug (read/write) 1139484 1139484 0 0.0
.bss 94824 94824 0 0.0
.data 856 856 0 0.0
.text 586584 586584 0 0.0

@jmartinez-silabs jmartinez-silabs merged commit ee81b19 into project-chip:master May 10, 2023
@jmartinez-silabs jmartinez-silabs deleted the fix/Define_BYTE_ORDER branch May 10, 2023 13:32
jmartinez-silabs added a commit to jmartinez-silabs/connectedhomeip that referenced this pull request May 16, 2023
…is (project-chip#26460)

* BYTE_ORDER must be defined in the project

* fix typo

* Remove BYTE_ORDER from the file. Only use __BYTE_ORDER__ and relative checks

* Apply suggestions from code review

Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>

---------

Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
andy31415 pushed a commit that referenced this pull request May 16, 2023
…is (#26460) (#26615)

* BYTE_ORDER must be defined in the project

* fix typo

* Remove BYTE_ORDER from the file. Only use __BYTE_ORDER__ and relative checks

* Apply suggestions from code review



---------

Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
jmartinez-silabs added a commit to SiliconLabs/matter that referenced this pull request May 18, 2023
… is defined. make sure that it is (project-chip#26460)

Merge in WMN_TOOLS/matter from cherry-pick/Fix_multicast_addr_endianness to RC_2.0.0-1.1

Squashed commit of the following:

commit 50f8a0590cfbfb2c0d69798efb641c4d4de1a7c2
Author: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com>
Date:   Wed May 10 09:24:21 2023 -0400

    Inet implementations assume BYTE_ORDER is defined. make sure that it is (project-chip#26460)

    * BYTE_ORDER must be defined in the project

    * fix typo

    * Remove BYTE_ORDER from the file. Only use __BYTE_ORDER__ and relative checks

    * Apply suggestions from code review

    Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>

    ---------

    Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
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.

4 participants