Fix dhcpcd-online for recent libdhcpcd changes
authorRoy Marples <roy@marples.name>
Tue, 12 May 2015 21:36:29 +0000 (21:36 +0000)
committerRoy Marples <roy@marples.name>
Tue, 12 May 2015 21:36:29 +0000 (21:36 +0000)
src/dhcpcd-online/dhcpcd-online.c

index a345be9826cfd3195664c8ba813612418de67433..dfedf48247d334e3de42b3a02c9cf953a109b4b6 100644 (file)
@@ -84,16 +84,21 @@ do_exit(DHCPCD_CONNECTION *con, int code)
 }
 
 static void
-do_status_cb(DHCPCD_CONNECTION *con, const char *status, void *arg)
+do_status_cb(DHCPCD_CONNECTION *con,
+    unsigned int status, const char *status_msg, void *arg)
 {
        struct pollfd *pfd;
 
-       syslog(LOG_INFO, "%s", status);
-       if (strcmp(status, "connected") == 0)
+       syslog(LOG_INFO, "%s", status_msg);
+       switch (status)
+       {
+       case DHC_CONNECTED:
                do_exit(con, EXIT_SUCCESS);
-       if (strcmp(status, "down") == 0) {
+               break;
+       case DHC_DOWN:
                pfd = arg;
                pfd->fd = -1;
+               break;
        }
 }