Mailinglist Archive: yast-commit (819 mails)

< Previous Next >
[yast-commit] r54553 - in /trunk/network/src: lan/address.ycp modules/LanItems.ycp modules/Routing.ycp
  • From: kmachalkova@xxxxxxxxxxxxxxxx
  • Date: Mon, 12 Jan 2009 15:42:35 -0000
  • Message-id: <E1LMOvz-0000O3-Kj@xxxxxxxxxxxxxxxx>
Author: kmachalkova
Date: Mon Jan 12 16:42:35 2009
New Revision: 54553

URL: http://svn.opensuse.org/viewcvs/yast?rev=54553&view=rev
Log:
Do not reset default gw if the interface has been
switched to 'No IP address' mode (L3 - #460262)

Modified:
trunk/network/src/lan/address.ycp
trunk/network/src/modules/LanItems.ycp
trunk/network/src/modules/Routing.ycp

Modified: trunk/network/src/lan/address.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/address.ycp?rev=54553&r1=54552&r2=54553&view=diff
==============================================================================
--- trunk/network/src/lan/address.ycp (original)
+++ trunk/network/src/lan/address.ycp Mon Jan 12 16:42:35 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: trunk/network/src/modules/LanItems.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/LanItems.ycp?rev=54553&r1=54552&r2=54553&view=diff
==============================================================================
--- trunk/network/src/modules/LanItems.ycp (original)
+++ trunk/network/src/modules/LanItems.ycp Mon Jan 12 16:42:35 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: trunk/network/src/modules/Routing.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/Routing.ycp?rev=54553&r1=54552&r2=54553&view=diff
==============================================================================
--- trunk/network/src/modules/Routing.ycp (original)
+++ trunk/network/src/modules/Routing.ycp Mon Jan 12 16:42:35 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);
});

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages