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; }