wpa: update frequency on each dhcpcd event
authorRoy Marples <roy@marples.name>
Thu, 1 Mar 2018 09:49:21 +0000 (09:49 +0000)
committerRoy Marples <roy@marples.name>
Thu, 1 Mar 2018 09:49:21 +0000 (09:49 +0000)
This fixes an issue with the AP reconnecting to the same AP but not
updating the frequency correctly.

Thanks to Simon Long.

src/libdhcpcd/wpa.c

index ccca155977809598ec924e9887dd3488d0c7e56d..350c78152e835b4bc486f8fab632a8b53cb366ce 100644 (file)
@@ -1142,8 +1142,11 @@ dhcpcd_wpa_if_event(DHCPCD_IF *i)
                                dhcpcd_wpa_close(wpa);
                } else if (i->wireless && i->con->wpa_started) {
                        wpa = dhcpcd_wpa_new(i->con, i->ifname);
-                       if (wpa && wpa->listen_fd == -1)
-                               dhcpcd_wpa_open(wpa);
+                       if (wpa) {
+                               if (wpa->listen_fd == -1)
+                                       dhcpcd_wpa_open(wpa);
+                               i->freq = dhcpcd_wpa_freq(wpa);
+                       }
                }
        }
 }