Revision b5fcc2b5
Added by Chris Buechler over 9 years ago
src/etc/inc/services.inc | ||
---|---|---|
1240 | 1240 |
sleep(1); |
1241 | 1241 |
} |
1242 | 1242 |
|
1243 |
/* |
|
1244 |
* We add a fake entry for interfaces that are set to track6 |
|
1245 |
* another WAN unless DHCP has been configured |
|
1246 |
*/ |
|
1247 |
foreach ($Iflist as $ifname) { |
|
1248 |
/* Do not put in the config an interface which is down */ |
|
1249 |
if (isset($blacklist[$ifname])) { |
|
1250 |
continue; |
|
1251 |
} |
|
1252 |
if (!empty($config['interfaces'][$ifname]['track6-interface']) && isset($dhcpdv6cfg[$ifname]['enable'])) { |
|
1253 |
$realif = get_real_interface($ifname, "inet6"); |
|
1254 |
$ifcfgipv6 = get_interface_ipv6($ifname); |
|
1255 |
if (!is_ipaddrv6($ifcfgipv6)) { |
|
1256 |
continue; |
|
1257 |
} |
|
1258 |
$ifcfgipv6 = Net_IPv6::getNetmask($ifcfgipv6, 64); |
|
1259 |
$trackifname = $config['interfaces'][$ifname]['track6-interface']; |
|
1260 |
$trackcfg = $config['interfaces'][$trackifname]; |
|
1261 |
$pdlen = calculate_ipv6_delegation_length($trackifname); |
|
1262 |
$ifcfgipv6arr =explode(":", $ifcfgipv6); |
|
1263 |
$dhcpdv6cfg[$ifname] = array(); |
|
1264 |
$dhcpdv6cfg[$ifname]['enable'] = true; |
|
1265 |
/* range */ |
|
1266 |
$ifcfgipv6arr[7] = "1000"; |
|
1267 |
$dhcpdv6cfg[$ifname]['range'] = array(); |
|
1268 |
$dhcpdv6cfg[$ifname]['range']['from'] = Net_IPv6::compress(implode(":", $ifcfgipv6arr)); |
|
1269 |
$ifcfgipv6arr[7] = "2000"; |
|
1270 |
$dhcpdv6cfg[$ifname]['range']['to'] = Net_IPv6::compress(implode(":", $ifcfgipv6arr)); |
|
1271 |
/* prefix length > 0? We can add dhcp6 prefix delegation server */ |
|
1272 |
if ($pdlen > 2) { |
|
1273 |
$pdlenmax = $pdlen; |
|
1274 |
$pdlenhalf = $pdlenmax -1; |
|
1275 |
$pdlenmin = (64 - ceil($pdlenhalf / 4)); |
|
1276 |
$dhcpdv6cfg[$ifname]['prefixrange'] = array(); |
|
1277 |
$dhcpdv6cfg[$ifname]['prefixrange']['prefixlength'] = $pdlenmin; |
|
1278 |
|
|
1279 |
/* set the delegation start to half the current address block */ |
|
1280 |
$range = Net_IPv6::parseAddress($ifcfgipv6, (64 - $pdlenmax)); |
|
1281 |
$range['start'] = Net_IPv6::getNetmask($range['end'], (64 - $pdlenhalf)); |
|
1282 |
|
|
1283 |
/* set the end range to a multiple of the prefix delegation size, required by dhcpd */ |
|
1284 |
$range = Net_IPv6::parseAddress($range['end'], (64 - $pdlenhalf)); |
|
1285 |
$range['end'] = Net_IPv6::getNetmask($range['end'], (64 - round($pdlen / 2))); |
|
1286 |
|
|
1287 |
$dhcpdv6cfg[$ifname]['prefixrange']['from'] = Net_IPv6::compress($range['start']); |
|
1288 |
$dhcpdv6cfg[$ifname]['prefixrange']['to'] = Net_IPv6::compress($range['end']); |
|
1289 |
} |
|
1290 |
$dhcpdv6cfg[$ifname]['dns6ip'] = get_interface_ipv6($ifname); |
|
1291 |
} |
|
1292 |
} |
|
1293 |
|
|
1294 | 1243 |
$custoptionsv6 = ""; |
1295 | 1244 |
foreach ($dhcpdv6cfg as $dhcpv6if => $dhcpv6ifconf) { |
1296 | 1245 |
if (is_array($dhcpv6ifconf['numberoptions']) && is_array($dhcpv6ifconf['numberoptions']['item'])) { |
Also available in: Unified diff
Remove the code block to "fake" DHCPv6 server, now that it's unnecessary. Ticket #3029
also ref: https://forum.pfsense.org/index.php?topic=107537.msg600111#msg600111