smoltcp-rs / smoltcp

a smol tcp/ip stack
BSD Zero Clause License
3.73k stars 414 forks source link

Socket error registration and processing #963

Open cavivie opened 1 month ago

cavivie commented 1 month ago

ICMP should register the error to the corresponding socket when it finds an error likes an unreachable address error. Currently, there is no error handling bound to the socket. In the Linux kernel, this is done by calling back the corresponding socket net protocol when an error is found in ICMP. For example, TCP/UDP/... error handlers will further bind the error to the socket structure based on information such as the four-tuple address. Should we consider this measure? The lack of it will make send/recv and other APIs unable to check errors such as unreachable addresses.

whitequark commented 1 month ago

ICMP should register the error to the corresponding socket when it finds an error likes an unreachable address error. Currently, there is no error handling bound to the socket.

Given that ICMP is purely advisory and it's often just dropped in real networks, I feel like it may not be worth the implementation/maintenance effort. I'm not opposed to it, to be clear, I'm just not sure if the effort/benefit ratio is there.

whitequark commented 1 month ago

Er, didn't mean to close the issue.