Fix detection of HASHLIMIT_MATCH on old kernels.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-01-27 12:53:31 -08:00
parent be117f6638
commit 9d25318d80

View File

@ -2199,11 +2199,11 @@ sub Comments() {
} }
sub Hashlimit_Match() { sub Hashlimit_Match() {
qt1( "$iptables -A $sillyname -m hashlimit --hashlimit-upto 3/min --hashlimit-burst 3 --hashlimit-name $sillyname --hashlimit-mode srcip -j ACCEPT" ); have_capability 'OLD_HL_MATCH' || qt1( "$iptables -A $sillyname -m hashlimit --hashlimit-upto 3/min --hashlimit-burst 3 --hashlimit-name $sillyname --hashlimit-mode srcip -j ACCEPT" );
} }
sub Old_Hashlimit_Match() { sub Old_Hashlimit_Match() {
have_capability 'HASHLIMIT_MATCH' && qt1( "$iptables -A $sillyname -m hashlimit --hashlimit 3/min --hashlimit-burst 3 --hashlimit-name $sillyname --hashlimit-mode srcip -j ACCEPT" ); have_capability qt1( "$iptables -A $sillyname -m hashlimit --hashlimit 3/min --hashlimit-burst 3 --hashlimit-name $sillyname --hashlimit-mode srcip -j ACCEPT" );
} }
sub Mark() { sub Mark() {
@ -2417,8 +2417,8 @@ sub determine_capabilities( $ ) {
$capabilities{LENGTH_MATCH} = Length_Match; $capabilities{LENGTH_MATCH} = Length_Match;
$capabilities{ENHANCED_REJECT} = Enhanced_Reject; $capabilities{ENHANCED_REJECT} = Enhanced_Reject;
$capabilities{COMMENTS} = Comments; $capabilities{COMMENTS} = Comments;
$capabilities{HASHLIMIT_MATCH} = Hashlimit_Match;
$capabilities{OLD_HL_MATCH} = Old_Hashlimit_Match; $capabilities{OLD_HL_MATCH} = Old_Hashlimit_Match;
$capabilities{HASHLIMIT_MATCH} = Hashlimit_Match;
$capabilities{MARK} = Mark; $capabilities{MARK} = Mark;
$capabilities{XMARK} = Xmark; $capabilities{XMARK} = Xmark;
$capabilities{EXMARK} = Exmark; $capabilities{EXMARK} = Exmark;