diff --git a/Shorewall/lib.common b/Shorewall/lib.common index 80bc0c9a7..007946bf5 100644 --- a/Shorewall/lib.common +++ b/Shorewall/lib.common @@ -226,26 +226,28 @@ loadmodule() # $1 = module name, $2 - * arguments local suffix if [ -d /sys/module/ ]; then - if [ ! -d /sys/module/$modulename ]; then - shift + if ! list_search $modulename $DONT_LOAD; then + if [ ! -d /sys/module/$modulename ]; then + shift - for suffix in $MODULE_SUFFIX ; do - for directory in $moduledirectories; do - modulefile=$directory/${modulename}.${suffix} + for suffix in $MODULE_SUFFIX ; do + for directory in $moduledirectories; do + modulefile=$directory/${modulename}.${suffix} - if [ -f $modulefile ]; then - case $moduleloader in - insmod) - insmod $modulefile $* - ;; - *) - modprobe $modulename $* - ;; - esac - break 2 - fi + if [ -f $modulefile ]; then + case $moduleloader in + insmod) + insmod $modulefile $* + ;; + *) + modprobe $modulename $* + ;; + esac + break 2 + fi + done done - done + fi fi elif ! list_search $modulename $DONT_LOAD $MODULES; then shift diff --git a/Shorewall6/lib.common b/Shorewall6/lib.common index 2c84d0f9a..b3f889ffc 100644 --- a/Shorewall6/lib.common +++ b/Shorewall6/lib.common @@ -248,26 +248,28 @@ loadmodule() # $1 = module name, $2 - * arguments local suffix if [ -d /sys/module/ ]; then - if [ ! -d /sys/module/$modulename ]; then - shift + if ! list_search $modulename $DONT_LOAD; then + if [ ! -d /sys/module/$modulename ]; then + shift - for suffix in $MODULE_SUFFIX ; do - for directory in $moduledirectories; do - modulefile=$directory/${modulename}.${suffix} + for suffix in $MODULE_SUFFIX ; do + for directory in $moduledirectories; do + modulefile=$directory/${modulename}.${suffix} - if [ -f $modulefile ]; then - case $moduleloader in - insmod) - insmod $modulefile $* - ;; - *) - modprobe $modulename $* - ;; - esac - break 2 - fi + if [ -f $modulefile ]; then + case $moduleloader in + insmod) + insmod $modulefile $* + ;; + *) + modprobe $modulename $* + ;; + esac + break 2 + fi + done done - done + fi fi elif ! list_search $modulename $MODULES $DONT_LOAD ; then shift