1
0
mirror of https://github.com/yarrick/iodine.git synced 2024-11-22 21:16:07 +03:00

compiles on bsd

This commit is contained in:
Bjorn Andersson 2006-06-11 19:54:38 +00:00
parent 863dceb4cd
commit d81d1c8bd7
3 changed files with 14 additions and 13 deletions

View File

@ -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");
}
}
}

View File

@ -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>

View File

@ -28,7 +28,7 @@ struct query {
char name[256];
short type;
short id;
struct sockaddr_in from;
struct sockaddr from;
int fromlen;
};