summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2006-03-08 17:58:52 +0000
committerOlivier Blin <oblin@mandriva.org>2006-03-08 17:58:52 +0000
commit24b7e3471a786d66fe3f4b96316881fce11d635d (patch)
tree3f66f72c4a57a32af53ed971631fecebba0d2c34 /perl-install
parent984a9367951876237c077d2842df8e7dd7502db4 (diff)
downloaddrakx-24b7e3471a786d66fe3f4b96316881fce11d635d.tar
drakx-24b7e3471a786d66fe3f4b96316881fce11d635d.tar.gz
drakx-24b7e3471a786d66fe3f4b96316881fce11d635d.tar.bz2
drakx-24b7e3471a786d66fe3f4b96316881fce11d635d.tar.xz
drakx-24b7e3471a786d66fe3f4b96316881fce11d635d.zip
automatically put ppp/ippp interfaces in local zone if needed
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/network/shorewall.pm17
1 files changed, 12 insertions, 5 deletions
diff --git a/perl-install/network/shorewall.pm b/perl-install/network/shorewall.pm
index e3bb9edb8..2567b4881 100644
--- a/perl-install/network/shorewall.pm
+++ b/perl-install/network/shorewall.pm
@@ -40,16 +40,20 @@ sub get_ifcfg_interface() {
network::tools::get_default_gateway_interface($net);
}
+sub dev_to_shorewall {
+ my ($dev) = @_;
+ $dev =~ /^ippp/ && "ippp+" ||
+ $dev =~ /^ppp/ && "ppp+" ||
+ $dev;
+}
+
sub get_shorewall_interface() {
#- read shorewall configuration first
foreach (get_config_file('interfaces')) {
$_->[0] eq 'net' and return $_->[1];
}
#- else try to find the best interface available
- my $default_dev = get_ifcfg_interface();
- $default_dev =~ /^ippp/ && "ippp+" ||
- $default_dev =~ /^ppp/ && "ppp+" ||
- $default_dev;
+ dev_to_shorewall(get_ifcfg_interface());
}
our $ask_shorewall_interface_label = N_("Please enter the name of the interface connected to the internet.
@@ -80,8 +84,11 @@ sub read_default_interfaces {
sub set_net_interface {
my ($conf, $interface) = @_;
$conf->{net_interface} = $interface;
+ my $net = {};
+ network::network::read_net_conf($net);
+ my @all_intf = uniq((map { dev_to_shorewall($_) } keys %{$net->{ifcfg}}), detect_devices::getNet());
#- keep all other interfaces (but alias interfaces) in local zone
- $conf->{loc_interface} = [ grep { !/:/ && $_ ne $interface } detect_devices::getNet() ];
+ $conf->{loc_interface} = [ grep { !/:/ && $_ ne $interface } @all_intf ];
}
sub read {