On 07/31/2012 05:57 PM, Laine Stump wrote:
From: Laine Stump <laine(a)redhat.com>
This is in response to:
https://bugzilla.redhat.com/show_bug.cgi?id=844578
If an interface's cable is unplugged and it is configured to use dhcp
(or if NetworkManager is running), attempts to ifup will fail, but
netcf will later report that the interface is active. This is because
netcf only checks the IFF_UP flag in the interface status.
It makes more sense for the interface to be counted as active only if
ifup has been successful, so this patch changes the if_is_active()
utility function to require both IFF_UP and IFF_RUNNING be set before
counting the interface as active.
However, if an interface is configured for a static IP address *and
NetworkManager isn't running*, ifup will succeed even when the cable
is unplugged. So again the active status of the interface is not
consistent with the result of ifup. To resolve this inconsistency,
this patch makes na additional check for if_is_active() after the
s/na/an/
system's ifup utility successfully completes.
The result is consistency between the result of ifup and the
interface's flags in all cases.
Beyond that, looks reasonable to me.
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org