mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-22 16:19:20 +02:00
cleanup in dnstun.c
This commit is contained in:
parent
4b85a1ece2
commit
65a6847c3e
4
dnstun.c
4
dnstun.c
|
@ -67,9 +67,8 @@ tunnel(int tun_fd, int dns_fd)
|
||||||
}
|
}
|
||||||
|
|
||||||
FD_ZERO(&fds);
|
FD_ZERO(&fds);
|
||||||
if (!dns_sending()) {
|
if (!dns_sending())
|
||||||
FD_SET(tun_fd, &fds);
|
FD_SET(tun_fd, &fds);
|
||||||
}
|
|
||||||
FD_SET(dns_fd, &fds);
|
FD_SET(dns_fd, &fds);
|
||||||
|
|
||||||
i = select(MAX(tun_fd, dns_fd) + 1, &fds, NULL, NULL, &tv);
|
i = select(MAX(tun_fd, dns_fd) + 1, &fds, NULL, NULL, &tv);
|
||||||
|
@ -87,7 +86,6 @@ tunnel(int tun_fd, int dns_fd)
|
||||||
if(FD_ISSET(tun_fd, &fds)) {
|
if(FD_ISSET(tun_fd, &fds)) {
|
||||||
read = read_tun(tun_fd, frame, FRAMESIZE);
|
read = read_tun(tun_fd, frame, FRAMESIZE);
|
||||||
if (read > 0) {
|
if (read > 0) {
|
||||||
printf("%04x\n", frame->proto);
|
|
||||||
printf("Got data on tun! %d bytes\n", read);
|
printf("Got data on tun! %d bytes\n", read);
|
||||||
dns_handle_tun(dns_fd, frame->data, read - 4);
|
dns_handle_tun(dns_fd, frame->data, read - 4);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue