diff options
author | Stig Thormodsrud <stig@io.vyatta.com> | 2008-12-20 13:55:39 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@io.vyatta.com> | 2008-12-20 13:55:39 -0800 |
commit | d9976a31c4e34a2787c2bc5212e6e8c49e95b442 (patch) | |
tree | edad56464ee9ff86135a2f009887cad2c2eb2e89 /lib | |
parent | c52d2bc0a80c31b9a7580ad019dff82f48f910ed (diff) | |
download | vyatta-cfg-d9976a31c4e34a2787c2bc5212e6e8c49e95b442.tar.gz vyatta-cfg-d9976a31c4e34a2787c2bc5212e6e8c49e95b442.zip |
Fix 3626: Not all protocol numbers are accepted in firewall rules.
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Vyatta/TypeChecker.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Vyatta/TypeChecker.pm b/lib/Vyatta/TypeChecker.pm index 124dc17..086fee7 100755 --- a/lib/Vyatta/TypeChecker.pm +++ b/lib/Vyatta/TypeChecker.pm @@ -124,6 +124,10 @@ sub validate_protocol { my $value = shift; $value = lc $value; return 1 if ($value eq 'all'); + if ($value =~ /^\d+$/) { + # 0 has special meaning to iptables + return 1 if $value >= 1 and $value <= 255; + } if (!open(IN, "</etc/protocols")) { print "can't open /etc/protocols"; return 0; |