zhhyu7 opened a new pull request, #4198: URL: https://github.com/apache/nuttx-apps/pull/4198
*Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).* ## Summary - netlib_clear_dnsaddr(): drop all DNS servers and restore the build default via dns_default_nameserver() (CONFIG_NETDB_DNSCLIENT). - netlib_getifstatistics.c was built by the Makefile but missing from CMakeLists.txt; add it. - netlib_getifstatistics() reported a failed procfs open with fprintf(stderr), which corrupts the stream for callers that own stdout/stderr (ymodem); use nerr(). - netlib_check_ifconflict() returns 2 while ACD (RFC 5227) is announcing or monitoring, in addition to 0 (no conflict) and 1 (conflict). - netlib_ethtool_ioctl(), netlib_ethtool_getchannel() and netlib_ethtool_setchannel(): get/set the mask of enabled combined channels through SIOCETHTOOL (CONFIG_NETDEV_ETHTOOL_IOCTL). ## Impact - New API only; existing functions keep their behavior except netlib_check_ifconflict(), which can now return 2. There are no in-tree callers; out-of-tree callers that test "!= 0" for a conflict must check "== 1" instead. ## Testing sim:dynconns with CONFIG_NETDEV_STATISTICS, CONFIG_NET_ARP_ACD, CONFIG_NETDB_DNSCLIENT and CONFIG_NETDEV_ETHTOOL_IOCTL, plus a small test program (not part of this PR) that calls each function: ``` nsh> nltest getifstatistics(eth0)=0 rx_packets=0 tx_packets=2 getifstatistics(nosuch0)=-20 check_ifconflict(eth0)=2 dns[1] 10.0.1.53 dns servers after add: 1 dns servers after clear: 0 ethtool_getchannel(eth0)=-1 errno=25 map=0xdead ethtool_setchannel(eth0)=-1 errno=25 ethtool_getchannel(nosuch0)=-1 errno=25 ``` - check_ifconflict returns 2: ACD is still monitoring eth0 after boot. - The ethtool calls return ENOTTY (25) because no sim driver implements get_channels/set_channels; that is the expected error path. The channel API itself needs a lower-half driver that implements it and was not tested at runtime. Also built with CONFIG_NET_IGMP=n and CONFIG_NETDEV_ETHTOOL_IOCTL=n (Make), and with CMake (sim:dynconns, all of the above enabled): netlib_cleardnsaddr.c, netlib_getifstatistics.c, netlib_checkifconflict.c and netlib_ethtool.c are compiled and the image links. checkpatch.sh -c -u -m -g passes for every commit. -- 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]
