From 18211b26711d90fa61457080ec89cc2bfca30958 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 5 May 2008 20:25:59 +0000 Subject: refresh networks list when switching from non-roaming to roaming (to get wpa_supplicant network IDs) --- lib/network/connection/wireless.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/network/connection/wireless.pm b/lib/network/connection/wireless.pm index 62c4bb2..3e72f80 100644 --- a/lib/network/connection/wireless.pm +++ b/lib/network/connection/wireless.pm @@ -317,6 +317,15 @@ sub get_networks { $self->{networks}; } +sub refresh_roaming_ids { + my ($self) = @_; + #- needed when switching from non-roaming to roaming + #- to get wpa_supplicant network IDs + get_networks($self) if + $self->{control}{roaming} && + !any { defined $_->{id} } values %{$self->{networks}}; +} + sub guess_network { my ($_self) = @_; #- FIXME: try to find the AP matching $self->{ifcfg}{WIRELESS_ESSID}; @@ -656,6 +665,7 @@ sub connect { $self->SUPER::connect; if ($self->{control}{roaming}) { + refresh_roaming_ids($self); my $network = $self->get_selected_network; if ($network && defined $network->{id}) { eval { $net->{monitor}->select_network($network->{id}) }; -- cgit v1.2.1