summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/network/connection/ethernet.pm6
-rw-r--r--lib/network/connection_manager.pm4
-rw-r--r--lib/network/netconnect.pm2
3 files changed, 8 insertions, 4 deletions
diff --git a/lib/network/connection/ethernet.pm b/lib/network/connection/ethernet.pm
index 29c6be9..2815f1c 100644
--- a/lib/network/connection/ethernet.pm
+++ b/lib/network/connection/ethernet.pm
@@ -57,8 +57,10 @@ sub check_device {
}
sub get_protocols() {
- {
- static => N("Manual configuration"),
+ my $system_file = '/etc/sysconfig/drakx-net';
+ my %global_settings = getVarsFromSh($system_file);
+ +{
+ if_(!text2bool($global_settings{AUTOMATIC_ADDRESS}), static => N("Manual configuration")),
dhcp => N("Automatic IP (BOOTP/DHCP)"),
};
}
diff --git a/lib/network/connection_manager.pm b/lib/network/connection_manager.pm
index 53a0312..02037c1 100644
--- a/lib/network/connection_manager.pm
+++ b/lib/network/connection_manager.pm
@@ -110,6 +110,8 @@ sub configure_connection {
}
load_settings($cmanager);
+ my $system_file = '/etc/sysconfig/drakx-net';
+ my %global_settings = getVarsFromSh($system_file);
my $error;
do {
@@ -132,7 +134,7 @@ sub configure_connection {
{ label => $cmanager->{connection}->get_access_settings_label, title => 1, advanced => 1 },
@{$cmanager->{connection}->get_access_settings}
) : (),
- $cmanager->{connection}->can('get_address_settings') ? (
+ $cmanager->{connection}->can('get_address_settings') && !text2bool($global_settings{AUTOMATIC_ADDRESS}) ? (
{ label => $cmanager->{connection}->get_address_settings_label, title => 1, advanced => 1 },
@{$cmanager->{connection}->get_address_settings('show_all')}
) : (),
diff --git a/lib/network/netconnect.pm b/lib/network/netconnect.pm
index 92c0ca1..a0fae70 100644
--- a/lib/network/netconnect.pm
+++ b/lib/network/netconnect.pm
@@ -100,7 +100,7 @@ sub real_main {
"select_protocol" => sub { $connection->can('get_protocols') },
#- peer settings may depend on provider and protocol (VPI/VCI for xDSL)
"configure_access" => sub { $connection->can('get_access_settings') },
- "configure_address" => sub { $connection->can('get_address_settings') || $connection->can('get_hostname_settings') },
+ "configure_address" => sub { ($connection->can('get_address_settings') || $connection->can('get_hostname_settings')) && !text2bool($global_settings{AUTOMATIC_ADDRESS}) },
"configure_control" => sub { $connection->can('get_control_settings') },
"apply_connection" => sub { 1 },
);