Skip to content

Commit

Permalink
Merge pull request #801 from mchf/SLE-12-SP4
Browse files Browse the repository at this point in the history
Merged Sle-12-sp3
  • Loading branch information
mchf committed May 3, 2019
2 parents 8b916d6 + 78114a8 commit 2c27dd6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
8 changes: 8 additions & 0 deletions package/yast2-network.changes
@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri Apr 12 10:00:58 UTC 2019 - Michal Filka <mfilka@suse.com>

- bnc#1131588
- display a confirmation popup when static route is going to be
removed when switching a device to dhcp
- 3.4.4

-------------------------------------------------------------------
Wed Mar 20 21:44:27 UTC 2019 - knut.anderssen@suse.com

Expand Down
4 changes: 2 additions & 2 deletions package/yast2-network.spec
@@ -1,7 +1,7 @@
#
# spec file for package yast2-network
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
Expand All @@ -17,7 +17,7 @@


Name: yast2-network
Version: 3.4.3
Version: 3.4.4
Release: 0
BuildArch: noarch

Expand Down
10 changes: 9 additions & 1 deletion src/include/network/lan/address.rb
Expand Up @@ -1473,7 +1473,15 @@ def AddressDialog
# "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
remove_gw = Routing.default_gw? && Popup.YesNo(
_(
"A static default route is defined.\n" \
"It is suggested to remove the static default route definition \n" \
"if one can be obtained also via DHCP.\n" \
"Do you want to remove the static default route?"
)
)
Routing.RemoveDefaultGw if remove_gw
end
end
end
Expand Down
6 changes: 6 additions & 0 deletions src/modules/Routing.rb
Expand Up @@ -163,6 +163,12 @@ def RemoveDefaultGw
nil
end

# Checks whether a default gateway is defined
# @return [Boolean] true when a default gateway is defined
def default_gw?
@Routes.any? { |r| r["destination"] == "default" }
end

# Reads current status for both IPv4 and IPv6 forwarding
def ReadIPForwarding
@Forward_v4 = if SuSEFirewall.IsEnabled
Expand Down

0 comments on commit 2c27dd6

Please sign in to comment.