casaroli opened a new pull request, #22377:
URL: https://github.com/apache/nuttx/pull/22377

   ## Summary
   
   Two network configurations do not build on master:
   
   - IPv4 or IPv6 turned off in a configuration with ICMP sockets. `NET_ICMP` 
and `NET_ICMPv6` have no dependency on their IP version, so the options stay 
set, and `icmp_sockif.c` / `icmpv6_sockif.c` call `ipv4_getsockopt()` / 
`ipv6_getsockopt()`, which are declared only with that IP version. Commit 1 
shows the `NET_ICMP` prompt only with `NET_IPv4` and the `NET_ICMPv6` prompt 
only with `NET_IPv6`. It is not a `depends on`: `NET_ICMP(v6)_NO_STACK` selects 
the option for a usrsock ICMP socket without the IP version in the kernel 
(sim:wakaama selects `NET_ICMPv6_NO_STACK` without `NET_IPv6`; 6898409d04e 
removed the old dependency for this reason).
   - IPv6 without a link layer that has an address (sim:rpproxy + 
`CONFIG_NET_IPv6`). `neighbor_lookup.c` copies `dev->d_mac`, which exists only 
with Ethernet, 6LoWPAN, Bluetooth, IEEE 802.15.4 or TUN. Commit 2 copies it 
only when it exists (`netdev_lladdrsize()` gives 0 for the other link layers).
   
   The apps side (the DHCP client without IPv4, unused IPv6 addresses in 
netinit) is apache/nuttx-apps#NNNN.
   
   ## Impact
   
   Build fix. No in-tree defconfig sets an ICMP option with IPv4 off or an 
ICMPv6 option with IPv6 off (65 defconfigs have IPv4 off), so no defconfig 
changes. No API, ABI or code size change. The same in all build modes and on 
all architectures.
   
   ## Testing
   
   Builds with `-Werror` in the CI image (gcc 12.3), master 28db4789c34 and 
this branch:
   
   | Config | master | this PR |
   |---|---|---|
   | rv-virt:netnsh (flat) + NET_ICMPv6 + NET_ICMPv6_SOCKET, IPv6 off | FAIL: 
`icmpv6_sockif.c:388: implicit declaration of function 'ipv6_getsockopt'` | OK 
(NET_ICMPv6 is n) |
   | rv-virt:netnsh, IPv4 off, IPv6 on, with apache/nuttx-apps#NNNN | FAIL: 
`icmp_sockif.c:393: implicit declaration of function 'ipv4_getsockopt'` (and 
`netlib_checkifconnectivity.c`, built for ICMP sockets) | OK |
   | sim:rpproxy + NET_IPv6, with apache/nuttx-apps#NNNN | FAIL: 
`neighbor_lookup.c:84: 'struct net_driver_s' has no member named 'd_mac'` | OK |
   | sim:rpproxy + NET_USRSOCK_ICMPv6 (NET_ICMPv6_NO_STACK without IPv6) | OK | 
OK, no Kconfig warning |
   
   Also OK on this branch: qemu-armv8a:netnsh, rv-virt:netnsh, 
rv-virt:knetnsh64 (kernel), sim:rpproxy, qemu-armv8a:knsh (kernel) with IPv4, 
IPv6, ICMP, ICMPv6, MLD.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to