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.

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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

bz accepted this revision as: bz.Mar 27 2019, 11:06 AM
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.