[netcf-devel] [PATCH] wait for IFF_UP and IFF_RUNNING after calling ifup
Laine Stump
laine at laine.org
Thu May 16 00:55:55 UTC 2013
On 05/15/2013 03:54 PM, Eric Blake wrote:
> 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.
>
I had that thought, but the netcf code started out using int for
booleans, and I didn't feel like changing it just for this.
I may go through sometime and change them all to bool, but not today :-)
Thanks!
More information about the netcf-devel
mailing list