Skip to content

feat: package lwIP for Xbox - #12

Merged
ReenigneArcher merged 3 commits into
masterfrom
codex/package-lwip
Nov 30, 2026
Merged

ReenigneArcher merged 3 commits into
masterfrom
codex/package-lwip

Conversation

@ReenigneArcher

@ReenigneArcher ReenigneArcher commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Description

Package the existing lwIP 2.2.1 port and Xbox Ethernet driver as lwip. The archive includes nxNetInit and exports the existing libnxdk_net.lib name. The recipe also installs the lwIP and port headers and pkg-config metadata.

Remove the lwIP Git submodule and SDK archive build rule. Makefile projects pick up the installed package automatically or require it using NXDK_NET=y or NXDK_PACKAGES=lwip. The Docker SDK and both HTTP samples now consume the package.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Testing

Built the package and both HTTP sample ISOs using the Docker SDK. Verified that the hello sample builds without a package prefix and that the HTTP sample emits an installation diagnostic when lwIP is missing. The lwIP guest passed locally in xemu. The full hosted run passed all 27 guest tests, including Xbox Ethernet initialization and UDP socket binding. Windows, macOS, and Ubuntu sample builds also passed. Verified the license checksum with core.autocrlf=true. Bash syntax, clang-format, and git diff --check passed. Hosted xemu tests · Build Samples

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Tests have been added or updated for new or modified functionality, including regression tests for bug fixes

AI Usage

See our AI usage policy.

  • AI tools were used while preparing this PR

Comment thread README.md Resolved
@sonarqubecloud

Copy link
Copy Markdown

@ReenigneArcher ReenigneArcher left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The recipe packages lwIP 2.2.1 at the same upstream commit as the SDK's former submodule. I verified that lwip.pc links the packaged archive and that a local xemu guest can initialize networking through it. The sample matrix passed on this head. The previous head passed all 27 hosted guest tests. The current hosted job hit HTTP 403 while downloading xemu support files before the guest ran. Current hosted job

Before Sunshine-client can switch, the package needs the discovery and receive options below. The integration also needs to preserve Sunshine's receive-queue sizing, network thread priorities, and packet-drop handling under receive pressure. Those settings were outside my focused mDNS and socket-options probe.

Review completed by Codex | Model: gpt-6.2-sol | Thinking: xhigh

Comment thread pkgbuilds/lwip/lwip.mk
include $(LWIPDIR)/Filelists.mk

XBDK_NET := $(NXDK_DIR)/lib/net
LWIP_SOURCES := $(COREFILES) $(CORE4FILES) $(CORE6FILES) $(APIFILES) \

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Build the discovery and socket features Sunshine uses before switching it to this package

Sunshine's current Xbox build compiles the mDNS sources with IGMP and per-interface client storage. It also enables socket receive timeouts for pairing and receive-buffer sizing for streaming. This archive omits the mDNS and IGMP symbols. I linked the exact CI package in xemu and both SO_RCVTIMEO and SO_RCVBUF returned ENOPROTOOPT.

The source-list change below goes with enabling LWIP_IGMP, LWIP_MDNS_RESPONDER, LWIP_SO_RCVTIMEO, and LWIP_SO_RCVBUF and setting LWIP_NUM_NETIF_CLIENT_DATA to 1 in lib/net/nforceif/include/lwipopts.h. lwIP 2.2.1 already defaults LWIP_MDNS_SEARCH to 1. Rebuild the whole archive and install the matching headers because these options alter lwIP types also used by nxNetInit. Refresh the recipe checksum for lwip.mk.

With those changes, the local guest accepted both socket options, read back the selected receive buffer, registered the interface for mDNS, and started a discovery search. The probe checked local API behavior in xemu.

Suggested change
LWIP_SOURCES := $(COREFILES) $(CORE4FILES) $(CORE6FILES) $(APIFILES) \
LWIP_SOURCES := $(COREFILES) $(CORE4FILES) $(CORE6FILES) $(APIFILES) $(MDNSFILES) \

Review completed by Codex | Model: gpt-6.2-sol | Thinking: xhigh

Comment thread README.md
Comment on lines +108 to +110
projects can request package modules with `NXDK_PACKAGES`. Install `lwip`
for networking. Makefile projects can require it with `NXDK_NET=y` or by
including `lwip` in `NXDK_PACKAGES`.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep lwIP installation instructions beside its recipe

Move the install and NXDK_NET=y guidance into pkgbuilds/lwip/README.md. The package descriptions in the overview work as links to the individual packages.

Suggested change
projects can request package modules with `NXDK_PACKAGES`. Install `lwip`
for networking. Makefile projects can require it with `NXDK_NET=y` or by
including `lwip` in `NXDK_PACKAGES`.
projects can request package modules with `NXDK_PACKAGES`. See the
[lwIP package documentation](pkgbuilds/lwip/README.md) for Xbox networking.

Review completed by Codex | Model: gpt-6.2-sol | Thinking: xhigh

@ReenigneArcher
ReenigneArcher merged commit 81e180d into master Nov 30, 2026
31 of 33 checks passed
@ReenigneArcher
ReenigneArcher deleted the codex/package-lwip branch November 30, 2026 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant