Page MenuHomeFreeBSD

iflib: return ENETDOWN when the network device is down

Authored by on Mar 19 2019, 11:37 PM.



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

This will cause the error message to be reported as

"ping: sendto: Network is down"

Signed-off-by: Jacob Keller <>

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; 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.