Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <8884803.698a.176d2cac33c.Coremail.00107082@163.com>
Date: Tue, 5 Jan 2021 21:44:32 +0800 (CST)
From: 王志强 <00107082@....com>
To: musl@...ts.openwall.com
Subject: on aarch64, dns A/AAAA queries has high probability of having same
 dns transaction ID, causing 5s delay

Hi guys,
    I am having lots of dns 5s delay on a arm/aarch64 platform, after tcpdump capturing dns packages, I found that the delay always happened when A/AAAA queries  happened to have same dns transaction id. 



network/res_mkquery.c
...
    /* Make a reasonably unpredictable id */
    clock_gettime(CLOCK_REALTIME, &ts);
    id = ts.tv_nsec + ts.tv_nsec/65536UL & 0xffff;
    q[0] = id/256;
    q[1] = id;
...


time/clock_gettime.c
...
    r = __syscall(SYS_clock_gettime, clk, ts);
    if (r == -ENOSYS) {
        if (clk == CLOCK_REALTIME) {
            __syscall(SYS_gettimeofday, ts, 0);
            ts->tv_nsec = (int)ts->tv_nsec * 1000;
            return 0;
        }
        r = -EINVAL;
    }
    return __syscall_ret(r);
....


On aarch64, gettimeofday yields current time with low accuracy, the smallest unit is 1e-6, (I think)
Could we add some trick to make sure that the parallel A/AAAA queries got different  id?


Thanks
David

Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.