diff options
author | Ermal <eri@pfsense.org> | 2013-08-16 10:33:31 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-08-16 10:33:31 +0000 |
commit | 55909a9adf442534361c350387b7cd06b3641ae2 (patch) | |
tree | 41653ea88c3adf2b396cd8843096f3b0c765accf /etc | |
parent | 8b22629028281843208457e31473f212ed7b41a7 (diff) | |
download | pfsense-55909a9adf442534361c350387b7cd06b3641ae2.zip pfsense-55909a9adf442534361c350387b7cd06b3641ae2.tar.gz |
Handle link local addresses with embedded interface scope on is_ipaddrv6 and also on dnsmasq which is not yet there for these addresses
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/interfaces.inc | 2 | ||||
-rw-r--r-- | etc/inc/services.inc | 12 | ||||
-rw-r--r-- | etc/inc/util.inc | 4 |
3 files changed, 17 insertions, 1 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 4b5132f..bcfe3f9 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -3137,6 +3137,8 @@ function interface_track6_configure($interface = "lan", $wancfg) { $linklocal = find_interface_ipv6_ll($realif); if (!empty($linklocal)) mwexec("/sbin/ifconfig {$realif} inet6 {$linklocal} delete"); + /* XXX: This might break for good on a carp installation using link-local as network ips */ + /* XXX: Probably should remove? */ mwexec("/sbin/ifconfig {$realif} inet6 fe80::1:1%{$realif}"); $trackcfg = $config['interfaces'][$wancfg['track6-interface']]; diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 80408ac..7f598e4 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -1648,8 +1648,18 @@ function services_dnsmasq_configure() { if(isset($config['dnsmasq']['interface'])) { $interfaces = explode(",", $config['dnsmasq']['interface']); foreach ($interfaces as $interface) { - if (is_ipaddr($interface)) { + if (is_ipaddrv4($interface)) { $listen_addresses .= " --listen-address={$interface} "; + } else if (is_ipaddrv6($interface)) { + /* + * XXX: Since dnsmasq does not support link-local address + * with scope specified. These checks are being done. + */ + if (is_linklocal($interface) && strstr($interface, "%")) { + $tmpaddrll6 = explode("%", $interface); + $listen_addresses .= " --listen-address={$tmpaddrll6[0]} "; + } else + $listen_addresses .= " --listen-address={$interface} "; } else { $if = get_real_interface($interface); if (does_interface_exist($if)) { diff --git a/etc/inc/util.inc b/etc/inc/util.inc index dac29a4..27613f8 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -477,6 +477,10 @@ function is_ipaddr($ipaddr) { function is_ipaddrv6($ipaddr) { if (!is_string($ipaddr) || empty($ipaddr)) return false; + if (strstr($ipaddr, "%") && is_linklocal($ipaddr)) { + $tmpip = explode("%", $ipaddr); + $ipaddr = $tmpip[0]; + } return Net_IPv6::checkIPv6($ipaddr); } |