Fix sorting a little.
authorRoy Marples <roy@marples.name>
Fri, 3 Feb 2012 00:36:08 +0000 (00:36 +0000)
committerRoy Marples <roy@marples.name>
Fri, 3 Feb 2012 00:36:08 +0000 (00:36 +0000)
src/libdhcpcd/dispatch.c

index 4e3bf9f31ccf1aff315792d2b905ad79135a0a72..84ddce64d8110d7590d5ffdca2cd93842148830a 100644 (file)
@@ -73,13 +73,15 @@ dhcpcd_handle_event(DHCPCD_CONNECTION *con, DHCPCD_MESSAGE *msg)
                                l = e;
                        }
                        if (e == NULL) {
+                               if (strcmp(i->ifname, o) != 0 ||
+                                   strcmp(i->type, types[ti]) == 0)
+                                       continue;
                                e = i;
                        } else {
                                if (l != NULL)
                                        l->next = e->next;
                                else
                                        con->interfaces = e->next;
-                               e->next = NULL;
                                if (i != NULL &&
                                    strcmp(e->ifname, i->ifname) == 0 &&
                                    strcmp(e->type, i->type) == 0)
@@ -90,6 +92,7 @@ dhcpcd_handle_event(DHCPCD_CONNECTION *con, DHCPCD_MESSAGE *msg)
                                        free(i);
                                        i = e;
                                }
+                               e->next = NULL;
                        }
                        if (nl == NULL)
                                n = nl = e;