13627105546 opened a new pull request, #3320: URL: https://github.com/apache/nuttx-apps/pull/3320
The ping socket creation method is changed from SOCK_DGRAM to SOCK_RAW, because SOCK_DGRAM may not have permission in some environments (e.g. Docker). Also add checksum calculation when send, and perform IP header processing when receive. *Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).* ## Summary netutils/ping: change socket type to SOCK_RAW The ping socket creation method is changed from SOCK_DGRAM to SOCK_RAW. In some environments (e.g., Docker based on matrix), creating a socket with SOCK_DGRAM may lack the necessary permissions, causing network ping to be unavailable. This change also adds manual checksum calculation when sending and performs IP header processing when receiving, which are required when using SOCK_RAW. ## Impact * **Users:** Users running NuttX in simulated environments (sim) or Docker containers where `SOCK_DGRAM` permissions are restricted. * **Build:** No impact on build configuration. * **Compatibility:** Backward compatible; changes internal implementation of `ping` utility. ## Testing * **Verification:** Verified that the code compiles successfully and checkpatch.sh passes. * **Target:** Verified on sim:tcpblaster configuration running in a Docker environment. * **Procedure:** 1. Run the simulator in the Docker environment. 2. Execute `ping <target_ip>`. 3. Verify that ping requests are sent and replies are received correctly. -- 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]
