From 302d646e9c256ec71b4b8fc4b928ff14f84d7fb9 Mon Sep 17 00:00:00 2001 From: smos Date: Thu, 18 Aug 2011 12:10:17 +0200 Subject: [PATCH] Make sure to wait for the interface to be really created before letting the function return for PPP(oE) interfaces. --- etc/inc/interfaces.inc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index cff2fd14ba8..7d0d0218170 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -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; }