diff options
author | jim-p <jimp@pfsense.org> | 2017-03-24 13:58:55 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2017-03-24 13:58:55 -0400 |
commit | dd844c430622fa68de1f868b62ec375d7131ce16 (patch) | |
tree | e487fe043a85858639e28729a3ccc05d24d71eb3 /src/etc | |
parent | 52a3580a200c9f37f33c2985852e68fc65f3266a (diff) | |
download | pfsense-dd844c430622fa68de1f868b62ec375d7131ce16.zip pfsense-dd844c430622fa68de1f868b62ec375d7131ce16.tar.gz |
Fix handling of port ranges in this validation test. Ticket #7421
Diffstat (limited to 'src/etc')
-rw-r--r-- | src/etc/inc/filter.inc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/etc/inc/filter.inc b/src/etc/inc/filter.inc index 1d07495..c2e2a25 100644 --- a/src/etc/inc/filter.inc +++ b/src/etc/inc/filter.inc @@ -2700,12 +2700,16 @@ function filter_generate_user_rule($rule) { file_notice("Filter_Reload", $error_text); return "# {$error_text}"; } - if ($rule['source']['port'] && !alias_expand($rule['source']['port'])) { + if ($rule['source']['port'] + && !(is_portrange(str_replace("-", ":", $rule['source']['port'])) + || alias_expand($rule['source']['port']))) { $error_text = sprintf(gettext("Unresolvable source port alias '%1\$s' for rule '%2\$s'"), $rule['source']['port'], $rule['descr']); file_notice("Filter_Reload", $error_text); return "# {$error_text}"; } - if ($rule['destination']['port'] && !alias_expand($rule['destination']['port'])) { + if ($rule['destination']['port'] + && !(is_portrange(str_replace("-", ":", $rule['destination']['port'])) + || alias_expand($rule['destination']['port']))) { $error_text = sprintf(gettext("Unresolvable destination port alias '%1\$s' for rule '%2\$s'"), $rule['destination']['port'], $rule['descr']); file_notice("Filter_Reload", $error_text); return "# {$error_text}"; |