From 83cd68c8ae7e4febbfbabd11172f7a2e2eef4368 Mon Sep 17 00:00:00 2001 From: "Timur I. Bakeyev" Date: Tue, 12 Jun 2018 04:38:00 +0800 Subject: [PATCH] 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 Reviewed-by: Andreas Schneider Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Wed Jun 13 03:51:04 CEST 2018 on sn-devel-144 --- lib/addns/dnssock.c | 4 +--- 1 file changed, 1 insertion(+), 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) {