Page MenuHomeFreeBSD

iflib: return ENETDOWN when the network device is down
ClosedPublic

Authored by jacob.e.keller_intel.com on Mar 19 2019, 11:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 23, 12:58 PM
Unknown Object (File)
Tue, Apr 2, 5:29 PM
Unknown Object (File)
Feb 25 2024, 4:10 AM
Unknown Object (File)
Feb 18 2024, 8:19 AM
Unknown Object (File)
Jan 13 2024, 5:43 AM
Unknown Object (File)
Jan 1 2024, 3:44 PM
Unknown Object (File)
Dec 21 2023, 7:42 AM
Unknown Object (File)
Dec 20 2023, 7:55 AM
Subscribers

Details

Summary

iflib_if_transmit returns ENOBUFS when the device is down, or when the
link isn't active.

This was changed in r308792 from return (0), so that the function
correctly reports an error that it was unable to transmit.

However, using ENOBUFS can cause some network applications to produce
the following or similar errors:

"ping: sendto: No buffer space available"

This is a bit confusing as the real cause of the issue is that the
network device is down.

Replace the ENOBUFS return with ENETDOWN to indicate more clearly that
the reason for the failure to send is due to the network device is
offline.

This will cause the error message to be reported as

"ping: sendto: Network is down"

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz added a subscriber: bz.

Seems fine to me. I keep running into that at boot and have yet to figure out why transmit is not possible at that point yet; it kills the first IPv6 RS/IPv4 DHCP packet (but that's for another review).

This revision is now accepted and ready to land.Mar 27 2019, 5:46 PM
This revision was automatically updated to reflect the committed changes.