Skip to content

Commit

Permalink
Make sure to wait for the interface to be really created before letti…
Browse files Browse the repository at this point in the history
…ng the function return for PPP(oE) interfaces.
  • Loading branch information
smos committed Aug 18, 2011
1 parent 5a3031e commit 302d646
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions etc/inc/interfaces.inc
Expand Up @@ -1671,6 +1671,15 @@ EOD;
else
setup_pppoe_reset_file($ppp['if']);
}
/* wait for upto 10 seconds for the interface to appear (ppp(oe)) */
$i = 0;
while($i < 10) {
exec("/sbin/ifconfig {$ppp['if']} 2>&1", $out, $ret);
if($ret == 0)
break;
sleep(1);
$i++;
}

return 1;
}
Expand Down

0 comments on commit 302d646

Please sign in to comment.