diff options
author | Bill Nottingham <notting@redhat.com> | 1999-09-21 20:43:59 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 1999-09-21 20:43:59 +0000 |
commit | 14271eb50b57b1944541b48bdfb5aaf87a9befa8 (patch) | |
tree | 238e52cb9ad64fea51666234345002d7319d575b /rc.d | |
parent | 7f30358f8ffa24b805b22b96ad89a74851fe0b65 (diff) | |
download | initscripts-14271eb50b57b1944541b48bdfb5aaf87a9befa8.tar initscripts-14271eb50b57b1944541b48bdfb5aaf87a9befa8.tar.gz initscripts-14271eb50b57b1944541b48bdfb5aaf87a9befa8.tar.bz2 initscripts-14271eb50b57b1944541b48bdfb5aaf87a9befa8.tar.xz initscripts-14271eb50b57b1944541b48bdfb5aaf87a9befa8.zip |
add a "DEFRAG_IPV4" setting
Diffstat (limited to 'rc.d')
-rwxr-xr-x | rc.d/init.d/network | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/rc.d/init.d/network b/rc.d/init.d/network index 751005c3..e43fb433 100755 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -71,11 +71,37 @@ ipv4_forward_set () fi } +ipv4_defrag_set () +{ + # Sets whether or not to always defrag packets. + # Good for masquerading, or virtual server stuff. + # Not necessarily so good otherwise. + if [ -d /proc/sys/net/ipv4 ]; then + if [ ! -f /proc/sys/net/ipv4/ip_always_defrag ]; then + echo "/proc/sys/net/ipv4/ip_always_defrag is missing --" \ + "cannot control IP defragmentation" >&2 + else + if [ "$DEFRAG_IPV4" = "yes" -o "$DEFRAG_IPV4" = "true" ]; then + value=1 + mesage="Enabling IPv4 automatic defragmentation" + else + value=0 + message="Disabling IPv4 automatic defragmentation" + fi + + if [ $value != `cat /proc/sys/net/ipv4/ip_always_defrag` ]; then + action "$message" /bin/true + echo "$value" > /proc/sys/net/ipv4/ip_always_defrag + fi + fi + fi +} # See how we were called. case "$1" in start) ipv4_forward_set + ipv4_defrag_set action "Bringing up interface lo" ./ifup ifcfg-lo @@ -107,12 +133,21 @@ case "$1" in ;; esac ./ifdown ifcfg-lo - if [ -d /proc/sys/net/ipv4 -a -f /proc/sys/net/ipv4/ip_forward ]; then + if [ -d /proc/sys/net/ipv4 ]; then + if [ -f /proc/sys/net/ipv4/ip_forward ]; then if [ `cat /proc/sys/net/ipv4/ip_forward` != 0 ]; then action "Disabling IPv4 packet forwarding" /bin/true echo 0 > /proc/sys/net/ipv4/ip_forward fi + fi + if [ -f /proc/sys/net/ipv4/ip_always_defrag ]; then + if [ 'cat /proc/sys/net/ipv4/ip_always_defrag' != 0 ]; then + action "Disabling IPv4 automatic defragmentation" /bin/true + echo 0 > /proc/sys/net/ipv4/ip_always_defrag + fi + fi fi + rm -f /var/lock/subsys/network ;; status) |