summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimur I. Bakeyev <timur@iXsystems.com>2018-06-12 04:38:00 +0800
committerJeremy Allison <jra@samba.org>2018-06-13 03:51:04 +0200
commit83cd68c8ae7e4febbfbabd11172f7a2e2eef4368 (patch)
tree498812e2c7d145a91e353d20c5f73c055b3c5814
parent454edac226bc87b9e68bc60add4c16f4bab9c275 (diff)
downloadsamba-83cd68c8ae7e4febbfbabd11172f7a2e2eef4368.tar.gz
Fix UDP DNS queries in addns
The addns code tries to use common approach for TCP and UDP queries, calling connect() for both types of sockets. In case of UDP that requires to use send() instead of sendto(). Signed-off-by: Timur I. Bakeyev <timur@iXsystems.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jun 13 03:51:04 CEST 2018 on sn-devel-144
-rw-r--r--lib/addns/dnssock.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/addns/dnssock.c b/lib/addns/dnssock.c
index ec42b7ca689..30b8fa2eaf4 100644
--- a/lib/addns/dnssock.c
+++ b/lib/addns/dnssock.c
@@ -221,9 +221,7 @@ static DNS_ERROR dns_send_udp(struct dns_connection *conn,
ssize_t ret;
do {
- ret = sendto(conn->s, buf->data, buf->offset, 0,
- (struct sockaddr *)&conn->RecvAddr,
- sizeof(conn->RecvAddr));
+ ret = send(conn->s, buf->data, buf->offset, 0);
} while ((ret == -1) && (errno == EINTR));
if (ret != buf->offset) {