Commit 1561b2c
fix: [udptty] return size from udp_send for pre-link-up writes
lwIP 2.2.1 correctly fails lwip_sendto() with EHOSTUNREACH if it is
called before the SMAP driver reports NETIF_FLAG_LINK_UP (~3 s into
boot), because ip4_route() needs link state to pick a netif. udptty's
udp_send() ignored the lwip_sendto() return and unconditionally
returned 0 — so when the IOP stdio layer interpreted that as "0 bytes
written" it retried the write forever, hanging the loader.
Report `size` instead so the caller treats the data as consumed
(silently dropped on the wire when there's no route yet, written
normally once link comes up).
Independent of any 2.2.1-specific behaviour: 0 was always the wrong
return value for a successful no-op.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 586784c commit 1561b2c
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
234 | 236 | | |
235 | 237 | | |
236 | 238 | | |
| |||
241 | 243 | | |
242 | 244 | | |
243 | 245 | | |
244 | | - | |
| 246 | + | |
245 | 247 | | |
246 | 248 | | |
247 | 249 | | |
| |||
0 commit comments