[netcf-devel] [PATCH] check IFF_RUNNING before considering an interface "active"

Eric Blake eblake at redhat.com
Wed Aug 1 00:06:47 UTC 2012


On 07/31/2012 05:57 PM, Laine Stump wrote:
> From: Laine Stump <laine at 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 at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <https://lists.fedorahosted.org/pipermail/netcf-devel/attachments/20120731/1db0d409/attachment.sig>


More information about the netcf-devel mailing list