summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-06-17 08:59:43 +0000
committerErmal <eri@pfsense.org>2013-06-17 09:00:57 +0000
commit1005484304a823b491f0111471f5d9a13bf83835 (patch)
tree2a3cc647cea634064d637afc3d9b4a784632c0cf /etc/inc
parentf960f9dd20580ea8da5e732b6e54a13b84d6286d (diff)
downloadpfsense-1005484304a823b491f0111471f5d9a13bf83835.zip
pfsense-1005484304a823b491f0111471f5d9a13bf83835.tar.gz
* Use when needed the family for get_real_interface
* During dhcp setup use -n for cp to avoid coping uselessly
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/interfaces.inc25
-rw-r--r--etc/inc/services.inc10
2 files changed, 17 insertions, 18 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index d10b3b0..29ac9e6 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -3415,7 +3415,7 @@ function interface_dhcpv6_configure($interface = "wan", $wancfg) {
if (!is_array($wancfg))
return;
- $wanif = get_real_interface($interface);
+ $wanif = get_real_interface($interface, "inet6");
$dhcp6cconf = "";
$dhcp6cconf .= "interface {$wanif} {\n";
@@ -4446,7 +4446,8 @@ function get_interface_ipv6($interface = "wan", $flush = false) {
}
function get_interface_linklocal($interface = "wan") {
- $realif = get_failover_interface($interface);
+
+ $realif = get_failover_interface($interface, "inet6");
if (!$realif) {
if (preg_match("/^carp/i", $interface))
$realif = $interface;
@@ -4844,26 +4845,24 @@ function interfaces_staticarp_configure($if) {
function get_failover_interface($interface, $family = "all") {
global $config;
+
/* shortcut to get_real_interface if we find it in the config */
- if(is_array($config['interfaces'][$interface])) {
- $wanif = get_real_interface($interface, $family);
- return $wanif;
+ if (is_array($config['interfaces'][$interface])) {
+ return get_real_interface($interface, $family);
}
/* compare against gateway groups */
$a_groups = return_gateway_groups_array();
- if(is_array($a_groups[$interface])) {
+ if (is_array($a_groups[$interface])) {
/* we found a gateway group, fetch the interface or vip */
- if($a_groups[$interface][0]['vip'] <> "")
- $wanif = $a_groups[$interface][0]['vip'];
+ if ($a_groups[$interface][0]['vip'] <> "")
+ return $a_groups[$interface][0]['vip'];
else
- $wanif = $a_groups[$interface][0]['int'];
-
- return $wanif;
+ return $a_groups[$interface][0]['int'];
}
/* fall through to get_real_interface */
- $wanif = get_real_interface($interface, $family);
- return $wanif;
+ /* XXX: Really needed? */
+ return get_real_interface($interface, $family);
}
function remove_ifindex($ifname) {
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index 327cde4..49a05fe 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -92,7 +92,7 @@ function services_radvd_configure() {
}
}
- $realif = get_real_interface($dhcpv6if);
+ $realif = get_real_interface($dhcpv6if, "inet6");
if (isset($radvdifs[$realif]))
continue;
@@ -215,7 +215,7 @@ function services_radvd_configure() {
if (empty($config['interfaces'][$trackif]))
continue;
- $realif = get_real_interface($if);
+ $realif = get_real_interface($if, "inet6");
/* prevent duplicate entries, manual overrides */
if (isset($radvdifs[$realif]))
continue;
@@ -311,8 +311,8 @@ function services_dhcpd_configure($family = "all") {
fwrite($fd, "/bin/mkdir -p {$g['dhcpd_chroot_path']}/lib\n");
fwrite($fd, "/bin/mkdir -p {$g['dhcpd_chroot_path']}/run\n");
fwrite($fd, "/usr/sbin/chown -R dhcpd:_dhcp {$g['dhcpd_chroot_path']}/*\n");
- fwrite($fd, "/bin/cp /lib/libc.so.* {$g['dhcpd_chroot_path']}/lib/\n");
- fwrite($fd, "/bin/cp /usr/local/sbin/dhcpd {$g['dhcpd_chroot_path']}/usr/local/sbin/\n");
+ fwrite($fd, "/bin/cp -n /lib/libc.so.* {$g['dhcpd_chroot_path']}/lib/\n");
+ fwrite($fd, "/bin/cp -n /usr/local/sbin/dhcpd {$g['dhcpd_chroot_path']}/usr/local/sbin/\n");
fwrite($fd, "/bin/chmod a+rx {$g['dhcpd_chroot_path']}/usr/local/sbin/dhcpd\n");
$status = `/sbin/mount | /usr/bin/grep -v grep | /usr/bin/grep "{$g['dhcpd_chroot_path']}/dev"`;
@@ -951,7 +951,7 @@ function services_dhcpdv6_configure() {
/* we add a fake entry for interfaces that are set to track6 another WAN */
foreach ($Iflist as $ifname) {
if (!empty($config['interfaces'][$ifname]['track6-interface'])) {
- $realif = get_real_interface($ifname);
+ $realif = get_real_interface($ifname, "inet6");
$ifcfgipv6 = get_interface_ipv6($ifname);
if(!is_ipaddrv6($ifcfgipv6))
continue;
OpenPOWER on IntegriCloud