Free history
[dhcpcd-ui] / src / libdhcpcd / dhcpcd.c
index 3876d0ff7e54cb8948a052f14631cd2fe96588eb..601d58b6e546bfd7f25fe63ef6fcddd9ac1189c8 100644 (file)
@@ -292,7 +292,7 @@ dhcpcd_get_if(DHCPCD_CONNECTION *con, const char *ifname, const char *type)
 static DHCPCD_IF *
 dhcpcd_new_if(DHCPCD_CONNECTION *con, char *data, size_t len)
 {
-       const char *ifname, *reason, *type, *order, *flags;
+       const char *ifname, *ifclass, *reason, *type, *order, *flags;
        char *orderdup, *o, *p;
        DHCPCD_IF *e, *i, *l, *n, *nl;
        int ti;
@@ -307,6 +307,12 @@ dhcpcd_new_if(DHCPCD_CONNECTION *con, char *data, size_t len)
                errno = ESRCH;
                return NULL;
        }
+       ifclass = get_value(data, len, "ifclass=");
+       /* Skip pseudo interfaces */
+       if (ifclass && *ifclass != '\0') {
+               errno = ENOTSUP;
+               return NULL;
+       }
        if (strcmp(reason, "RECONFIGURE") == 0) {
                errno = ENOTSUP;
                return NULL;
@@ -786,6 +792,7 @@ dhcpcd_free(DHCPCD_CONNECTION *con)
 {
        DHCPCD_IF *nif;
        DHCPCD_WPA *nwpa;
+       DHCPCD_WI_HIST *nh;
 
        assert(con);
        while (con->interfaces) {
@@ -800,5 +807,10 @@ dhcpcd_free(DHCPCD_CONNECTION *con)
                free(con->wpa);
                con->wpa = nwpa;
        }
+       while (con->wi_history) {
+               nh = con->wi_history->next;
+               free(con->wi_history);
+               con->wi_history = nh;
+       }
        free(con);
 }