Add inline fls() function for linux
[project/netifd.git] / interface-ip.c
index 2a26a4a..b86acb5 100644 (file)
@@ -5,6 +5,7 @@
 #include "netifd.h"
 #include "device.h"
 #include "interface.h"
+#include "interface-ip.h"
 #include "proto.h"
 #include "ubus.h"
 #include "system.h"
@@ -33,6 +34,7 @@ void interface_del_address(struct interface *iface, struct device_addr *addr)
 
        list_del(&addr->list);
        system_del_address(iface->l3_iface->dev, addr);
+       free(addr);
 }
 
 void interface_del_ctx_addr(struct interface *iface, void *ctx)
@@ -57,6 +59,8 @@ void interface_del_route(struct interface *iface, struct device_route *route)
 {
        list_del(&route->list);
        system_del_route(iface->l3_iface->dev, route);
+       if (!route->keep)
+               free(route);
 }
 
 void interface_del_all_routes(struct interface *iface)