Skip to content

Commit

Permalink
filter, gw weight can not be 0 (imported config?)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdSchellevis committed Sep 18, 2017
1 parent de39b3b commit 4d2e840
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/opnsense/mvc/app/library/OPNsense/Firewall/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ public function setGatewayGroups($groups)
$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';
}
Expand Down

0 comments on commit 4d2e840

Please sign in to comment.