mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Gregor Jasny <gjasny@googlemail.com>
To: musl@lists.openwall.com
Subject: [musl] Prefer monotonic clock for DNS lookup timeouts
Date: Thu, 1 Dec 2022 12:24:47 +0100	[thread overview]
Message-ID: <d2b8da74-9b8f-3a49-abf4-ffbe88c04a30@googlemail.com> (raw)

Hello,

while looking for a reason for a failed DNS resolve I noticed that
the mtime function which is used to calculate and decide on the timeout 
uses the wall clock instead of a monotonic clock:

static unsigned long mtime()
{
	struct timespec ts;
	clock_gettime(CLOCK_REALTIME, &ts);
	return (unsigned long)ts.tv_sec * 1000
		+ ts.tv_nsec / 1000000;
}

http://git.musl-libc.org/cgit/musl/tree/src/network/res_msend.c#n28

Is this a bug or intentional?

Thanks,
Gregor

             reply	other threads:[~2022-12-01 14:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01 11:24 Gregor Jasny [this message]
2022-12-01 15:11 ` Rich Felker
2022-12-30  3:20   ` A. Wilcox
2022-12-30  3:21     ` [musl] [PATCH] dns: " A. Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2b8da74-9b8f-3a49-abf4-ffbe88c04a30@googlemail.com \
    --to=gjasny@googlemail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).