Author: kmachalkova Date: Mon Jan 12 16:53:01 2009 New Revision: 54555 URL: http://svn.opensuse.org/viewcvs/yast?rev=54555&view=rev Log: Do not reset default gw if the interface has been switched to 'No IP address' mode (L3 - #460262) Modified: branches/SuSE-Code-11-Branch/network/VERSION branches/SuSE-Code-11-Branch/network/package/yast2-network.changes branches/SuSE-Code-11-Branch/network/src/lan/address.ycp branches/SuSE-Code-11-Branch/network/src/modules/LanItems.ycp branches/SuSE-Code-11-Branch/network/src/modules/Routing.ycp branches/SuSE-Code-11-Branch/network/src/services/routing.ycp Modified: branches/SuSE-Code-11-Branch/network/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/network/VERSION?rev=54555&r1=54554&r2=54555&view=diff ============================================================================== --- branches/SuSE-Code-11-Branch/network/VERSION (original) +++ branches/SuSE-Code-11-Branch/network/VERSION Mon Jan 12 16:53:01 2009 @@ -1 +1 @@ -2.17.63 +2.17.64 Modified: branches/SuSE-Code-11-Branch/network/package/yast2-network.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/network/package/yast2-network.changes?rev=54555&r1=54554&r2=54555&view=diff ============================================================================== --- branches/SuSE-Code-11-Branch/network/package/yast2-network.changes (original) +++ branches/SuSE-Code-11-Branch/network/package/yast2-network.changes Mon Jan 12 16:53:01 2009 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Jan 12 16:49:26 CET 2009 - kmachalkova@suse.cz + +- Do not reset default gw if the interface is set to 'No IP address' + mode ( reset iff it is set to DHCP - #460262) +- 2.17.64 + +------------------------------------------------------------------- Wed Jan 7 16:45:59 CET 2009 - mzugec@suse.cz - set layer2 bit and LLADDR for s390 qeth devices (bnc#457189) Modified: branches/SuSE-Code-11-Branch/network/src/lan/address.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/network/src/lan/address.ycp?rev=54555&r1=54554&r2=54555&view=diff ============================================================================== --- branches/SuSE-Code-11-Branch/network/src/lan/address.ycp (original) +++ branches/SuSE-Code-11-Branch/network/src/lan/address.ycp Mon Jan 12 16:53:01 2009 @@ -1085,8 +1085,11 @@ LanItems::netmask = ""; LanItems::remoteip = ""; // fixed bug #73739 - if dhcp is used, dont set default gw statically - // don't delete default GW for usb/pcmci devices (#307102) - if (!LanItems::isCurrentHotplug()) Routing::RemoveDefaultGw(); + // but also: reset default gw only if DHCP* is used, this branch covers + // "No IP address" case, then default gw must stay (#460262) + // and also: don't delete default GW for usb/pcmcia devices (#307102) + if ( LanItems::isCurrentDHCP() && !LanItems::isCurrentHotplug()) + Routing::RemoveDefaultGw(); } } Modified: branches/SuSE-Code-11-Branch/network/src/modules/LanItems.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/network/src/modules/LanItems.ycp?rev=54555&r1=54554&r2=54555&view=diff ============================================================================== --- branches/SuSE-Code-11-Branch/network/src/modules/LanItems.ycp (original) +++ branches/SuSE-Code-11-Branch/network/src/modules/LanItems.ycp Mon Jan 12 16:53:01 2009 @@ -590,6 +590,15 @@ else return false; } +/** + * Check if currently edited device gets its IP address + * from DHCP (v4, v6 or both) + * @return true if it is + */ +global boolean isCurrentDHCP(){ + return regexpmatch( bootproto, "dhcp[46]?"); +} + global boolean IsItemConfigured(){ boolean ret = false; if (size(getCurrentItem()["ifcfg"]:"")>0) ret = true; Modified: branches/SuSE-Code-11-Branch/network/src/modules/Routing.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/network/src/modules/Routing.ycp?rev=54555&r1=54554&r2=54555&view=diff ============================================================================== --- branches/SuSE-Code-11-Branch/network/src/modules/Routing.ycp (original) +++ branches/SuSE-Code-11-Branch/network/src/modules/Routing.ycp Mon Jan 12 16:53:01 2009 @@ -84,6 +84,7 @@ */ global define void RemoveDefaultGw() { list <map> route = []; + y2milestone("Resetting default gateway - interface has been set to DHCP mode"); foreach(map row, Routes,{ if (row["destination"]:""!="default") route = add(route, row); }); Modified: branches/SuSE-Code-11-Branch/network/src/services/routing.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/network/src/services/routing.ycp?rev=54555&r1=54554&r2=54555&view=diff ============================================================================== --- branches/SuSE-Code-11-Branch/network/src/services/routing.ycp (original) +++ branches/SuSE-Code-11-Branch/network/src/services/routing.ycp Mon Jan 12 16:53:01 2009 @@ -140,13 +140,18 @@ integer max = 0; // integer items = 0; list<term> table_items_orig = []; - boolean forward = Routing::Forward; list<map> route_conf = Routing::Routes; + + //reset, so that UI really reflect current state + //maplist below will supply correct data, if there are some + defgw = ""; + defgwdev = ""; r_items = []; /* make ui items from the routes list */ term item = nil; + maplist(map r, route_conf, { if(r["destination"]:"" == "default" && !issubstring(r["extrapara"]:"", "metric")) { defgw = r["gateway"]:""; @@ -167,7 +172,7 @@ y2debug("table_items=%1", r_items); // y2debug("items=%1", items); -// max = items; + // max = items; UI::ChangeWidget(`gw, `Items, [ defgw ]); UI::ChangeWidget(`id(`gw), `ValidChars, IP::ValidChars); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org