Skip to content

Commit 4347590

Browse files
committed
resolved: drop timestamp parameter to dns_cache_put() we don't ever pass
1 parent 30ee707 commit 4347590

File tree

4 files changed

+3
-6
lines changed

4 files changed

+3
-6
lines changed

src/resolve/resolved-dns-cache.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,6 @@ int dns_cache_put(
672672
bool authenticated,
673673
DnssecResult dnssec_result,
674674
uint32_t nsec_ttl,
675-
usec_t timestamp,
676675
int owner_family,
677676
const union in_addr_union *owner_address) {
678677

@@ -681,6 +680,7 @@ int dns_cache_put(
681680
DnsAnswerItem *item;
682681
DnsAnswerFlags flags;
683682
unsigned cache_keys;
683+
usec_t timestamp;
684684
int r;
685685

686686
assert(c);
@@ -721,8 +721,7 @@ int dns_cache_put(
721721
/* Make some space for our new entries */
722722
dns_cache_make_space(c, cache_keys);
723723

724-
if (timestamp <= 0)
725-
timestamp = now(clock_boottime_or_monotonic());
724+
timestamp = now(clock_boottime_or_monotonic());
726725

727726
/* Second, add in positive entries for all contained RRs */
728727
DNS_ANSWER_FOREACH_ITEM(item, answer) {

src/resolve/resolved-dns-cache.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ int dns_cache_put(
3333
bool authenticated,
3434
DnssecResult dnssec_result,
3535
uint32_t nsec_ttl,
36-
usec_t timestamp,
3736
int owner_family,
3837
const union in_addr_union *owner_address);
3938

src/resolve/resolved-dns-transaction.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,6 @@ static void dns_transaction_cache_answer(DnsTransaction *t) {
771771
t->answer_authenticated,
772772
t->answer_dnssec_result,
773773
t->answer_nsec_ttl,
774-
0,
775774
t->received->family,
776775
&t->received->sender);
777776
}

src/resolve/resolved-mdns.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ static int on_mdns_packet(sd_event_source *s, int fd, uint32_t revents, void *us
319319
dns_transaction_process_reply(t, p);
320320
}
321321

322-
dns_cache_put(&scope->cache, scope->manager->enable_cache, NULL, DNS_PACKET_RCODE(p), p->answer, NULL, 0, _DNSSEC_RESULT_INVALID, (uint32_t) -1, 0, p->family, &p->sender);
322+
dns_cache_put(&scope->cache, scope->manager->enable_cache, NULL, DNS_PACKET_RCODE(p), p->answer, NULL, false, _DNSSEC_RESULT_INVALID, (uint32_t) -1, p->family, &p->sender);
323323

324324
} else if (dns_packet_validate_query(p) > 0) {
325325
log_debug("Got mDNS query packet for id %u", DNS_PACKET_ID(p));

0 commit comments

Comments
 (0)