Author: kmachalkova Date: Mon Jul 13 17:11:03 2009 New Revision: 58031 URL: http://svn.opensuse.org/viewcvs/yast?rev=58031&view=rev Log: Rollup SP2 patch for several bugs Modified: branches/SuSE-SLE-10-SP2-Branch/network/VERSION branches/SuSE-SLE-10-SP2-Branch/network/package/yast2-network.changes branches/SuSE-SLE-10-SP2-Branch/network/src/lan/address.ycp branches/SuSE-SLE-10-SP2-Branch/network/src/modules/Host.ycp branches/SuSE-SLE-10-SP2-Branch/network/src/modules/Lan.ycp Modified: branches/SuSE-SLE-10-SP2-Branch/network/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/network/VERSION?rev=58031&r1=58030&r2=58031&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP2-Branch/network/VERSION (original) +++ branches/SuSE-SLE-10-SP2-Branch/network/VERSION Mon Jul 13 17:11:03 2009 @@ -1 +1 @@ -2.13.119 +2.13.119.1 Modified: branches/SuSE-SLE-10-SP2-Branch/network/package/yast2-network.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/network/package/yast2-network.changes?rev=58031&r1=58030&r2=58031&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP2-Branch/network/package/yast2-network.changes (original) +++ branches/SuSE-SLE-10-SP2-Branch/network/package/yast2-network.changes Mon Jul 13 17:11:03 2009 @@ -1,4 +1,15 @@ ------------------------------------------------------------------- +Mon Jul 13 16:43:57 CEST 2009 - kmachalkova@suse.cz + +- Collective SP2 update for several bugs: + - For s390 propose CHAN_IDS values (bnc#445339) + - Do not reset default gw if the interface is set to 'No IP address' + mode ( reset iff it is set to DHCP - bnc#460262) + - Do not force-rewrite /etc/hosts when saving network configuration + i.e. keep manual changes (bnc#399084) +- 2.13.119.1 + +------------------------------------------------------------------- Wed Apr 30 12:00:26 CEST 2008 - mzugec@suse.de - eth device recognized as lcs (bnc#385094) Modified: branches/SuSE-SLE-10-SP2-Branch/network/src/lan/address.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/network/src/lan/address.ycp?rev=58031&r1=58030&r2=58031&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP2-Branch/network/src/lan/address.ycp (original) +++ branches/SuSE-SLE-10-SP2-Branch/network/src/lan/address.ycp Mon Jul 13 17:11:03 2009 @@ -1170,8 +1170,11 @@ Lan::ipaddr = ""; Lan::netmask = ""; Lan::remoteip = ""; - // fixed bug #73739 - if dhcp is used, dont set default gw statically - Routing::RemoveDefaultGw(); + + // fixed bug #73739 - if dhcp is used, don't set default gw statically + // but reset it if and only if DHCP will be used to supply it - #460262 + if( Lan::bootproto == "dhcp") + Routing::RemoveDefaultGw(); } } Modified: branches/SuSE-SLE-10-SP2-Branch/network/src/modules/Host.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/network/src/modules/Host.ycp?rev=58031&r1=58030&r2=58031&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP2-Branch/network/src/modules/Host.ycp (original) +++ branches/SuSE-SLE-10-SP2-Branch/network/src/modules/Host.ycp Mon Jul 13 17:11:03 2009 @@ -13,8 +13,10 @@ textdomain "network"; import "Hostname"; +import "Map"; import "String"; import "Summary"; +import "NetworkDevices"; /** * All hosts @@ -49,6 +51,11 @@ boolean initialized = false; /** + * Original IP address list + */ +global list <string> oldips = []; + +/** * Read hosts settings * @return true if success */ @@ -69,6 +76,14 @@ /* save hosts to check for changes later */ hosts_init = hosts; + /* save also used static IPs */ + list<string> devs = + NetworkDevices::Locate ("BOOTPROTO", "static") + + NetworkDevices::Locate ("BOOTPROTO", ""); + oldips = maplist(string dev, devs, { + return NetworkDevices::GetValue(dev, "IPADDR"); + }); + y2debug("hosts=%1", hosts); initialized = true; return true; @@ -214,6 +229,8 @@ } y2debug("Hosts: %1", hosts); + string ipwithnick = ""; + /* Remove old hostname from hosts */ // list oldhnlist = []; foreach (string ip, list<string> hs, hosts, { @@ -221,6 +238,9 @@ return splitstring(s," "); }); wrk = filter (list <string> lst, wrk, { + if (contains(lst, oldnick) && contains(lst, oldhn)) { + ipwithnick = ip; + } return (!contains(lst, oldhn)); }); @@ -228,6 +248,7 @@ return mergestring(lst, " "); }); }); + y2milestone("Hosts: %1", hosts); /* Resurect the rest of oldhnlist without old hostname */ // FIXME: maybe @@ -237,10 +258,22 @@ hosts["127.0.0.1"] = ["localhost"]; } + list <string> system_hosts = (list <string>) GetSystemHosts(); + /* Add at least one hostname/ip */ // but do not overload localhost (#46715) if (write_hostname) if (size(ips) < 1 && nick != "localhost") { + //This means we have DHCP config (or even no config at all) + //so let's keep system hosts, 127.0.0.2 and foreign hosts only + //in such case + //#399084 + foreach (string ip, list<string> hs, hosts, { + if ( !contains(system_hosts, ip) && contains(oldips, ip) ) { + hosts[ip] = []; + } + }); + y2milestone("No IP found, adding dummy 127.0.0.2"); // TODO #42102 hosts["127.0.0.2"] = [ newhn + " " + nick ]; @@ -249,23 +282,46 @@ } /* Add hostname/ip for all ips */ + + list <string> to_update = (list <string>)union(ips, Map::Keys(hosts_init)); boolean nickadded = false; - maplist(string ip, ips, { + maplist(string ip, to_update, { /* Only add if not present yet */ // if(haskey(hosts, ip)) return; /* Omit some IP addresses */ - if(ip == "" || ip == nil || ip == "127.0.0.1" || ip == "127.0.0.2") return; + if(ip == "" || ip == nil || contains(system_hosts, ip) || ip == "127.0.0.2") return; - string name = newhn ; - /* Add nick for the first one */ - if(!nickadded) { - nickadded = true; - name = newhn + " " + nick; + //this IP no longer exists (device has been deleted/set to DHCP) + // => reset the hostname + if (!contains(ips, ip) && contains(oldips, ip)) { + hosts[ip] = []; + return; + } + + //#399084: + //Some hostname for this static IP existed before + //and it was different from the one to be currently set + // => we need to preserve the hostname + if ( (hosts_init[ip]:[] != []) && (hosts[ip]:[] != []) ) { + hosts[ip] = hosts_init[ip]:[]; } + else { + string name = newhn ; + if (ip == ipwithnick) { + nickadded = true; + name = newhn + " " + nick; + } + hosts[ip] = [ name ]; + } + }); - hosts[ip] = add(hosts[ip]:[],name); - + maplist(string ip, to_update, { + list <string> hst = hosts[ip]:[]; + if (contains(hst, newhn) && !nickadded) { + nickadded = true; + hosts[ip] = [ newhn + " " + nick ]; + } }); y2milestone("Hosts: %1", hosts); Modified: branches/SuSE-SLE-10-SP2-Branch/network/src/modules/Lan.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/network/src/modules/Lan.ycp?rev=58031&r1=58030&r2=58031&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP2-Branch/network/src/modules/Lan.ycp (original) +++ branches/SuSE-SLE-10-SP2-Branch/network/src/modules/Lan.ycp Mon Jul 13 17:11:03 2009 @@ -717,7 +717,28 @@ // name of hwcfg if(busid != nil && busid != "") { nm_name = "bus-" + hw["bus"]:"" + "-" + hw["busid"]:""; - if(Arch::s390 ()) nm_name = DriverType(type) + "-" + nm_name; + if(Arch::s390 ()){ + nm_name = DriverType(type) + "-" + nm_name; + if(operation==`add){ + y2internal("Propose chan_ids values for %1", hw); + integer devid = 0; + string devstr = ""; + y2milestone("nm_name=%1", Lan::nm_name); + string s390chanid = "[0-9]+\\.[0-9]+\\."; + if(regexpmatch(Lan::nm_name, s390chanid)) { + devid = tointeger("0x" + regexpsub(Lan::nm_name, s390chanid + "(.*)", "\\1")); + devstr = regexpsub(Lan::nm_name, ".*[^0-9](" + s390chanid + ").*", "\\1"); + } + + y2milestone("devid=%1(%2)", devid, devstr); + if(devid == nil) devid = 0; + string devid0 = String::PadZeros(regexpsub(tohexstring(devid), "0x(.*)", "\\1"), 4); + string devid1 = String::PadZeros(regexpsub(tohexstring(devid+1), "0x(.*)", "\\1"), 4); + string devid2 = String::PadZeros(regexpsub(tohexstring(devid+2), "0x(.*)", "\\1"), 4); + Lan::qeth_chanids = sformat("%1%2 %1%3 %1%4", devstr, devid0, devid1, devid2); + + } + } } else { // #suse42421 - don't write hwcfg-static for pcmcia cards (PC and CardBus) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org