Allow ROUTERADVERT to be an up reason.
[dhcpcd-ui] / src / libdhcpcd / misc.c
index 0037d8f4aac56a1da673d618e49f79c471a1378a..fbeb2e1ebfcc7fb68de0f208b0c0eb5e2b5131c2 100644 (file)
@@ -28,7 +28,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <strings.h>
+#include <string.h>
 
 #include <libintl.h>
 
@@ -46,6 +46,7 @@ static const char *const dhcpcd_up_reasons[] = {
        "INFORM",
        "STATIC",
        "TIMEOUT",
+       "ROUTERADVERT",
        NULL
 };
 
@@ -97,14 +98,14 @@ dhcpcd_if_message(const DHCPCD_IF *i)
        else if (strcmp(i->reason, "CARRIER") == 0) {
                if (i->wireless) {
                        reason = _("Associated with");
-                       if (i->ssid != NULL)
+                       if (*i->ssid != '\0')
                                showssid = true;
                } else
                        reason = _("Cable plugged in");
                showip = false;
        } else if (strcmp(i->reason, "NOCARRIER") == 0) {
                if (i->wireless) {
-                       if (i->ssid != NULL || i->ip.s_addr != 0) {
+                       if (*i->ssid != '\0' || i->ip.s_addr != 0) {
                                reason = _("Disassociated from");
                                showssid = true;
                        } else