mini-dhcpd: stop reporting ARP as a corrupted frame
Swiss got a DHCP lease on hardware (10.0.0.64/24), but the script flagged
every ARP from the GC as "frame did NOT parse as DHCP ... this is what a
corrupted TX frame looks like". That was wrong and actively misleading: the
frames are valid lwIP duplicate-address probes (sender 0.0.0.0, target =
the offered address), sent to check the lease is free before accepting it.
The parser conflated "not DHCP" with "corrupted". A diagnostic that cries
wolf on normal traffic is worse than none, because 'malformed' then means
nothing. Now:
'info' from the client but not DHCP -- ARP decoded properly (probe vs
request vs reply, with addresses), other ethertypes named
'malformed' CLAIMED IPv4/UDP->67 and then failed to parse, i.e. what a
genuinely damaged TX frame would look like
So the corruption diagnostic still works -- that was the point of using a raw
socket -- but it only fires when it means something.
scripts/test-mini-dhcpd.py keeps the self-test, now including the exact
60-byte frame from the console (T6), a damaged DHCP packet that must still be
flagged (T7), and a raw ethertype (T8).
One note for anyone extending that test: the real frame goes in as ONE string
literal. Splitting the hex across two adjacent literals is how the first
version of T6 silently lost a byte and blamed the parser for decoding the
target as 0.10.0.0 -- the parser was correct.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1353,6 +1353,34 @@ parallel master is the default — see "W5100 vs W5500".)
|
||||
|
||||
---
|
||||
|
||||
## ✅ SWISS GETS A DHCP LEASE ON HARDWARE (2026-10-10)
|
||||
|
||||
`DISCOVER → OFFER → REQUEST → ACK`, lease `10.0.0.64/24`, served by
|
||||
`scripts/mini-dhcpd.py` on a direct link. This is the first end-to-end proof
|
||||
of the two paths our own test suite **structurally cannot** exercise:
|
||||
|
||||
- **The command-level interrupt works.** Receiving the OFFER requires
|
||||
`bba_event_handler` → `bba_cmd_in8(0x03) & 0x80` → `bba_interrupt()` →
|
||||
`bba_start_rx()`. That chain was dead until the `cmd_ir[7]` fix;
|
||||
`gc_bba_test` and `netboot` poll `RWP`/`IR` and would never have noticed.
|
||||
- **libogc2's TX path works** — no TWD write, `EXI_Dma` payload, NCRA ST1 —
|
||||
so the GC's documented DMA-write 1-bit-shift bug is NOT biting us.
|
||||
- **The MACRAW MF filter accepts unicast to `SHAR`**: both replies were sent
|
||||
unicast to `00:09:bf:00:00:01` and arrived.
|
||||
|
||||
Getting there needed, in order: the packed RX descriptor, both command-space
|
||||
forms, the counted TX length, the command-level interrupt, removing the
|
||||
device-ID one-shot, and the MF filter. Any one of them missing stops DHCP.
|
||||
|
||||
⚠️ **ARP from the GC is expected, not a fault.** lwIP sends an ARP probe
|
||||
(`sender 0.0.0.0`, `target` = the offered address) to check the lease is free
|
||||
before accepting it. The first version of `mini-dhcpd.py` reported every ARP
|
||||
as a corrupted TX frame; it now decodes them. Its padding is uninitialised
|
||||
junk rather than zeros, which is also normal — lwIP pads to the 60-byte
|
||||
ethernet minimum with whatever is in the pbuf.
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ Open compatibility gaps — see `docs/bba_compat_todo.md`
|
||||
|
||||
Known differences between this implementation and what real GC software
|
||||
|
||||
Reference in New Issue
Block a user