Revision 06886ae3
Added by Ermal LUÇI about 12 years ago
- Use when needed the family for get_real_interface
- During dhcp setup use -n for cp to avoid coping uselessly
etc/inc/interfaces.inc | ||
---|---|---|
3415 | 3415 |
if (!is_array($wancfg)) |
3416 | 3416 |
return; |
3417 | 3417 |
|
3418 |
$wanif = get_real_interface($interface); |
|
3418 |
$wanif = get_real_interface($interface, "inet6");
|
|
3419 | 3419 |
$dhcp6cconf = ""; |
3420 | 3420 |
$dhcp6cconf .= "interface {$wanif} {\n"; |
3421 | 3421 |
|
... | ... | |
4446 | 4446 |
} |
4447 | 4447 |
|
4448 | 4448 |
function get_interface_linklocal($interface = "wan") { |
4449 |
$realif = get_failover_interface($interface); |
|
4449 |
|
|
4450 |
$realif = get_failover_interface($interface, "inet6"); |
|
4450 | 4451 |
if (!$realif) { |
4451 | 4452 |
if (preg_match("/^carp/i", $interface)) |
4452 | 4453 |
$realif = $interface; |
... | ... | |
4844 | 4845 |
|
4845 | 4846 |
function get_failover_interface($interface, $family = "all") { |
4846 | 4847 |
global $config; |
4848 |
|
|
4847 | 4849 |
/* shortcut to get_real_interface if we find it in the config */ |
4848 |
if(is_array($config['interfaces'][$interface])) { |
|
4849 |
$wanif = get_real_interface($interface, $family); |
|
4850 |
return $wanif; |
|
4850 |
if (is_array($config['interfaces'][$interface])) { |
|
4851 |
return get_real_interface($interface, $family); |
|
4851 | 4852 |
} |
4852 | 4853 |
|
4853 | 4854 |
/* compare against gateway groups */ |
4854 | 4855 |
$a_groups = return_gateway_groups_array(); |
4855 |
if(is_array($a_groups[$interface])) { |
|
4856 |
if (is_array($a_groups[$interface])) {
|
|
4856 | 4857 |
/* we found a gateway group, fetch the interface or vip */ |
4857 |
if($a_groups[$interface][0]['vip'] <> "") |
|
4858 |
$wanif = $a_groups[$interface][0]['vip'];
|
|
4858 |
if ($a_groups[$interface][0]['vip'] <> "")
|
|
4859 |
return $a_groups[$interface][0]['vip'];
|
|
4859 | 4860 |
else |
4860 |
$wanif = $a_groups[$interface][0]['int']; |
|
4861 |
|
|
4862 |
return $wanif; |
|
4861 |
return $a_groups[$interface][0]['int']; |
|
4863 | 4862 |
} |
4864 | 4863 |
/* fall through to get_real_interface */ |
4865 |
$wanif = get_real_interface($interface, $family);
|
|
4866 |
return $wanif;
|
|
4864 |
/* XXX: Really needed? */
|
|
4865 |
return get_real_interface($interface, $family);
|
|
4867 | 4866 |
} |
4868 | 4867 |
|
4869 | 4868 |
function remove_ifindex($ifname) { |
etc/inc/services.inc | ||
---|---|---|
92 | 92 |
} |
93 | 93 |
} |
94 | 94 |
|
95 |
$realif = get_real_interface($dhcpv6if); |
|
95 |
$realif = get_real_interface($dhcpv6if, "inet6");
|
|
96 | 96 |
if (isset($radvdifs[$realif])) |
97 | 97 |
continue; |
98 | 98 |
|
... | ... | |
215 | 215 |
if (empty($config['interfaces'][$trackif])) |
216 | 216 |
continue; |
217 | 217 |
|
218 |
$realif = get_real_interface($if); |
|
218 |
$realif = get_real_interface($if, "inet6");
|
|
219 | 219 |
/* prevent duplicate entries, manual overrides */ |
220 | 220 |
if (isset($radvdifs[$realif])) |
221 | 221 |
continue; |
... | ... | |
311 | 311 |
fwrite($fd, "/bin/mkdir -p {$g['dhcpd_chroot_path']}/lib\n"); |
312 | 312 |
fwrite($fd, "/bin/mkdir -p {$g['dhcpd_chroot_path']}/run\n"); |
313 | 313 |
fwrite($fd, "/usr/sbin/chown -R dhcpd:_dhcp {$g['dhcpd_chroot_path']}/*\n"); |
314 |
fwrite($fd, "/bin/cp /lib/libc.so.* {$g['dhcpd_chroot_path']}/lib/\n"); |
|
315 |
fwrite($fd, "/bin/cp /usr/local/sbin/dhcpd {$g['dhcpd_chroot_path']}/usr/local/sbin/\n"); |
|
314 |
fwrite($fd, "/bin/cp -n /lib/libc.so.* {$g['dhcpd_chroot_path']}/lib/\n");
|
|
315 |
fwrite($fd, "/bin/cp -n /usr/local/sbin/dhcpd {$g['dhcpd_chroot_path']}/usr/local/sbin/\n");
|
|
316 | 316 |
fwrite($fd, "/bin/chmod a+rx {$g['dhcpd_chroot_path']}/usr/local/sbin/dhcpd\n"); |
317 | 317 |
|
318 | 318 |
$status = `/sbin/mount | /usr/bin/grep -v grep | /usr/bin/grep "{$g['dhcpd_chroot_path']}/dev"`; |
... | ... | |
951 | 951 |
/* we add a fake entry for interfaces that are set to track6 another WAN */ |
952 | 952 |
foreach ($Iflist as $ifname) { |
953 | 953 |
if (!empty($config['interfaces'][$ifname]['track6-interface'])) { |
954 |
$realif = get_real_interface($ifname); |
|
954 |
$realif = get_real_interface($ifname, "inet6");
|
|
955 | 955 |
$ifcfgipv6 = get_interface_ipv6($ifname); |
956 | 956 |
if(!is_ipaddrv6($ifcfgipv6)) |
957 | 957 |
continue; |
Also available in: Unified diff