From b1af23ebeaa65353a8de27279bc00372cf10d359 Mon Sep 17 00:00:00 2001 From: Thiago Farina Date: Wed, 20 Jan 2016 23:46:34 +0100 Subject: [PATCH] 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 Signed-off-by: Baptiste Assmann --- include/proto/dns.h | 2 +- src/dns.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/proto/dns.h b/include/proto/dns.h index 80887e86c3..4ccbfa0c7b 100644 --- a/include/proto/dns.h +++ b/include/proto/dns.h @@ -44,6 +44,6 @@ void dns_print_current_resolutions(struct dns_resolvers *resolvers); 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 1348be3d97..0d8d305c6d 100644 --- a/src/dns.c +++ b/src/dns.c @@ -796,7 +796,7 @@ int dns_get_ip_from_response(unsigned char *resp, unsigned char *resp_end, /* * 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];