[LEDE-DEV] [PATCH mdns] Set TTL to the new value when updating cached service entry

John Crispin john at phrozen.org
Mon Feb 13 00:26:14 PST 2017



On 13/02/2017 08:43, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal at milecki.pl>
> 
> In the simplest case host may change TTL to some different value. It's
> the most important for the goodbye packets though.
> 
> Consider situation when host (for which we have no no cached entries)
> restarts. First it sends goodbye with TTL 0 (we cache it), then seconds
> later it announces with standard TTL values (but we keep TTL 0).
> It results in wrong cache state and could cause dropping valid entries.
> 
> Signed-off-by: Rafał Miłecki <rafal at milecki.pl>

Hi Rafał

its getting cumbersome so here is a wildcard ...

	Acked-by: John Crispin <john at phrozen.org>

feel free to automatically add this to your mdns patches after a grace
period of 24 hours. i will continue to review the patches and if i see
anything will opt-out.

	John



> ---
>  cache.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/cache.c b/cache.c
> index fa32465..6bf0d26 100644
> --- a/cache.c
> +++ b/cache.c
> @@ -143,6 +143,7 @@ cache_service(struct interface *iface, char *entry, int hlen, int ttl)
>  		if (!strcmp(s->entry, entry)) {
>  			s->refresh = 50;
>  			s->time = monotonic_time();
> +			s->ttl = ttl;
>  			return s;
>  		}
>  
> 



More information about the Lede-dev mailing list