mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-28 20:45:12 +00:00
Now starts when no non-loopback interfaces configured
This commit is contained in:
parent
98da57ba74
commit
c83a52c771
@ -283,6 +283,8 @@ main(int argc, char **argv)
|
|||||||
bind_fd = 0;
|
bind_fd = 0;
|
||||||
mtu = 1130; /* Very many relays give fragsize 1150 or slightly
|
mtu = 1130; /* Very many relays give fragsize 1150 or slightly
|
||||||
higher for NULL; tun/zlib adds ~17 bytes. */
|
higher for NULL; tun/zlib adds ~17 bytes. */
|
||||||
|
dns4addr_len = 0;
|
||||||
|
dns6addr_len = 0;
|
||||||
listen_ip4 = NULL;
|
listen_ip4 = NULL;
|
||||||
listen_ip6 = NULL;
|
listen_ip6 = NULL;
|
||||||
port = 53;
|
port = 53;
|
||||||
@ -447,17 +449,20 @@ main(int argc, char **argv)
|
|||||||
foreground = 1;
|
foreground = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
dns4addr_len = get_addr(listen_ip4, port, AF_INET, AI_PASSIVE | AI_NUMERICHOST, &dns4addr);
|
if (addrfamily == AF_UNSPEC || addrfamily == AF_INET) {
|
||||||
if (dns4addr_len < 0) {
|
dns4addr_len = get_addr(listen_ip4, port, AF_INET, AI_PASSIVE | AI_NUMERICHOST, &dns4addr);
|
||||||
warnx("Bad IPv4 address to listen on.");
|
if (dns4addr_len < 0) {
|
||||||
usage();
|
warnx("Bad IPv4 address to listen on.");
|
||||||
|
usage();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dns6addr_len = get_addr(listen_ip6, port, AF_INET6, AI_PASSIVE | AI_NUMERICHOST, &dns6addr);
|
if (addrfamily == AF_UNSPEC || addrfamily == AF_INET6) {
|
||||||
if (dns6addr_len < 0) {
|
dns6addr_len = get_addr(listen_ip6, port, AF_INET6, AI_PASSIVE | AI_NUMERICHOST, &dns6addr);
|
||||||
warnx("Bad IPv6 address to listen on.");
|
if (dns6addr_len < 0) {
|
||||||
usage();
|
warnx("Bad IPv6 address to listen on.");
|
||||||
|
usage();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bind_enable) {
|
if(bind_enable) {
|
||||||
in_addr_t dns_ip = ((struct sockaddr_in *) &dns4addr)->sin_addr.s_addr;
|
in_addr_t dns_ip = ((struct sockaddr_in *) &dns4addr)->sin_addr.s_addr;
|
||||||
if (bind_port < 1 || bind_port > 65535) {
|
if (bind_port < 1 || bind_port > 65535) {
|
||||||
|
Loading…
Reference in New Issue
Block a user