mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-26 07:51:27 +00:00
tun hanterar frames och packet skickas ut p tun ok
This commit is contained in:
parent
f436823146
commit
efc2ec5665
3
dnstun.c
3
dnstun.c
|
@ -88,6 +88,9 @@ tunnel(int tun_fd, int dns_fd)
|
||||||
read = dns_read(dns_fd, frame->data, FRAMESIZE-4);
|
read = dns_read(dns_fd, frame->data, FRAMESIZE-4);
|
||||||
if (read > 0) {
|
if (read > 0) {
|
||||||
printf("Got data on dns! %d bytes\n", read);
|
printf("Got data on dns! %d bytes\n", read);
|
||||||
|
|
||||||
|
frame->flags = 0x0000;
|
||||||
|
frame->proto = 0x0800;
|
||||||
write_tun(tun_fd, frame, read + 4);
|
write_tun(tun_fd, frame, read + 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,11 +76,14 @@ tunnel(int tun_fd, int dns_fd)
|
||||||
}
|
}
|
||||||
if(FD_ISSET(dns_fd, &fds)) {
|
if(FD_ISSET(dns_fd, &fds)) {
|
||||||
read = dnsd_read(dns_fd, frame->data, 64*1024-4);
|
read = dnsd_read(dns_fd, frame->data, 64*1024-4);
|
||||||
if(read > 0)
|
if(read > 0) {
|
||||||
|
frame->flags = 0x0000;
|
||||||
|
frame->proto = 0x0800;
|
||||||
write_tun(tun_fd, frame, read + 4);
|
write_tun(tun_fd, frame, read + 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
free(frame);
|
free(frame);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue