mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-27 03:55:09 +00:00
Add support for openbsd routing domain, #95
This commit is contained in:
parent
cf40787371
commit
312e228b1b
@ -33,6 +33,8 @@ CHANGES:
|
|||||||
- Fix DNS tunneling bug caused by uninitialized variable, #94
|
- Fix DNS tunneling bug caused by uninitialized variable, #94
|
||||||
- Handle spaces when entering password interactively, fixes #93.
|
- Handle spaces when entering password interactively, fixes #93.
|
||||||
Patch by Hagar.
|
Patch by Hagar.
|
||||||
|
- Add -R option to set OpenBSD routing domain for the DNS socket.
|
||||||
|
Patch by laurent at gouloum fr, fixes #95.
|
||||||
|
|
||||||
2009-06-01: 0.5.2 "WifiFree"
|
2009-06-01: 0.5.2 "WifiFree"
|
||||||
- Fixed client segfault on OS X, #57
|
- Fixed client segfault on OS X, #57
|
||||||
|
@ -17,6 +17,8 @@ iodine, iodined \- tunnel IPv4 over DNS
|
|||||||
.I chrootdir
|
.I chrootdir
|
||||||
.B ] [-d
|
.B ] [-d
|
||||||
.I device
|
.I device
|
||||||
|
.B ] [-R
|
||||||
|
.I rdomain
|
||||||
.B ] [-m
|
.B ] [-m
|
||||||
.I fragsize
|
.I fragsize
|
||||||
.B ] [-M
|
.B ] [-M
|
||||||
@ -129,6 +131,9 @@ Skip raw UDP mode. If not used, iodine will try getting the public IP address
|
|||||||
of the iodined host and test if it is reachable directly. If it is, traffic
|
of the iodined host and test if it is reachable directly. If it is, traffic
|
||||||
will be sent to the server instead of the DNS relay.
|
will be sent to the server instead of the DNS relay.
|
||||||
.TP
|
.TP
|
||||||
|
.B -R rdomain
|
||||||
|
Use OpenBSD routing domain 'rdomain' for the DNS connection.
|
||||||
|
.TP
|
||||||
.B -m fragsize
|
.B -m fragsize
|
||||||
Force maximum downstream fragment size. Not setting this will cause the
|
Force maximum downstream fragment size. Not setting this will cause the
|
||||||
client to automatically probe the maximum accepted downstream fragment size.
|
client to automatically probe the maximum accepted downstream fragment size.
|
||||||
|
10
src/iodine.c
10
src/iodine.c
@ -132,6 +132,7 @@ main(int argc, char **argv)
|
|||||||
int lazymode;
|
int lazymode;
|
||||||
int selecttimeout;
|
int selecttimeout;
|
||||||
int hostname_maxlen;
|
int hostname_maxlen;
|
||||||
|
int rtable = 0;
|
||||||
|
|
||||||
nameserv_addr = NULL;
|
nameserv_addr = NULL;
|
||||||
topdomain = NULL;
|
topdomain = NULL;
|
||||||
@ -170,7 +171,7 @@ main(int argc, char **argv)
|
|||||||
__progname++;
|
__progname++;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while ((choice = getopt(argc, argv, "vfhru:t:d:P:m:M:F:T:O:L:I:")) != -1) {
|
while ((choice = getopt(argc, argv, "vfhru:t:d:R:P:m:M:F:T:O:L:I:")) != -1) {
|
||||||
switch(choice) {
|
switch(choice) {
|
||||||
case 'v':
|
case 'v':
|
||||||
version();
|
version();
|
||||||
@ -194,6 +195,9 @@ main(int argc, char **argv)
|
|||||||
case 'd':
|
case 'd':
|
||||||
device = optarg;
|
device = optarg;
|
||||||
break;
|
break;
|
||||||
|
case 'R':
|
||||||
|
rtable = atoi(optarg);
|
||||||
|
break;
|
||||||
case 'P':
|
case 'P':
|
||||||
strncpy(password, optarg, sizeof(password));
|
strncpy(password, optarg, sizeof(password));
|
||||||
password[sizeof(password)-1] = 0;
|
password[sizeof(password)-1] = 0;
|
||||||
@ -321,6 +325,10 @@ main(int argc, char **argv)
|
|||||||
retval = 1;
|
retval = 1;
|
||||||
goto cleanup2;
|
goto cleanup2;
|
||||||
}
|
}
|
||||||
|
#ifdef OPENBSD
|
||||||
|
if (rtable > 0)
|
||||||
|
socket_setrtable(dns_fd, rtable);
|
||||||
|
#endif
|
||||||
|
|
||||||
signal(SIGINT, sighandler);
|
signal(SIGINT, sighandler);
|
||||||
signal(SIGTERM, sighandler);
|
signal(SIGTERM, sighandler);
|
||||||
|
@ -67,3 +67,11 @@ get_resolvconf_addr()
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef OPENBSD
|
||||||
|
void
|
||||||
|
socket_setrtable(int fd, int rtable)
|
||||||
|
{
|
||||||
|
if (setsockopt (fd, IPPROTO_IP, SO_RTABLE, &rtable, sizeof(rtable)) == -1)
|
||||||
|
err(1, "Failed to set routing table %d", rtable);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@ -2,5 +2,6 @@
|
|||||||
#define __UTIL_H__
|
#define __UTIL_H__
|
||||||
|
|
||||||
char *get_resolvconf_addr();
|
char *get_resolvconf_addr();
|
||||||
|
void socket_setrtable(int fd, int rtable);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user