diff options
author | jim-p <jimp@pfsense.org> | 2013-04-09 11:15:51 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2013-04-09 11:17:16 -0400 |
commit | f3f7cef43ea7b22a5eec8128ff5674404cd9540f (patch) | |
tree | c2906a0f2051743f16435f3a73c1a21373f415f1 | |
parent | 014780f96c2553c4f22652bcab9617801c0b6385 (diff) | |
download | pfsense-f3f7cef43ea7b22a5eec8128ff5674404cd9540f.zip pfsense-f3f7cef43ea7b22a5eec8128ff5674404cd9540f.tar.gz |
Make sure we do not pass an IP address to ip_in_subnet as a subnet, it does not handle that well.
-rw-r--r-- | etc/inc/services.inc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 06a3579..8b8a6ff 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -1291,12 +1291,20 @@ function services_dhcrelay_configure() { array_shift($route_str); $route_arr = array(); foreach($route_str as $routeline) { - $items = preg_split("/[ ]+/i", $routeline); - if (ip_in_subnet($srvip, $items[0])) { + $items = preg_split("/[ ]+/i", $routeline); + if (is_subnetv4($items[0])) { + $subnet = $items[0]; + } elseif (is_ipaddrv4($items[0])) { + $subnet = "{$items[0]}/32"; + } else { + // Not a subnet or IP address, skip to the next line. + continue; + } + if (ip_in_subnet($srvip, $subnet)) { $destif = trim($items[6]); break; } - } + } } if (!isset($destif)) { |