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)
Wed, Nov 20, 9:02 AM
Unknown Object (File)
Wed, Nov 20, 8:18 AM
Unknown Object (File)
Mon, Nov 4, 2:25 PM
Unknown Object (File)
Tue, Oct 29, 2:47 PM
Unknown Object (File)
Oct 22 2024, 5:52 AM
Unknown Object (File)
Oct 19 2024, 6:55 AM
Unknown Object (File)
Oct 10 2024, 7:13 AM
Unknown Object (File)
Oct 6 2024, 12:30 PM
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.