diff options
author | David Wood <david@wood2.org.uk> | 2015-12-24 07:10:20 +0000 |
---|---|---|
committer | David Wood <david@wood2.org.uk> | 2016-01-06 02:23:54 +0000 |
commit | 918b19a62c602e19bbd53f47f4ba596ee8ee949c (patch) | |
tree | de0b6e0382eb1673ee27ece7e91f6d524e8d1d93 | |
parent | 682d280755ee7bd2140dca84b5ee21659a4ae580 (diff) | |
download | pfsense-918b19a62c602e19bbd53f47f4ba596ee8ee949c.zip pfsense-918b19a62c602e19bbd53f47f4ba596ee8ee949c.tar.gz |
Set temporary bogon (RFC 5737) IPv4 address to work round mpd5 IPv6CP issue causing random IPv6 interface identifier during boot
Details at https://forum.pfsense.org/index.php?topic=101967.msg570519#msg570519 .
-rw-r--r-- | etc/inc/interfaces.inc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index c1a1fd4..caefa85 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1818,6 +1818,19 @@ EOD; unlink("{$g['var_path']}/spool/lock/LCK..{$port}"); } + /* Set temporary bogon (RFC 5737) IPv4 address to work round mpd5 IPv6CP issue causing */ + /* random IPv6 interface identifier during boot. More details at */ + /* https://forum.pfsense.org/index.php?topic=101967.msg570519#msg570519 */ + /* N.B. The current work round only supports PPPoE */ + $tempaddr = false; + if (platform_booting() && $type == "pppoe" && is_array($ports) && !empty($ports[0])) { + $tempaddr = true; + $tempaddr_iface = get_real_interface($ports[0]); + if (!empty($tempaddr_iface)) { + mwexec("/sbin/ifconfig " . escapeshellarg($tempaddr_iface) . " inet 192.0.2.248/31 alias", true); + } + } + /* fire up mpd */ mwexec("/usr/local/sbin/mpd5 -b -k -d {$g['varetc_path']} -f mpd_{$interface}.conf -p {$g['varrun_path']}/" . escapeshellarg($ppp['type']) . "_{$interface}.pid -s ppp " . escapeshellarg($ppp['type']) . "client"); @@ -1838,6 +1851,13 @@ EOD; $i++; } + /* Remove work round temporary address */ + if ($tempaddr && !empty($tempaddr_iface)) { + mwexec("/sbin/ifconfig " . escapeshellarg($tempaddr_iface) . " inet 192.0.2.248/31 -alias", true); + unset ($tempaddr_iface); + } + unset ($tempaddr); + /* we only support the 3gstats.php for huawei modems for now. Will add more later. */ /* We should be able to launch the right version for each modem */ /* We can also guess the mondev from the manufacturer */ |