diff options
author | Eugeni Dodonov <eugeni@mandriva.org> | 2009-04-02 14:55:51 +0000 |
---|---|---|
committer | Eugeni Dodonov <eugeni@mandriva.org> | 2009-04-02 14:55:51 +0000 |
commit | d6b4d26f44595acafa816f2661842f465efbd481 (patch) | |
tree | 2e79802f9330dfc27292d002ffc7a448c54e5f47 /lib | |
parent | ffea119edcca614529513901afe8d324469ff26b (diff) | |
download | drakx-net-d6b4d26f44595acafa816f2661842f465efbd481.tar drakx-net-d6b4d26f44595acafa816f2661842f465efbd481.tar.gz drakx-net-d6b4d26f44595acafa816f2661842f465efbd481.tar.bz2 drakx-net-d6b4d26f44595acafa816f2661842f465efbd481.tar.xz drakx-net-d6b4d26f44595acafa816f2661842f465efbd481.zip |
New way to disable ipv6 (#48618).
Diffstat (limited to 'lib')
-rw-r--r-- | lib/network/network.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/network/network.pm b/lib/network/network.pm index 63ab8bb..2009171 100644 --- a/lib/network/network.pm +++ b/lib/network/network.pm @@ -439,7 +439,7 @@ sub advanced_settings_read { my $sysctl = "$::prefix/etc/sysctl.conf"; my $msecconf = "$::prefix/etc/security/msec/security.conf"; - my $ipv6_disabled = grep { /^install ipv6 \/bin\/true$/ } cat_($modprobe); + my $ipv6_disabled = grep { /^options ipv6 disable=1$/ } cat_($modprobe); my $disable_window_scaling = grep { /^net\.ipv4\.tcp_window_scaling\s*=\s*0$/ } cat_($sysctl); my $disable_tcp_timestamps = grep { /^net\.ipv4\.tcp_timestamps\s*=\s*0$/ } cat_($sysctl); my $log_martians = grep { /^net\.ipv4\.conf\.all\.log_martians\s*=\s*1$/ } cat_($sysctl); @@ -459,12 +459,12 @@ sub advanced_settings_read { sub advanced_settings_write { my ($u) = @_; # ipv6 - if ($u->{ipv6_disabled}) { - my $line = "install ipv6 /bin/true\n"; - substInFile { s/^install ipv6 .*//; $_ = $line if eof } "$::prefix/etc/modprobe.conf"; - } else { - substInFile { s/^install ipv6 \/bin\/true// } "$::prefix/etc/modprobe.conf"; - } + substInFile { + /^(options ipv6 .*|install ipv6 .*|alias net-pf-10 off)/ and $_=""; + if (eof and $u->{ipv6_disabled}) { + $_ .= "options ipv6 disable=1\n"; + } + } "$::prefix/etc/modprobe.conf"; # sysctl substInFile { # remove old entries |