[netcf-devel] [PATCH] wait for IFF_UP and IFF_RUNNING after calling ifup

Eric Blake eblake at redhat.com
Wed May 15 19:54:14 UTC 2013


On 05/15/2013 01:11 PM, Laine Stump wrote:
> This fixes https://bugzilla.redhat.com/show_bug.cgi?id=961184
> 
> Apparently one or the other of IFF_UP and IFF_RUNNING are not always
> set by the time /sbin/ifup returns control to netcf, so the subsequent
> check to verify that the interface is up may fail. This patch adds a
> loop to re-check the status of the interface every 250msec for up to
> 2.5 seconds (or until both flags are set). If timeout is reached, it
> still fails the operation.
> ---
>  bootstrap.conf   |  3 ++-
>  src/drv_debian.c | 13 ++++++++++---
>  src/drv_redhat.c | 11 +++++++++--
>  src/drv_suse.c   | 13 ++++++++++---
>  4 files changed, 31 insertions(+), 9 deletions(-)

> @@ -1056,10 +1056,17 @@ int drv_if_up(struct netcf_if *nif) {
>      static const char *const ifup = IFUP;
>      struct netcf *ncf = nif->ncf;
>      int result = -1;
> +    int is_active, retries;

Is it worth using 'bool'?

ACK if you are okay with 'int' used as a boolean.

-- 
Eric Blake   eblake 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: 621 bytes
Desc: OpenPGP digital signature
URL: <https://lists.fedorahosted.org/pipermail/netcf-devel/attachments/20130515/1c4f208b/attachment.sig>


More information about the netcf-devel mailing list