diff options
author | Ermal Luçi <eri@pfsense.org> | 2009-12-08 15:53:45 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2009-12-08 15:53:45 +0000 |
commit | 6b31f539a0fa36ffcfde8133fee89368b3a40707 (patch) | |
tree | 459ff8639e4d14b7a6e8e3717a88b7379fca1bbb /etc/inc/util.inc | |
parent | 1cf931f6d5ec055a614a6129f538c130018055f4 (diff) | |
download | pfsense-6b31f539a0fa36ffcfde8133fee89368b3a40707.zip pfsense-6b31f539a0fa36ffcfde8133fee89368b3a40707.tar.gz |
Allow specifying services/ports in firewall rules or nat rules by their /etc/services name.
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r-- | etc/inc/util.inc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 156e4f4..4f084ee 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -300,6 +300,8 @@ function is_validaliasname($name) { /* returns true if $port is a valid TCP/UDP port */ function is_port($port) { + if (getservbyname($port, "tcp") || getservbyname($port, "udp")) + return true; if ((intval($port) < 1) || (intval($port) > 65535)) return false; else |