Browse code

dns_cache: dns.view RPC command fix

Do not print out the expiration time of the resource
records in a permanent cache entry, they never expire.

Miklos Tirpak authored on 17/06/2010 09:01:31
Showing 1 changed files
... ...
@@ -3868,7 +3868,8 @@ void dns_cache_print_entry(rpc_t* rpc, void* ctx, struct dns_hash_entry* e)
3868 3868
 				rpc->printf(ctx, "%sresource record: unknown",
3869 3869
 									SPACE_FORMAT);
3870 3870
 		}
3871
-		rpc->printf(ctx, "%srr expires in (s): %d", SPACE_FORMAT,
3871
+		if ((e->ent_flags & DNS_FLAG_PERMANENT) == 0)
3872
+			rpc->printf(ctx, "%srr expires in (s): %d", SPACE_FORMAT,
3872 3873
 						(s_ticks_t)(rr->expire-now)<0?-1 : 
3873 3874
 						TICKS_TO_S(rr->expire-now));
3874 3875
 	}