Page MenuHomeFreeBSD

iflib: return ENETDOWN when the network device is down

Authored by on Mar 19 2019, 11:37 PM.
Referenced Files
Unknown Object (File)
Sat, Sep 30, 5:11 AM
Unknown Object (File)
Aug 24 2023, 4:40 AM
Unknown Object (File)
Jul 27 2023, 10:49 AM
Unknown Object (File)
Jul 27 2023, 8:39 AM
Unknown Object (File)
Jul 11 2023, 7:42 AM
Unknown Object (File)
Apr 10 2023, 1:13 AM
Unknown Object (File)
Feb 7 2023, 2:13 PM
Unknown Object (File)
Feb 4 2023, 8:15 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

Lint Passed
No Test Coverage
Build Status
Buildable 23196
Build 22239: arc lint + arc unit

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.