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

John Crispin john at phrozen.org
Mon Mar 20 05:13:43 PDT 2017



On 20/03/17 12:54, Rafał Miłecki wrote:
> 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>
Acked-by: John Crispin <john at phrozen.org>

> ---
>   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);
>   	}
>   




More information about the Lede-dev mailing list