forked from extern/shorewall_code
Fix a couple of defects in module loading
This commit is contained in:
parent
1a3794e7b0
commit
edf614bf4b
@ -2168,12 +2168,16 @@ sub load_kernel_modules( ) {
|
|||||||
my $uname = `uname -r`;
|
my $uname = `uname -r`;
|
||||||
fatal_error "The command 'uname -r' failed" unless $? == 0;
|
fatal_error "The command 'uname -r' failed" unless $? == 0;
|
||||||
chomp $uname;
|
chomp $uname;
|
||||||
$modulesdir = "/lib/modules/$uname/kernel/net/ipv4/netfilter:/lib/modules/$uname/kernel/net/netfilter:/lib/modules/$uname/extra:/lib/modules/$uname/extra/ipset";
|
$modulesdir = "/lib/modules/$uname/kernel/net/ipv4/netfilter:/lib/modules/$uname/kernel/net/ipv6/netfilter:/lib/modules/$uname/kernel/net/netfilter:/lib/modules/$uname/extra:/lib/modules/$uname/extra/ipset";
|
||||||
}
|
}
|
||||||
|
|
||||||
my @moduledirectories = split /:/, $modulesdir;
|
my @moduledirectories;
|
||||||
|
|
||||||
if ( $moduleloader && open_file( $config{LOAD_HELPERS_ONLY} ? 'helpers' : 'modules' ) ) {
|
for ( split /:/, $modulesdir ) {
|
||||||
|
push @moduledirectories, $_ if -d $_;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $moduleloader && @moduledirectories && open_file( $config{LOAD_HELPERS_ONLY} ? 'helpers' : 'modules' ) ) {
|
||||||
my %loadedmodules;
|
my %loadedmodules;
|
||||||
|
|
||||||
$loadedmodules{$_}++ for split_list( $config{DONT_LOAD}, 'module' );
|
$loadedmodules{$_}++ for split_list( $config{DONT_LOAD}, 'module' );
|
||||||
@ -2206,7 +2210,7 @@ sub load_kernel_modules( ) {
|
|||||||
} else {
|
} else {
|
||||||
system( "modprobe $module $arguments" );
|
system( "modprobe $module $arguments" );
|
||||||
}
|
}
|
||||||
|
|
||||||
$loadedmodules{ $module } = 1;
|
$loadedmodules{ $module } = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user