union in_addr_union sender, destination;
uint16_t sender_port, destination_port;
uint32_t ttl;
+ usec_t timestamp; /* CLOCK_BOOTTIME (or CLOCK_MONOTONIC if the former doesn't exist) */
/* For support of truncated packets */
DnsPacket *more;
s->read_packet->family = s->peer.sa.sa_family;
s->read_packet->ttl = s->ttl;
s->read_packet->ifindex = s->ifindex;
+ s->read_packet->timestamp = now(clock_boottime_or_monotonic());
if (s->read_packet->family == AF_INET) {
s->read_packet->sender.in = s->peer.in.sin_addr;
}
void dns_transaction_process_reply(DnsTransaction *t, DnsPacket *p) {
- usec_t ts;
int r;
assert(t);
}
}
- assert_se(sd_event_now(t->scope->manager->event, clock_boottime_or_monotonic(), &ts) >= 0);
-
switch (t->scope->protocol) {
case DNS_PROTOCOL_DNS:
case DNS_PROTOCOL_LLMNR:
case DNS_PROTOCOL_MDNS:
- dns_scope_packet_received(t->scope, ts - t->start_usec);
+ dns_scope_packet_received(t->scope, p->timestamp - t->start_usec);
break;
default:
} else
return -EAFNOSUPPORT;
+ p->timestamp = now(clock_boottime_or_monotonic());
+
CMSG_FOREACH(cmsg, &mh) {
if (cmsg->cmsg_level == IPPROTO_IPV6) {