Correctly handle single IP in IgnoreIP prop

tags/0.1.7_el6 0.1.7_el6
Daniel Berteaud 11 years ago
parent 42b940281f
commit 1db538bbd0
  1. 4
      root/etc/e-smith/templates/etc/fail2ban/jail.conf/05IgnoreIP

@ -25,7 +25,9 @@ unless (($fail2ban{FilterLocalNetworks} || 'disabled') eq 'enabled'){
# Add a local whitelist # Add a local whitelist
foreach (split /[,;]/, ($fail2ban{'IgnoreIP'} || '')){ foreach (split /[,;]/, ($fail2ban{'IgnoreIP'} || '')){
my ($ip,$bits) = Net::IPv4Addr::ipv4_parse("$_"); my $addr = $_;
$addr .= '/32' unless ($addr =~ m/\/\d{1,2}$/);
my ($ip,$bits) = Net::IPv4Addr::ipv4_parse("$addr");
push @ip, "$ip/$bits"; push @ip, "$ip/$bits";
} }

Loading…
Cancel
Save