Use modprobe if available; more save fixes

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@1296 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2004-04-30 02:13:23 +00:00
parent 2d346adace
commit fecc7529c5
3 changed files with 27 additions and 9 deletions

View File

@ -31,3 +31,5 @@ Changes since 2.0.1
15) Add saved configuration support (iptables-save/iptables-restore 15) Add saved configuration support (iptables-save/iptables-restore
integration). integration).
16) Use modprobe if it is available.

View File

@ -1603,8 +1603,8 @@ setup_proxy_arp() {
echo 0 > /proc/sys/net/ipv4/conf/$external/proxy_arp echo 0 > /proc/sys/net/ipv4/conf/$external/proxy_arp
save_command arp -i $external -Ds $address $external pub save_command arp -i $external -Ds $address $external pub
eval save_command echo 1 '\>' /proc/sys/net/ipv4/conf/$interface/proxy_arp save_command "echo 1 > /proc/sys/net/ipv4/conf/$interface/proxy_arp"
eval save_command echo 0 '\>' /proc/sys/net/ipv4/conf/$external/proxy_arp save_command "echo 0 > /proc/sys/net/ipv4/conf/$external/proxy_arp"
echo $address $interface $external $haveroute >> ${STATEDIR}/proxyarp echo $address $interface $external $haveroute >> ${STATEDIR}/proxyarp
@ -1623,6 +1623,7 @@ setup_proxy_arp() {
for interface in $interfaces; do for interface in $interfaces; do
if echo 1 > /proc/sys/net/ipv4/conf/$interface/proxy_arp 2> /dev/null; then if echo 1 > /proc/sys/net/ipv4/conf/$interface/proxy_arp 2> /dev/null; then
progress_message " Enabled proxy ARP on $interface" progress_message " Enabled proxy ARP on $interface"
save_command "echo 1 > /proc/sys/net/ipv4/conf/$interface/proxy_arp"
else else
error_message "Warning: Unable to enable proxy ARP on $interface" error_message "Warning: Unable to enable proxy ARP on $interface"
fi fi
@ -3801,6 +3802,11 @@ loadmodule() # $1 = module name, $2 - * arguments
local modulename=$1 local modulename=$1
local modulefile local modulefile
local suffix local suffix
moduleloader=modprobe
if ! qt which modprobe; then
moduleloader=insmod
fi
if [ -z "$(lsmod | grep $modulename)" ]; then if [ -z "$(lsmod | grep $modulename)" ]; then
shift shift
@ -3809,7 +3815,15 @@ loadmodule() # $1 = module name, $2 - * arguments
modulefile=$MODULESDIR/${modulename}.${suffix} modulefile=$MODULESDIR/${modulename}.${suffix}
if [ -f $modulefile ]; then if [ -f $modulefile ]; then
insmod $modulefile $* case $moduleloader in
insmod)
insmod $modulefile $*
;;
*)
modprobe $modulename
;;
esac
return return
fi fi
done done

View File

@ -125,12 +125,14 @@ New Features:
characters; if a larger prefix is generated, Shorewall will issue a characters; if a larger prefix is generated, Shorewall will issue a
warning message and will truncate the prefix to 29 characters. warning message and will truncate the prefix to 29 characters.
8) A new "-q" option has been added to /sbin/shorewall commands. It 8) A new "-q" option has been added to /sbin/shorewall commands. It
causes the start, restart, check and refresh commands to produce causes the start, restart, check and refresh commands to produce
much less output so that warning messages are more visible (when much less output so that warning messages are more visible (when
testing this change, I discovered a bug where a bogus warning testing this change, I discovered a bug where a bogus warning
message was being generated). message was being generated).
9) Shorewall now used 'modprobe' to load kernel modules if that utility
is available in the PATH; otherwise, 'insmod' is used.