From f2b27f868e5fee605a6c9f4b3c7445f692b21354 Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Mon, 5 Jun 2006 15:22:29 +0000 Subject: [PATCH] Change to recv(), stop warning on close --- dns.c | 4 +--- dnstun.c | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dns.c b/dns.c index 031d0f4..f737b62 100644 --- a/dns.c +++ b/dns.c @@ -133,10 +133,8 @@ int dns_read(int fd, char *buf, int len) { int r; - int fromlen; - struct sockaddr_in from; - r = recvfrom(fd, buf, len, 0, (struct sockaddr*)&from, &fromlen); + r = recv(fd, buf, len, 0); if (r < 0) { perror("recvfrom"); } diff --git a/dnstun.c b/dnstun.c index 54fb172..835b14d 100644 --- a/dnstun.c +++ b/dnstun.c @@ -56,7 +56,9 @@ tunnel(int tun_fd, int dns_fd) i = select(MAX(tun_fd, dns_fd) + 1, &fds, NULL, NULL, &tv); if(i < 0) { - warn("select"); + if (running) { + warn("select"); + } return 1; }