Report SSID we lose assocation with.
authorRoy Marples <roy@marples.name>
Thu, 22 Jan 2009 23:32:54 +0000 (23:32 +0000)
committerRoy Marples <roy@marples.name>
Thu, 22 Jan 2009 23:32:54 +0000 (23:32 +0000)
main.c

diff --git a/main.c b/main.c
index 3e9d1a600112f5d7f14e98fff0b48fb9584efdea..26bf03f7e68c35b23bf6b216f6d366c7d0b1b614 100644 (file)
--- a/main.c
+++ b/main.c
@@ -203,16 +203,20 @@ print_if_msg(const struct if_msg *ifm)
                        reason = "Failed to renew";
                else if (g_strcmp0(ifm->reason, "CARRIER") == 0) {
                        if (ifm->wireless) {
-                               reason = "Asssociated to";
+                               reason = "Asssociated with";
                                if (ifm->ssid != NULL)
                                        showssid = TRUE;
                        } else
                                reason = "Cable plugged in";
                        showip = FALSE;
                } else if (g_strcmp0(ifm->reason, "NOCARRIER") == 0) {
-                       if (ifm->wireless)
-                               reason = "Not associated";
-                       else
+                       if (ifm->wireless) {
+                               if (ifm->ssid != NULL || ifm->ip.s_addr != 0) {
+                                       reason = "Lost association with";
+                                       showssid = TRUE;
+                               } else
+                                   reason = "Not associated";
+                       } else
                                reason = "Cable unplugged";
                        showip = FALSE;
                }