mirror of
https://review.haiku-os.org/haiku
synced 2025-01-31 02:35:03 +01:00
networkstatus: add no NoLink and LinkNoConfig status
An interface that fail to configure due to link lost will be reported to have "No Link" instead of to be still "Configuring...", which was not the actual state.
This commit is contained in:
parent
65abebfaa7
commit
cb7833c724
@ -498,16 +498,17 @@ NetworkStatusView::_DetermineInterfaceStatus(
|
||||
const BNetworkInterface& interface)
|
||||
{
|
||||
uint32 flags = interface.Flags();
|
||||
int32 status = kStatusNoLink;
|
||||
|
||||
// TODO: no kStatusLinkNoConfig yet
|
||||
|
||||
if ((flags & IFF_LINK) == 0)
|
||||
return kStatusNoLink;
|
||||
if ((flags & (IFF_UP | IFF_LINK | IFF_CONFIGURING)) == IFF_LINK)
|
||||
return kStatusLinkNoConfig;
|
||||
if (flags & IFF_CONFIGURING)
|
||||
status = kStatusConnecting;
|
||||
else if ((flags & (IFF_UP | IFF_LINK)) == (IFF_UP | IFF_LINK))
|
||||
status = kStatusReady;
|
||||
return kStatusConnecting;
|
||||
if ((flags & (IFF_UP | IFF_LINK)) == (IFF_UP | IFF_LINK))
|
||||
return kStatusReady;
|
||||
|
||||
return status;
|
||||
return kStatusUnknown;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user