Permalink
Browse files

Make sure to wait for the interface to be really created before letti…

…ng the function return for PPP(oE) interfaces.
  • Loading branch information...
smos committed Aug 18, 2011
1 parent 5a3031e commit 302d646e9c256ec71b4b8fc4b928ff14f84d7fb9
Showing with 9 additions and 0 deletions.
  1. +9 −0 etc/inc/interfaces.inc
View
@@ -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;
}

0 comments on commit 302d646

Please sign in to comment.