[yast-commit] r59756 - in /trunk/network: VERSION package/yast2-network.changes src/modules/Lan.ycp
Author: mzugec Date: Wed Nov 25 15:17:58 2009 New Revision: 59756 URL: http://svn.opensuse.org/viewcvs/yast?rev=59756&view=rev Log: disable ipv6 (bnc#558020) Modified: trunk/network/VERSION trunk/network/package/yast2-network.changes trunk/network/src/modules/Lan.ycp Modified: trunk/network/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/VERSION?rev=59756&r1=59755&r2=59756&view=diff ============================================================================== --- trunk/network/VERSION (original) +++ trunk/network/VERSION Wed Nov 25 15:17:58 2009 @@ -1 +1 @@ -2.19.1 +2.19.2 Modified: trunk/network/package/yast2-network.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/package/yast2-network.changes?rev=59756&r1=59755&r2=59756&view=diff ============================================================================== --- trunk/network/package/yast2-network.changes (original) +++ trunk/network/package/yast2-network.changes Wed Nov 25 15:17:58 2009 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Wed Nov 25 15:15:11 CET 2009 - mzugec@suse.cz + +- disable ipv6 (bnc#558020) +- 2.19.2 + +------------------------------------------------------------------- Tue Nov 24 13:07:12 CET 2009 - mzugec@suse.cz - support for WIRELESS_AP_SCANMODE option (bnc#551618) Modified: trunk/network/src/modules/Lan.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/Lan.ycp?rev=59756&r1=59755&r2=59756&view=diff ============================================================================== --- trunk/network/src/modules/Lan.ycp (original) +++ trunk/network/src/modules/Lan.ycp Wed Nov 25 15:17:58 2009 @@ -75,6 +75,7 @@ // ipv6 module global boolean ipv6=true; + /** * Hotplug type ("" if not hot pluggable) */ @@ -127,6 +128,29 @@ return down; } +void readIPv6(){ + ipv6=true; + + list<string> filelist = ["sysctl.conf"]; + string filepath = "/etc/"; + string regexp = "^[[:space:]]*(net.ipv6.conf.all.disable_ipv6)[[:space:]]*=[[:space:]]*1"; +// uncomment bellow to read from old place +// filelist = ["ipv6", "50-ipv6.conf"]; +// filepath ="/etc/modprobe.d/"; +// regexp = "^[[:space:]]*(install ipv6 /bin/true)"; + + foreach(string file, filelist,{ + string filename=sformat("%1/%2", filepath, file); + if (FileUtils::Exists(filename)){ + foreach(string row, splitstring((string)SCR::Read(.target.string, filename), "\n"), { + if (size(regexptokenize(String::CutBlanks(row), regexp))>0){ + y2milestone("IPv6 is disabled."); + ipv6=false; + } + }); + } + }); +} /** * Lan::Read (`cache) will do nothing if initialized already. @@ -224,11 +248,7 @@ ProgressNextStage(_("Reading network configuration...")); NetworkConfig::Read(); - foreach(string file, ["ipv6", "50-ipv6.conf"],{ - string filename=sformat("/etc/modprobe.d/%1", file); - if (FileUtils::Exists(filename)) - if (((map<string, any>)SCR::Execute (.target.bash_output, sformat("grep ipv6 %1|cut -d# -f1|grep -q ipv6", filename)))["exit"]:0==0) ipv6=false; - }); + readIPv6(); sleep(sl); @@ -296,7 +316,22 @@ } void writeIPv6(){ - SCR::Write(.target.string, "/etc/modprobe.d/50-ipv6.conf", sformat("%1install ipv6 /bin/true", ipv6?"#":"")); +// uncomment to write to old place (and comment code bellow) +// SCR::Write(.target.string, "/etc/modprobe.d/50-ipv6.conf", sformat("%1install ipv6 /bin/true", ipv6?"#":"")); + string filename = "/etc/sysctl.conf"; + string sysctl = (string)SCR::Read(.target.string, filename); + string sysctl_row = sformat("%1net.ipv6.conf.all.disable_ipv6 = 1", ipv6?"# ":""); + boolean found = false; //size(regexptokenize(sysctl, "(net.ipv6.conf.all.disable_ipv6)"))>0; + list<string> file=[]; + foreach(string row, splitstring(sysctl, "\n"), { + if (size(regexptokenize(row, "(net.ipv6.conf.all.disable_ipv6)"))>0){ + row = sysctl_row; + found = true; + } + file=add(file, row); + }); + if (!found) file=add(file, sysctl_row); + SCR::Write(.target.string, filename, mergestring(file, "\n")); SCR::Write(.sysconfig.windowmanager.KDE_USE_IPV6, ipv6?"yes":"no"); } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
mzugec@svn.opensuse.org