filter, gw weight can not be 0 (imported config?)

This commit is contained in:
Ad Schellevis 2017-09-18 12:05:22 +02:00
parent de39b3b44d
commit 4d2e84072c

View File

@ -98,7 +98,8 @@ class Plugin
$proto = 'inet';
foreach ($gwgr as $gw) {
if (Util::isIpAddress($gw['gwip']) && !empty($gw['int'])) {
$routeto[] = str_repeat("( {$gw['int']} {$gw['gwip']} )", $gw['weight']);
$gwweight = empty($gw['weight']) ? 1 : $gw['weight'];
$routeto[] = str_repeat("( {$gw['int']} {$gw['gwip']} )", $gwweight);
if (strstr($gw['gwip'], ':')) {
$proto = 'inet6';
}