diff options
author | Renato Botelho <renato@netgate.com> | 2017-01-17 16:33:21 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-01-17 16:33:21 -0200 |
commit | 5280fd8d21c71c6997e1855f8b96265bd81ccb99 (patch) | |
tree | d91faa88b2d78e6b8c41f1f56a5e47499fed0ef4 /src/etc/inc/interfaces.inc | |
parent | 3a2da5b804db2bc6a76dedb21abe041843b2229c (diff) | |
download | pfsense-5280fd8d21c71c6997e1855f8b96265bd81ccb99.zip pfsense-5280fd8d21c71c6997e1855f8b96265bd81ccb99.tar.gz |
Fix #6603: Wait while interface is in 'tentative' state before try to bind OpenVPN to its address
Diffstat (limited to 'src/etc/inc/interfaces.inc')
-rw-r--r-- | src/etc/inc/interfaces.inc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index ef9af77..f2d2e30 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -1414,6 +1414,24 @@ function interfaces_carp_set_maintenancemode($carp_maintenancemode) { } } +function interface_wait_tentative($interface, $timeout = 10) { + if (!does_interface_exist($interface)) { + return false; + } + + $time = 0; + while ($time <= $timeout) { + $if = pfSense_get_interface_addresses($interface); + if (!isset($if['tentative'])) { + return true; + } + sleep(1); + $time++; + } + + return false; +} + function interface_isppp_type($interface) { global $config; |