summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-02-24 00:18:07 +0545
committerRenato Botelho <garga@FreeBSD.org>2015-02-23 16:28:15 -0300
commit623e6d096d7596c712441cda5a7ee23bbd68ba95 (patch)
tree6d5a8e0f81436635361e322dfe5ce65e26edc41b /etc
parent4f5967b9a893447b936c06858183a2277ac5bb57 (diff)
downloadpfsense-623e6d096d7596c712441cda5a7ee23bbd68ba95.zip
pfsense-623e6d096d7596c712441cda5a7ee23bbd68ba95.tar.gz
Preserve "add routers" value across loop for each interface
Forum: https://forum.pfsense.org/index.php?topic=89302.0 If the user put "none" in the 'gateway' field for the DHCP settings of an interface, that would set $add_routers to false at line 742. Coming around the loop again for a subsequent interface, and going through the else line 744, nothing would set $add_routers back to true (actually back to the value originally calculated at line 461). Use a different var to remember the boolean value calculated at line 461 so it can be remembered and used as needed each time through the loop. I set Gateway "none" on my LAN and left it blank on OPT1 and came up with the same problem as the forum post - OPT1 got no " option routers" statement in dhcpd.conf After this code fix it looks good.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/services.inc5
1 files changed, 3 insertions, 2 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index d1ac830..95af5a6 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -458,13 +458,13 @@ EOD;
$dhcpdconf .= "always-broadcast on\n";
$dhcpdifs = array();
- $add_routers = false;
+ $enable_add_routers = false;
$gateways_arr = return_gateways_array();
/* only add a routers line if the system has any IPv4 gateway at all */
/* a static route has a gateway, manually overriding this field always works */
foreach($gateways_arr as $gwitem) {
if($gwitem['ipprotocol'] == "inet") {
- $add_routers = true;
+ $enable_add_routers = true;
break;
}
}
@@ -741,6 +741,7 @@ EOPP;
} elseif ($dhcpifconf['gateway'] == "none") {
$add_routers = false;
} else {
+ $add_routers = $enable_add_routers;
$routers = $ifcfgip;
}
if($add_routers)
OpenPOWER on IntegriCloud