From 8986c670e7a401e0cc0df145cd6a53cd7d8b5ce4 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 7 Mar 2005 14:00:50 +0000 Subject: delete gateway if appropriate when configuring DSL devices too (#13978) --- perl-install/network/netconnect.pm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'perl-install') diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index be9592490..19ad857bf 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -229,6 +229,15 @@ sub real_main { } }; + my $delete_gateway_settings = sub { + my ($device) = @_; + #- delete gateway settings if gateway device is invalid or matches the reconfigured device + if (!$netc->{GATEWAYDEV} || !exists $eth_intf{$netc->{GATEWAYDEV}} || $netc->{GATEWAYDEV} eq $device) { + delete $netc->{GATEWAY}; + delete $netc->{GATEWAYDEV}; + } + }; + # main wizard: my $wiz; @@ -858,6 +867,8 @@ If you do not know, choose 'use PPPoE'"), $ethntf->{DEVICE} = "`/usr/sbin/fctStartAdsl -i`"; $ethntf->{MII_NOT_SUPPORTED} = "yes"; } + #- delete gateway settings if gateway device is invalid or if reconfiguring the gateway interface + exists $intf->{$ntf_name} and $delete_gateway_settings->($ntf_name); # process static/dhcp ethernet devices: if (exists($intf->{$ntf_name}) && member($adsl_type, qw(manual dhcp))) { $ethntf->{TYPE} = "ADSL"; @@ -1072,10 +1083,7 @@ notation (for example, 1.2.3.4).")), if ($auto_ip) { $in->do_pkgs->install($netc->{dhcp_client}); #- delete gateway settings if gateway device is invalid or if reconfiguring the gateway interface to dhcp - if (!$netc->{GATEWAYDEV} || !exists $eth_intf{$netc->{GATEWAYDEV}} || $netc->{GATEWAYDEV} eq $ntf_name) { - delete $netc->{GATEWAY}; - delete $netc->{GATEWAYDEV}; - } + $delete_gateway_settings->($ntf_name); } return $is_wireless ? "wireless" : "static_hostname"; }, -- cgit v1.2.1