summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiek Gieben <miekg@NLnetLabs.nl>2006-06-14 09:05:39 +0200
committerMiek Gieben <miekg@NLnetLabs.nl>2006-06-14 09:05:39 +0200
commit2e9d81f56a32d970e016d47f9ca14913319ebf59 (patch)
treebcb6a9bebe0793a8c23f269f597d49df44303ce2
parent6e6884fb941d467b4910515838df8cf55e96dc9f (diff)
downloadldns-1.0.x.tar.gz
fix the bug reported on the mailing list1.0.x
(should actually be send to jelte with email, but this is the time being somewhat more convient)
-rw-r--r--Changelog4
-rw-r--r--ldns/rr.h2
-rw-r--r--net.c4
3 files changed, 8 insertions, 2 deletions
diff --git a/Changelog b/Changelog
index 2cb81405..85217726 100644
--- a/Changelog
+++ b/Changelog
@@ -1,5 +1,7 @@
Mar 2006: 1.0.2: ldns-team
- * Some fixes from trunk are backported to this branch
+ * Some fixes from trunk were backported to this branch
+ * Close the socket in ldns_udp_send after using it
+ * Add LDNS_RR_CLASS_NONE to the enum in rr.h
03 Jan 2006: 1.0.1: ldns-team
diff --git a/ldns/rr.h b/ldns/rr.h
index 885ea602..1f444915 100644
--- a/ldns/rr.h
+++ b/ldns/rr.h
@@ -39,6 +39,8 @@ enum ldns_enum_rr_class
LDNS_RR_CLASS_CH = 3,
/** Hesiod (Dyer 87) */
LDNS_RR_CLASS_HS = 4,
+ /** None class (dynamic updates) */
+ LDNS_RR_CLASS_NONE = 254,
/** Any class */
LDNS_RR_CLASS_ANY = 255,
diff --git a/net.c b/net.c
index dc286383..57050b39 100644
--- a/net.c
+++ b/net.c
@@ -189,12 +189,14 @@ ldns_udp_send(uint8_t **result, ldns_buffer *qbin, const struct sockaddr_storage
}
if (ldns_udp_send_query(qbin, sockfd, to, tolen) == 0) {
+ close(sockfd);
return LDNS_STATUS_ERR;
}
/* wait for an response*/
answer = ldns_udp_read_wire(sockfd, answer_size, NULL, NULL);
+ close(sockfd);
/* resize accordingly */
answer = (uint8_t*)LDNS_XREALLOC(answer, uint8_t *, (size_t)*answer_size);
@@ -206,7 +208,7 @@ ldns_udp_send(uint8_t **result, ldns_buffer *qbin, const struct sockaddr_storage
/*
* ldns_tcp_server_connect
*
- * and the normal conetc, for just a socket
+ * and the normal connect, for just a socket
*/
int
ldns_udp_server_connect(const struct sockaddr_storage *to, struct timeval timeout)