Révision 2bf2a1c4
Ajouté par Renato Botelho il y a presque 10 ans
etc/inc/interfaces.inc | ||
---|---|---|
1241 | 1241 |
unlink_if_exists("{$g['varetc_path']}/dhclient_{$interface}.conf"); |
1242 | 1242 |
if(does_interface_exist("$realif")) { |
1243 | 1243 |
mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " delete", true); |
1244 |
interface_ipalias_cleanup($interface);
|
|
1245 |
if ($destroy == true)
|
|
1244 |
if ($destroy == true) {
|
|
1245 |
interface_ipalias_cleanup($interface);
|
|
1246 | 1246 |
pfSense_interface_flags($realif, -IFF_UP); |
1247 |
} |
|
1247 | 1248 |
mwexec("/usr/sbin/arp -d -i " . escapeshellarg($realif) . " -a"); |
1248 | 1249 |
} |
1249 | 1250 |
break; |
1250 | 1251 |
default: |
1251 | 1252 |
if(does_interface_exist("$realif")) { |
1252 | 1253 |
mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " delete", true); |
1253 |
interface_ipalias_cleanup($interface);
|
|
1254 |
if ($destroy == true)
|
|
1254 |
if ($destroy == true) {
|
|
1255 |
interface_ipalias_cleanup($interface);
|
|
1255 | 1256 |
pfSense_interface_flags($realif, -IFF_UP); |
1257 |
} |
|
1256 | 1258 |
mwexec("/usr/sbin/arp -d -i " . escapeshellarg($realif) . " -a"); |
1257 | 1259 |
} |
1258 | 1260 |
break; |
... | ... | |
1271 | 1273 |
$ip6 = find_interface_ipv6($realifv6); |
1272 | 1274 |
if (is_ipaddrv6($ip6) && $ip6 != "::") |
1273 | 1275 |
mwexec("/sbin/ifconfig " . escapeshellarg($realifv6) . " inet6 {$ip6} delete", true); |
1274 |
interface_ipalias_cleanup($interface, "inet6");
|
|
1275 |
if ($destroy == true)
|
|
1276 |
if ($destroy == true) {
|
|
1277 |
interface_ipalias_cleanup($interface, "inet6");
|
|
1276 | 1278 |
pfSense_interface_flags($realif, -IFF_UP); |
1279 |
} |
|
1277 | 1280 |
mwexec("/usr/sbin/arp -d -i " . escapeshellarg($realif) . " -a"); |
1278 | 1281 |
} |
1279 | 1282 |
$track6 = link_interface_to_track6($interface); |
... | ... | |
1285 | 1288 |
$ip6 = get_interface_ipv6($interface); |
1286 | 1289 |
if (is_ipaddrv6($ip6)) |
1287 | 1290 |
mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " inet6 {$ip6} delete", true); |
1288 |
interface_ipalias_cleanup($interface, "inet6");
|
|
1289 |
if ($destroy == true)
|
|
1291 |
if ($destroy == true) {
|
|
1292 |
interface_ipalias_cleanup($interface, "inet6");
|
|
1290 | 1293 |
pfSense_interface_flags($realif, -IFF_UP); |
1294 |
} |
|
1291 | 1295 |
} |
1292 | 1296 |
$track6 = link_interface_to_track6($interface); |
1293 | 1297 |
break; |
... | ... | |
1298 | 1302 |
mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " inet6 {$ip6} delete", true); |
1299 | 1303 |
if (!empty($ifcfg['ipaddrv6']) && is_ipaddrv6($ifcfg['ipaddrv6'])) |
1300 | 1304 |
mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " inet6 {$ifcfg['ipaddrv6']} delete", true); |
1301 |
interface_ipalias_cleanup($interface, "inet6");
|
|
1302 |
if ($destroy == true)
|
|
1305 |
if ($destroy == true) {
|
|
1306 |
interface_ipalias_cleanup($interface, "inet6");
|
|
1303 | 1307 |
pfSense_interface_flags($realif, -IFF_UP); |
1308 |
} |
|
1304 | 1309 |
mwexec("/usr/sbin/arp -d -i " . escapeshellarg($realif) . " -a"); |
1305 | 1310 |
} |
1306 | 1311 |
$track6 = link_interface_to_track6($interface); |
... | ... | |
2104 | 2109 |
if ($vip['mode'] != "ipalias") |
2105 | 2110 |
return; |
2106 | 2111 |
|
2107 |
if ($vip['interface'] != 'lo0' && !isset($config['interfaces'][$vip['interface']])) |
|
2108 |
return; |
|
2112 |
$if = get_real_interface($vip['interface']); |
|
2109 | 2113 |
|
2110 |
if ($vip['interface'] != 'lo0' && !isset($config['interfaces'][$vip['interface']]['enable'])) |
|
2111 |
return; |
|
2114 |
if ($vip['interface'] != 'lo0' && stristr($if, "_vip") === false) { |
|
2115 |
if (!isset($config['interfaces'][$vip['interface']])) |
|
2116 |
return; |
|
2117 |
|
|
2118 |
if (!isset($config['interfaces'][$vip['interface']]['enable'])) |
|
2119 |
return; |
|
2120 |
} |
|
2112 | 2121 |
|
2113 |
$if = get_real_interface($vip['interface']); |
|
2114 | 2122 |
$af = "inet"; |
2115 | 2123 |
if(is_ipaddrv6($vip['subnet'])) |
2116 | 2124 |
$af = "inet6"; |
... | ... | |
2221 | 2229 |
|
2222 | 2230 |
interfaces_bring_up($vipif); |
2223 | 2231 |
|
2232 |
if (isset($config['virtualip']['vip']) && is_array($config['virtualip']['vip'])) { |
|
2233 |
foreach ($config['virtualip']['vip'] as &$vip_alias) { |
|
2234 |
if ($vip_alias['interface'] == $vipif) |
|
2235 |
interface_ipalias_configure($vip_alias); |
|
2236 |
} |
|
2237 |
} |
|
2238 |
|
|
2224 | 2239 |
return $vipif; |
2225 | 2240 |
} |
2226 | 2241 |
|
Formats disponibles : Unified diff
Fix a regression introduced on 8d6c5f6621 that broke CARP+IP alias