diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-02-17 19:48:49 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-02-17 19:48:49 +0000 |
commit | 9603bf53d2985763add8f761b946fc0c249fb336 (patch) | |
tree | b2d98f337e94262b1839f8965cce4cb801d3dc87 | |
parent | 2b451a9782c717a2a2053bd7ef981fb70473e6d9 (diff) | |
download | pfsense-9603bf53d2985763add8f761b946fc0c249fb336.zip pfsense-9603bf53d2985763add8f761b946fc0c249fb336.tar.gz |
If the check for 3 octets failed, check the 1st two octets.
This is a complete hack but since we are so close to release we don't have much room to play here.
-rw-r--r-- | etc/inc/pfsense-utils.inc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 9b6e65d..d1b9dbd 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -508,12 +508,20 @@ function guess_interface_from_ip($ipaddress) { $ints_split = split(" ", $ints); $ip_subnet_split = split("\.", $ipaddress); $ip_subnet = $ip_subnet_split[0] . "." . $ip_subnet_split[1] . "." . $ip_subnet_split[2] . "."; + /* check first 3 octets */ foreach($ints_split as $int) { $ip = find_interface_ip($int); $ip_split = split("\.", $ip); $ip_tocheck = $ip_split[0] . "." . $ip_split[1] . "." . $ip_split[2] . "."; if(stristr($ip_tocheck, $ip_subnet) != false) return $int; } + /* check first 2 octets since nothing found while checking 3 */ + foreach($ints_split as $int) { + $ip = find_interface_ip($int); + $ip_split = split("\.", $ip); + $ip_tocheck = $ip_split[0] . "." . $ip_split[1] . "."; + if(stristr($ip_tocheck, $ip_subnet) != false) return $int; + } } function filter_opt_interface_to_real($opt) { |