MINOR: fix the return type for dns_response_get_query_id() function
This function should return a 16-bit type as that is the type for
dns header id.
Also because it is doing an uint16 unpack big-endian operation.
Backport: can be backported to 1.6
Signed-off-by: Thiago Farina <tfarina@chromium.org>
Signed-off-by: Baptiste Assmann <bedis9@gmail.com>
diff --git a/include/proto/dns.h b/include/proto/dns.h
index 80887e8..4ccbfa0 100644
--- a/include/proto/dns.h
+++ b/include/proto/dns.h
@@ -44,6 +44,6 @@
void dns_update_resolvers_timeout(struct dns_resolvers *resolvers);
void dns_reset_resolution(struct dns_resolution *resolution);
int dns_check_resolution_queue(struct dns_resolvers *resolvers);
-int dns_response_get_query_id(unsigned char *resp);
+unsigned short dns_response_get_query_id(unsigned char *resp);
#endif // _PROTO_DNS_H
diff --git a/src/dns.c b/src/dns.c
index 1348be3..0d8d305 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -796,7 +796,7 @@
/*
* returns the query id contained in a DNS response
*/
-int dns_response_get_query_id(unsigned char *resp)
+unsigned short dns_response_get_query_id(unsigned char *resp)
{
/* read the query id from the response */
return resp[0] * 256 + resp[1];