summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-01-02 23:58:03 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2021-01-02 23:58:03 +0000
commit22bd0404f255d4013ad2dae1438906d5e90cfc14 (patch)
tree2ff5028989d4f11eac58f94db1718863a501c61d /src
parentce53786b57c1fcbdf33227b0db0ef3bf43c76880 (diff)
downloads6-dns-22bd0404f255d4013ad2dae1438906d5e90cfc14.tar.xz
Prepare for 2.3.4.0
Diffstat (limited to 'src')
-rw-r--r--src/libs6dns/s6dns_message_parse_question.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libs6dns/s6dns_message_parse_question.c b/src/libs6dns/s6dns_message_parse_question.c
index 170168c..780ec22 100644
--- a/src/libs6dns/s6dns_message_parse_question.c
+++ b/src/libs6dns/s6dns_message_parse_question.c
@@ -8,15 +8,19 @@
#include <s6-dns/s6dns-constants.h>
#include <s6-dns/s6dns-message.h>
-int s6dns_message_parse_question (s6dns_message_counts_t *counts, s6dns_domain_t *name, uint16_t *qtype, char const *packet, unsigned int packetlen, unsigned int *pos)
+int s6dns_message_parse_question (s6dns_message_counts_t *counts, s6dns_domain_t *name, uint16_t *qtypep, char const *packet, unsigned int packetlen, unsigned int *pos)
{
+ s6dns_domain_t d ;
+ uint16_t qtype ;
uint16_t qclass ;
if (!counts->qd) return (errno = EINVAL, 0) ;
- if (!s6dns_message_get_domain(name, packet, packetlen, pos)) return 0 ;
+ if (!s6dns_message_get_domain(&d, packet, packetlen, pos)) return 0 ;
if (*pos + 4 > packetlen) return (errno = EPROTO, 0) ;
- uint16_unpack_big(packet + *pos, qtype) ; *pos += 2 ;
+ uint16_unpack_big(packet + *pos, &qtype) ; *pos += 2 ;
uint16_unpack_big(packet + *pos, &qclass) ; *pos += 2 ;
if (qclass != S6DNS_C_IN) return (errno = ENOTSUP, 0) ;
counts->qd-- ;
+ *name = d ;
+ *qtypep = qtype ;
return 1 ;
}