summaryrefslogtreecommitdiffstats
path: root/lib/network/connection/wireless.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-04-03 03:56:24 +0000
committerOlivier Blin <oblin@mandriva.com>2008-04-03 03:56:24 +0000
commit8492d33b01531ec464354e2ae66d168995ed9dc4 (patch)
tree21e04d3db70a2b6389605e2dbaadd59fc6d51356 /lib/network/connection/wireless.pm
parent73485cbfd99804ce7928dd9d777f8bf8585d90bb (diff)
downloaddrakx-net-8492d33b01531ec464354e2ae66d168995ed9dc4.tar
drakx-net-8492d33b01531ec464354e2ae66d168995ed9dc4.tar.gz
drakx-net-8492d33b01531ec464354e2ae66d168995ed9dc4.tar.bz2
drakx-net-8492d33b01531ec464354e2ae66d168995ed9dc4.tar.xz
drakx-net-8492d33b01531ec464354e2ae66d168995ed9dc4.zip
write open/restricted mode in WIRELESS_ENC_MODE variable to be able
to use spaces in ASCII wireless keys (#26025)
Diffstat (limited to 'lib/network/connection/wireless.pm')
-rw-r--r--lib/network/connection/wireless.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/network/connection/wireless.pm b/lib/network/connection/wireless.pm
index b26ac26..239320a 100644
--- a/lib/network/connection/wireless.pm
+++ b/lib/network/connection/wireless.pm
@@ -349,7 +349,7 @@ sub guess_network_access_settings {
$network && $network->{flags} =~ /wpa/i ?
'wpa-psk' :
$network && $network->{flags} =~ /wep/i || $self->{access}{network}{key} ?
- ($restricted ? 'restricted' : 'open') :
+ $ifcfg->{WIRELESS_ENC_MODE} || ($restricted ? 'restricted' : 'open') :
'none';
undef $self->{ifcfg}{WIRELESS_IWPRIV} if is_old_rt2x00($self->get_driver) && $self->{ifcfg}{WIRELESS_IWPRIV} =~ /WPAPSK/;
@@ -583,7 +583,9 @@ sub build_ifcfg_settings {
),
WIRELESS_ESSID => $self->{access}{network}{essid},
if_($self->{access}{network}{encryption} ne 'none',
- WIRELESS_ENC_KEY => convert_wep_key_for_iwconfig($self->{access}{network}{key}, $self->{access}{network}{encryption} eq 'restricted', $self->{access}{network}{force_ascii_key})),
+ WIRELESS_ENC_KEY => convert_wep_key_for_iwconfig($self->{access}{network}{key}, $self->{access}{network}{force_ascii_key})),
+ if_(member($self->{access}{network}{encryption}, qw(open restricted)),
+ WIRELESS_ENC_MODE => $self->{access}{network}{encryption}),
if_($self->need_rt2x00_iwpriv,
#- use iwpriv for WPA with rt2400/rt2500 drivers, they don't plan to support wpa_supplicant
WIRELESS_IWPRIV => qq(set AuthMode=WPAPSK
@@ -702,9 +704,8 @@ sub get_hex_key {
}
sub convert_wep_key_for_iwconfig {
- my ($real_key, $restricted, $force_ascii) = @_;
- my $key = !$force_ascii && get_hex_key($real_key) || "s:$real_key";
- $restricted ? "restricted $key" : "open $key";
+ my ($real_key, $force_ascii) = @_;
+ !$force_ascii && get_hex_key($real_key) || "s:$real_key";
}
sub convert_wep_key_for_wpa_supplicant {