Skip to content

net/icmp: Return -ENOPROTOOPT for SOL_SOCKET to avoid misleading logs#17662

Merged
xiaoxiang781216 merged 1 commit intoapache:masterfrom
wangchen61698:81810
Dec 25, 2025
Merged

net/icmp: Return -ENOPROTOOPT for SOL_SOCKET to avoid misleading logs#17662
xiaoxiang781216 merged 1 commit intoapache:masterfrom
wangchen61698:81810

Conversation

@wangchen61698
Copy link
Copy Markdown
Contributor

Note: Please adhere to Contributing Guidelines.

Summary

When SOL_SOCKET options (e.g., SO_BINDTODEVICE via ping -I) hit ICMP sockets, icmp_{get,set}sockopt logged “Unrecognized ICMP option: 17” before fallback. Handle SOL_SOCKET explicitly by returning -ENOPROTOOPT so psock_* routes to the socket-level handler. Removes noisy logs without changing behavior (invalid devices still return -ENODEV).

Impact

icmp log

Testing

Please verify this PR together with another PR
apache/nuttx-apps#3263

After patch
image

Before patch

image

When SOL_SOCKET options (e.g., SO_BINDTODEVICE via ping -I) hit ICMP sockets, icmp_{get,set}sockopt logged “Unrecognized ICMP option: 17” before fallback. Handle SOL_SOCKET explicitly by returning -ENOPROTOOPT so psock_* routes to the socket-level handler. Removes noisy logs without changing behavior (invalid devices still return -ENODEV).

Signed-off-by: wangchen <wangchen41@xiaomi.com>
@github-actions github-actions Bot added Area: Networking Effects networking subsystem Size: S The size of the change in this PR is small labels Dec 24, 2025
linguini1
linguini1 previously approved these changes Dec 24, 2025
@github-actions github-actions Bot added Area: Documentation Improvements or additions to documentation Size: M The size of the change in this PR is medium labels Dec 25, 2025
@github-actions github-actions Bot removed the Area: Documentation Improvements or additions to documentation label Dec 25, 2025
@xiaoxiang781216 xiaoxiang781216 merged commit c825404 into apache:master Dec 25, 2025
97 of 117 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Networking Effects networking subsystem Size: M The size of the change in this PR is medium Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants