fix: [ee/tcpip] wire _libcglue_fdman_inet_ops in _ps2sdk_ps2ipee_init#835
Merged
uyjulian merged 1 commit intops2dev:masterfrom May 7, 2026
Merged
Conversation
_ps2sdk_ps2ipee_init only wired _libcglue_fdman_socket_ops; the inet ops
table (__ps2ipee_fdman_inet_ops, populated with ipaddr_addr / ip4addr_ntoa
/ ip4addr_aton) was filled in but the global pointer it backs was left
NULL. libcglue's inet_addr / inet_ntoa / inet_aton wrappers all check
the pointer before dispatching and silently return 0 / NULL when it is
NULL, so on the EE-side path:
inet_addr("192.168.31.233") => 0
Anything that resolved a literal IP string for outbound traffic (UDP
sendto, TCP connect by IP) ended up addressed to 0.0.0.0, which lwIP
classifies as broadcast and emits with dst MAC ff:ff:ff:ff:ff:ff —
the host's IP stack drops the frame because the unicast IP doesn't
match its own.
Wire and restore _libcglue_fdman_inet_ops symmetrically with the
existing socket-ops registration. Validated with an EE-side UDP echo
client (ps2_drivers/samples/udp_echo_server_ee) sustaining 100/100
round trips on real hardware after the fix; pre-fix every iter timed
out and tcpdump showed the packet on the wire as a broadcast for an
IP destination of 0.0.0.0.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
_libcglue_fdman_inet_ops in _ps2sdk_ps2ipee_init
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_ps2sdk_ps2ipee_init(the EE-side init that hooks the lwIP/ps2sdk stack into libcglue) wired_libcglue_fdman_socket_opsbut forgot to wire_libcglue_fdman_inet_ops. The inet ops table (__ps2ipee_fdman_inet_ops, populated withipaddr_addr/ip4addr_ntoa/ip4addr_aton) was filled in, but the global pointer it backs stayedNULL.libcglue's
inet_addr/inet_ntoa/inet_atonwrappers each check the pointer before dispatching and silently return0/NULLwhen it'sNULL, so on the EE-side path:Any code that resolved a literal IP string for outbound traffic (UDP
sendto, TCPconnectby IP) ended up addressed to0.0.0.0. lwIP classifies that as broadcast and emits the frame with destination MACff:ff:ff:ff:ff:ff— the host's IP stack drops it because the unicast destination IP doesn't match its own.The fix
Wire
_libcglue_fdman_inet_opssymmetrically with the existing socket-ops registration. Single 10-line addition in_ps2sdk_ps2ipee_init.Test plan
ps2_drivers/samples/udp_echo_server_ee) — 100/100 round trips sustained on real hardware. Pre-fix: every iter times out;tcpdumpon the host shows the packet emitted as a broadcast for IP destination0.0.0.0.tcp_burst_client_ee) —ok=20 fail=0against a host TCP echo server. Pre-fix: same broadcast-to-0.0.0.0 symptom.🤖 Generated with Claude Code