Skip local hosts

This commit is contained in:
Daniel Berteaud 2015-03-20 09:24:36 +01:00
parent d2fa0188a7
commit 05fab71013
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
{
use esmith::NetworksDB;
my $n = esmith::NetworksDB->open_ro() || die "couldn't open networks DB\n";
my @local = ();
foreach my $net ($n->networks){
my $key = $net->key;
my $mask = $net->prop('Mask');
my $prefix = esmith::util::computeLocalNetworkPrefix($key,$mask);
$prefix =~ s/\./\\./g;
$prefix = 'REGEX[^' . $prefix . ']';
push @local, $prefix;
}
$OUT .= 'SkipHosts="' . join(' ', @local) . '"';
}