* fix(xnet): make blocking waits deadline-driven instead of iteration-capped
All six StackBlocking wait loops run 'for range maxIter' (1000). With a
non-sleeping backoff like BackoffFlagGosched, the sensible choice on
GOMAXPROCS=1 targets where sleeping starves the NIC poll, those 1000
iterations complete in ~20ms of wall time and silently replace the
caller's timeout: a dial with the default 2s timeout fails after ~21ms
with a spurious deadline error against any peer slower than that.
Observed dialing github.com from a single-core bare-metal (tamago)
target through go-net.
The deadline check inside every loop is the real guard, so it becomes the
loop condition itself and keeps the bounded lifetime visible on the for
statement:
for ok := true; ok; ok = s.checkDeadline(deadline) == nil {
DoDHCPv4 loses its separate deadline branch as a result. It used to check
only on iterations without a state change, which without the iteration
cap would let a peer that keeps feeding state transitions hold the loop
past any deadline; from the header the check runs every iteration.
The regression test drives a dial through 4000 no-progress wait
iterations on simulated time (<5% of the deadline elapsed) and requires
establishment once the handshake is finally serviced; on current main it
fails at exactly iteration 1000.
* go fix
---------
Co-authored-by: Derek den Haas <d.haas@directcode.com>
* rewrite tinygo failing test to be more real-time
* use channels to scheduler stack
* fix flakiness by increasing timeout and move implementation to top of file
* begin working on arp cache
* fix little things
* rework arp cache priority
* fix test
* keep working on ARP
* push changes before thinking about ip prefix issue
* add passive peer MAC setting
* patch egress mac with correct ethernet CRCs
* consolidate subnet learning in subnetTable type
* add tests and fix subnet table bug
* begin adding icmp client
* rely on anon structs
* add tests
* tests passing
* icmp fleshed out
* rework icmp to include ip addr
* rename StackAsync.Demux/Encapsulate to RecvEthernet and SendEthernet
* remove legacy unreachable TCP tests
* remove uses of deprecated internet.StackNode in preference of lneto.StackNode
* documentation
* rename methods to signal no I/O happening
* add prints to investigate slowness
* add loop sleep for blocking Stack
* add connection close http attribute and detect end of HTML page
* add timeout to bridge read
* examples/xnet: add ntp timestamp to prints and show output in readme
* add polling to http tap interface
* more digits in ntp format
* prevent crashes on non-8 timestamp