diff options
author | Olivier Blin <oblin@mandriva.org> | 2006-03-08 19:27:57 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2006-03-08 19:27:57 +0000 |
commit | fdf6db8b96962b7d3ecf50276fc33be4592454aa (patch) | |
tree | 7f6920ab11db5d9254c6063c95a6cd0c480a0150 | |
parent | 265392641d5a0ad6647bee8598a45aaa4dff5be0 (diff) | |
download | drakx-fdf6db8b96962b7d3ecf50276fc33be4592454aa.tar drakx-fdf6db8b96962b7d3ecf50276fc33be4592454aa.tar.gz drakx-fdf6db8b96962b7d3ecf50276fc33be4592454aa.tar.bz2 drakx-fdf6db8b96962b7d3ecf50276fc33be4592454aa.tar.xz drakx-fdf6db8b96962b7d3ecf50276fc33be4592454aa.zip |
automatically put ppp/ippp interfaces in local zone if needed (backport from HEAD)
-rw-r--r-- | perl-install/network/shorewall.pm | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/perl-install/network/shorewall.pm b/perl-install/network/shorewall.pm index 07b791ed1..f4183f1d1 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 { |