mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-08 08:07:10 +02:00
BUG/MINOR: warning: ‘need_resend’ may be used uninitialized
The commit 201c07f68
("MAJOR/REORG: dns: DNS resolution task and
requester queues") introduces a warning during compilation:
src/dns.c: In function ‘dns_resolve_recv’:
src/dns.c:487:6: warning: ‘need_resend’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (need_resend) {
^
This patch initialize the variable and remove the comment about it.
This commit is contained in:
parent
cf4e496c9c
commit
cc9b94ac94
@ -322,7 +322,7 @@ void dns_resolve_recv(struct dgram_conn *dgram)
|
|||||||
struct dns_query_item *query;
|
struct dns_query_item *query;
|
||||||
unsigned char buf[DNS_MAX_UDP_MESSAGE + 1];
|
unsigned char buf[DNS_MAX_UDP_MESSAGE + 1];
|
||||||
unsigned char *bufend;
|
unsigned char *bufend;
|
||||||
int fd, buflen, dns_resp, need_resend;
|
int fd, buflen, dns_resp, need_resend = 0;
|
||||||
unsigned short query_id;
|
unsigned short query_id;
|
||||||
struct eb32_node *eb;
|
struct eb32_node *eb;
|
||||||
struct lru64 *lru = NULL;
|
struct lru64 *lru = NULL;
|
||||||
@ -387,12 +387,6 @@ void dns_resolve_recv(struct dgram_conn *dgram)
|
|||||||
|
|
||||||
dns_resp = dns_validate_dns_response(buf, bufend, resolution);
|
dns_resp = dns_validate_dns_response(buf, bufend, resolution);
|
||||||
|
|
||||||
/* treat errors first
|
|
||||||
* need_resend flag could be set to 0 by default before the 'switch' and then
|
|
||||||
* set to 1 only where needed, but I think it's better this way to make people
|
|
||||||
* aware they have to think twice how to set this flag when updating this portion
|
|
||||||
* of the code
|
|
||||||
*/
|
|
||||||
switch (dns_resp) {
|
switch (dns_resp) {
|
||||||
case DNS_RESP_VALID:
|
case DNS_RESP_VALID:
|
||||||
need_resend = 0;
|
need_resend = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user