Do not report current link status if driver is not running.
This change also workarounds dhclient's link state handling bug by not giving current link status. Unlike other controllers, ale(4)'s PHY hibernation perfectly works such that driver does not see a valid link if the controller is not brought up. If dhclient(8) runs on ale(4) it will blindly waits until link UP and then gives up after 10 seconds. Because dhclient(8) still thinks interface got a valid link when IFM_AVALID is not set for selected media, this change makes dhclient initiate DHCP without waiting for link UP.
This commit is contained in:
parent
2b6f7122ab
commit
fd3d448fa8
@ -301,6 +301,10 @@ ale_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||
|
||||
sc = ifp->if_softc;
|
||||
ALE_LOCK(sc);
|
||||
if ((ifp->if_flags & IFF_UP) == 0) {
|
||||
ALE_UNLOCK(sc);
|
||||
return;
|
||||
}
|
||||
mii = device_get_softc(sc->ale_miibus);
|
||||
|
||||
mii_pollstat(mii);
|
||||
|
Loading…
x
Reference in New Issue
Block a user