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

net: Move NET_TCP/UDP_HAVE_STACK to netconfig.h #14886

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

wengzhe
Copy link
Contributor

@wengzhe wengzhe commented Nov 21, 2024

Summary

Now (after #14634 and #14650) the HAVE_PFINET(6)_SOCKETS depends on NET_TCP/UDP_HAVE_STACK, which is previously defined in net/ folder and cannot be included. Considering many places use this check, maybe moving them to netconfig.h could be better.

Impact

Before: IPv4 + TCP, without ICMP -> HAVE_PFINET_SOCKETS is undefined, we cannot use TCP socket (error is EAFNOSUPPORT)
After: IPv4 + TCP, without ICMP -> HAVE_PFINET_SOCKETS is defined, we can use TCP socket

Testing

QEMU with CONFIG_NET_IPv4 & CONFIG_NET_TCP enabled but CONFIG_NET_ICMP_SOCKET disabled.

Now the HAVE_PFINET(6)_SOCKETS depends on NET_TCP/UDP_HAVE_STACK, which
is previously defined in net/ folder and cannot be included.
Considering many places use this check, maybe moving them to netconfig.h
could be better.

Signed-off-by: Zhe Weng <[email protected]>
@github-actions github-actions bot added Area: Networking Effects networking subsystem Size: S The size of the change in this PR is small labels Nov 21, 2024
@nuttxpr
Copy link

nuttxpr commented Nov 21, 2024

[Experimental Bot, please feedback here]

This PR does not fully meet the NuttX requirements. Here's why and how to fix it:

Missing Information:

  • Summary: While the summary explains the "why", it lacks clarity on the "what" and "how". Specifically:

    • What functional part is changed? Clearly state which files are modified (e.g., netconfig.h).
    • How does the change work? Instead of describing the before/after behavior, explain how moving the definitions to netconfig.h solves the problem. For example, "This change moves the definitions of HAVE_PFINET(6)_SOCKETS to netconfig.h, making them accessible to code that previously couldn't include the necessary headers from the net/ directory."
  • Impact: Several sections need more detail:

    • Is new feature added? Is existing feature changed? Be explicit. This is likely an "existing feature changed" due to a bug fix.
    • Impact on user: While the before/after behavior is described, clarify how a user might observe this change. For example, "Applications that previously failed to create TCP sockets when ICMP was disabled will now function correctly."
    • Impact on build: If only header files are changed, the build process itself is unlikely to change significantly. Clarify this.
    • Impact on hardware: Be explicit. Likely "NO".
    • Impact on documentation: If the behavior changed, documentation might need updating. Even if no changes are needed, explicitly state "NO".
    • Impact on security: Be explicit. Likely "NO".
    • Impact on compatibility: This is the most important part needing clarification. Does this change break anything? Is it backwards compatible? Explain thoroughly.
    • Anything else to consider: Be explicit. Likely "NO".
  • Testing:

    • Build Host(s): Provide details about your build host OS, CPU architecture, and compiler version.
    • Target(s): Specify the QEMU architecture (e.g., qemu-system-x86_64). Also, provide the full NuttX configuration name (e.g., nsh).
    • Testing logs: The logs are missing entirely. Include actual output demonstrating the failure before the change and the success after the change. Show commands used and their output. For example:
Before (without the patch):
$ make ARCH=sim BOARD=qemu-i486 CONFIG=nsh
... build output ...
$ nsh
nsh> netstat -a
... output showing no TCP socket available ...
nsh> telnet google.com 80
EAFNOSUPPORT

After (with the patch):
$ make ARCH=sim BOARD=qemu-i486 CONFIG=nsh
... build output ...
$ nsh
nsh> netstat -a
... output showing TCP socket available ...
nsh> telnet google.com 80
Connected to google.com.
Escape character is '^]'.

By providing the missing information and clarifying the existing details, the PR will better meet the NuttX requirements and be easier for reviewers to evaluate.

@xiaoxiang781216 xiaoxiang781216 merged commit 752245a into apache:master Nov 21, 2024
27 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: S The size of the change in this PR is small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Networking HAVE_PFINET_SOCKETS always undefined
4 participants