[LEDE-DEV] [PATCH umdns] Drop entries cached for interface we're going to delete

Rafał Miłecki zajec5 at gmail.com
Mon Mar 20 04:54:50 PDT 2017


From: Rafał Miłecki <rafal at milecki.pl>

Since we free memory with struct interface we can't keep
referencing/using it in cached records or services.

Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
 interface.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/interface.c b/interface.c
index a09e7ce..cde184b 100644
--- a/interface.c
+++ b/interface.c
@@ -34,6 +34,7 @@
 #include <libubox/uloop.h>
 #include <libubox/avl-cmp.h>
 #include <libubox/utils.h>
+#include "cache.h"
 #include "interface.h"
 #include "util.h"
 #include "dns.h"
@@ -519,6 +520,7 @@ iface_update_cb(struct vlist_tree *tree, struct vlist_node *node_new,
 
 	if (node_old) {
 		iface = container_of(node_old, struct interface, node);
+		cache_cleanup(iface);
 		interface_free(iface);
 	}
 
-- 
2.11.0




More information about the Lede-dev mailing list