diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-03-31 07:37:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-03-31 07:37:43 +0000 |
commit | 759ea409fe884c184d51f81c73523015a468a1eb (patch) | |
tree | df4ba82f4118a4ac46c34a262f87f8ec26fdd240 /src/dns.c | |
parent | Adding upstream version 2.5.0+debian. (diff) | |
download | dnsperf-759ea409fe884c184d51f81c73523015a468a1eb.tar.xz dnsperf-759ea409fe884c184d51f81c73523015a468a1eb.zip |
Adding upstream version 2.5.2.upstream/2.5.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/dns.c')
-rw-r--r-- | src/dns.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -146,6 +146,17 @@ perf_result_t perf_qtype_fromstring(const char* str, size_t len, perf_buffer_t* { const perf_qtype_t* q = qtype_table; + if (len > 4 && !strncasecmp(str, "TYPE", 4)) { + char* endptr = 0; + unsigned long int u = strtoul(str + 4, &endptr, 10); + if (endptr != str + len || u == ULONG_MAX || u > 65535) { + return PERF_R_FAILURE; + } + + perf_buffer_putuint16(target, u); + return PERF_R_SUCCESS; + } + while (q->type) { if (!strncasecmp(q->type, str, len)) { perf_buffer_putuint16(target, q->value); |