summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/system.inc
diff options
context:
space:
mode:
authorLuiz Otavio O Souza <luiz@netgate.com>2016-02-08 19:22:40 -0600
committerLuiz Otavio O Souza <luiz@netgate.com>2016-02-09 15:58:43 -0600
commit2a5960b07bb2a40aeaf81423b0c52d5629e87e49 (patch)
tree9fcb0bdd705cd77b0e570ec84a4ead17259659ac /src/etc/inc/system.inc
parentfd4dbabc09ddd265f78db8140bdac688651f3575 (diff)
downloadpfsense-2a5960b07bb2a40aeaf81423b0c52d5629e87e49.zip
pfsense-2a5960b07bb2a40aeaf81423b0c52d5629e87e49.tar.gz
Review of CARP uniqid changes.
It turns out that current CARP implementation is not much different from an IP alias. This commit converts the IP alias to also use the CARP uniqid scheme, this simplify the code in all other places because now we have only two different cases to deal with: - A friendly interface name (lan, wan, opt1, etc.); - A Virtual IP - VIP alias (_vip{$uniqid}) - CARP or IP Alias. The parent of a CARP is always a friendly interface. The parent of an IP alias can be a friendly interface or a CARP (this is the only case of recursion of a VIP). This commit removes a few cases where CARP were still considered a interface (the old CARP implementation), fixes all the wrong cases of strpos() being used to detect a VIP address (wont work as it returns '0' which fails when tested as 'TRUE'), review the usage of CARP and IP alias as services bind addresses, fixes general issues of adding and editing VIP addresses. The following subsystems were affected by this changes: - IPSEC; - OpenVPN; - dnsmasq; - NTP; - gateways and gateway groups; - IPv6 RA; - GRE interfaces; - CARP status; - Referrer authentication. Fixes (and/or revisit) the following tickets: - Ticket #3257 - Ticket #3716 - Ticket #4450 - Ticket #4858 - Ticket #5441 - Ticket #5442 - Ticket #5500 - Ticket #5783 - Ticket #5844
Diffstat (limited to 'src/etc/inc/system.inc')
-rw-r--r--src/etc/inc/system.inc16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc
index e9a53b9..ca3af44 100644
--- a/src/etc/inc/system.inc
+++ b/src/etc/inc/system.inc
@@ -1792,17 +1792,15 @@ function system_ntp_configure($start_ntpd=true) {
}
if (is_array($interfaces) && count($interfaces)) {
+ $finterfaces = array();
$ntpcfg .= "interface ignore all\n";
foreach ($interfaces as $interface) {
- if (strstr($interface, "_vip")) {
- $interface = get_configured_carp_interface_list($interface);
- }
- if (!is_ipaddr($interface)) {
- $interface = get_real_interface($interface);
- }
- if (!empty($interface)) {
- $ntpcfg .= "interface listen {$interface}\n";
- }
+ $interface = get_real_interface($interface);
+ if (!empty($interface))
+ $finterfaces[] = $interface;
+ }
+ foreach ($finterfaces as $interface) {
+ $ntpcfg .= "interface listen {$interface}\n";
}
}
OpenPOWER on IntegriCloud