mirror of
https://github.com/yarrick/iodine.git
synced 2024-12-23 05:43:32 +02:00
compiles on bsd
This commit is contained in:
parent
863dceb4cd
commit
d81d1c8bd7
3 changed files with 14 additions and 13 deletions
24
iodine.c
24
iodine.c
|
@ -21,6 +21,7 @@
|
|||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <err.h>
|
||||
|
@ -120,7 +121,7 @@ handshake(int dns_fd)
|
|||
|
||||
timeout = 1;
|
||||
|
||||
for (i=0;i<5;i++) {
|
||||
for (i=0; running && i<5 ;i++) {
|
||||
tv.tv_sec = timeout++;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
|
@ -139,18 +140,17 @@ handshake(int dns_fd)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (read == 0)
|
||||
continue;
|
||||
if (read > 0) {
|
||||
p = strchr(in, '-');
|
||||
if (p) {
|
||||
*p++ = '\0';
|
||||
mtu = atoi(p);
|
||||
|
||||
p = strchr(in, '-');
|
||||
if (p) {
|
||||
*p++ = '\0';
|
||||
mtu = atoi(p);
|
||||
|
||||
printf("%s %d\n", in, mtu);
|
||||
|
||||
if (tun_setip(in) == 0 && tun_setmtu(atoi(p)) == 0)
|
||||
return 0;
|
||||
if (tun_setip(in) == 0 && tun_setmtu(atoi(p)) == 0)
|
||||
return 0;
|
||||
else
|
||||
warn("Received handshake but b0rk");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <err.h>
|
||||
|
|
|
@ -28,7 +28,7 @@ struct query {
|
|||
char name[256];
|
||||
short type;
|
||||
short id;
|
||||
struct sockaddr_in from;
|
||||
struct sockaddr from;
|
||||
int fromlen;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue