diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-05-09 08:03:45 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-05-09 08:05:13 -0300 |
commit | db7a628c0f3bfefc2792908f1646fcb604eedd5c (patch) | |
tree | 440e5cd682b137ca8b912650ec7f01aea44b73dc /etc/inc | |
parent | 19341491e34d2f003284cb7df03cad920116d196 (diff) | |
download | pfsense-db7a628c0f3bfefc2792908f1646fcb604eedd5c.zip pfsense-db7a628c0f3bfefc2792908f1646fcb604eedd5c.tar.gz |
Replace all linklocal checks by is_linklocal()
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/gwlb.inc | 2 | ||||
-rw-r--r-- | etc/inc/interfaces.inc | 6 | ||||
-rw-r--r-- | etc/inc/system.inc | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 5864733..e703893 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -165,7 +165,7 @@ EOD; continue; //Skip this target } else if (is_ipaddrv6($gateway['gateway'])) { /* link locals really need a different src ip */ - if(preg_match("/fe80:/i", $gateway['gateway'])) { + if(is_linklocal($gateway['gateway'])) { $linklocal = explode("%", find_interface_ipv6_ll($gateway['interface'], true)); $gwifip = $linklocal[0]; $ifscope = "%". $linklocal[1]; diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 566d301..81a1d5f 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -4281,7 +4281,7 @@ function find_interface_ipv6($interface, $flush = false) { foreach($output as $line) { if(preg_match("/inet6/", $line)) { $parts = explode(" ", $line); - if(! preg_match("/fe80:/i", $parts[1])) { + if(!is_linklocal($parts[1])) { $ifinfo['ipaddrv6'] = $parts[1]; if($parts[2] == "-->") { $parts[5] = "126"; @@ -4320,7 +4320,7 @@ function find_interface_ipv6_ll($interface, $flush = false) { foreach($output as $line) { if(preg_match("/inet6/", $line)) { $parts = explode(" ", $line); - if(preg_match("/fe80:/i", $parts[1])) { + if(is_linklocal($parts[1])) { $partsaddress = explode("%", $parts[1]); $ifinfo['linklocal'] = $partsaddress[0]; } @@ -4366,7 +4366,7 @@ function find_interface_subnetv6($interface, $flush = false) { $line = trim($line); if(preg_match("/inet6/", $line)) { $parts = explode(" ", $line); - if(! preg_match("/fe80:/i", $parts[1])) { + if(!is_linklocal($parts[1])) { $ifinfo['ipaddrv6'] = $parts[1]; if($parts[2] == "-->") { $parts[5] = "126"; diff --git a/etc/inc/system.inc b/etc/inc/system.inc index a214a7f..f6b472e 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -440,7 +440,7 @@ function system_routing_configure($interface = "") { ; else if (($interfacegwv6 <> "bgpd") && (is_ipaddrv6($gatewayipv6))) { $ifscope = ""; - if(preg_match("/fe80:/i", $gatewayipv6)) + if(is_linklocal($gatewayipv6)) $ifscope = "%{$defaultifv6}"; log_error("ROUTING: setting IPv6 default route to {$gatewayipv6}{$ifscope}"); mwexec("/sbin/route change -inet6 default " . escapeshellarg($gatewayipv6) ."{$ifscope}"); |