mirror of
https://github.com/yarrick/iodine.git
synced 2025-03-20 05:19:42 +00:00
Change to recv(), stop warning on close
This commit is contained in:
parent
43787fae12
commit
f2b27f868e
2 changed files with 4 additions and 4 deletions
4
dns.c
4
dns.c
|
@ -133,10 +133,8 @@ int
|
||||||
dns_read(int fd, char *buf, int len)
|
dns_read(int fd, char *buf, int len)
|
||||||
{
|
{
|
||||||
int r;
|
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) {
|
if (r < 0) {
|
||||||
perror("recvfrom");
|
perror("recvfrom");
|
||||||
}
|
}
|
||||||
|
|
2
dnstun.c
2
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);
|
i = select(MAX(tun_fd, dns_fd) + 1, &fds, NULL, NULL, &tv);
|
||||||
|
|
||||||
if(i < 0) {
|
if(i < 0) {
|
||||||
|
if (running) {
|
||||||
warn("select");
|
warn("select");
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue