- Version 1.0.14 not released yet
+Version 1.1-cvs Work in progress
+
+ * Use libevent to handle I/O events and timeouts.
+
+ * Use splay trees instead of AVL trees.
+
+ Version 1.0.14 May 8 2011
* Fixed reading configuration files that do not end with a newline. Again.
-This is the README file for tinc version 1.0.14. Installation
+This is the README file for tinc version 1.1-cvs. Installation
instructions may be found in the INSTALL file.
- tinc is Copyright (C) 1998-2010 by:
+ tinc is Copyright (C) 1998-2011 by:
Ivo Timmermans,
Guus Sliepen <guus@tinc-vpn.org>,
manual in doc/tinc.texi contains more detailed information on how to
install this library.
- Since 1.0pre6, the zlib library is used for optional compression. You need this
- library whether or not you plan to enable the compression. You can find it at
- http://www.gzip.org/zlib/. Because of a possible exploit in earlier versions we
- recommand that you download version 1.1.4 or later.
+ Since 1.0pre6, the zlib library is used for optional compression. You can
+ find it at http://www.gzip.org/zlib/. Because of a possible exploit in
+ earlier versions we recommend that you download version 1.1.4 or later.
- Since 1.0, the lzo library is also used for optional compression. You need this
- library whether or not you plan to enable compression. You can find it at
- http://www.oberhumer.com/opensource/lzo/.
+ Since 1.0, the lzo library is also used for optional compression. You can
+ find it at http://www.oberhumer.com/opensource/lzo/.
+Since 1.1, the libevent library is used for the main event loop. You can find
+it at http://monkey.org/~provos/libevent/.
+
In order to compile tinc, you will need a GNU C compiler environment.
dnl We do this in multiple stages, because unlike Linux all the other operating systems really suck and don't include their own dependencies.
AC_HEADER_STDC
- AC_CHECK_HEADERS([stdbool.h syslog.h sys/file.h sys/ioctl.h sys/mman.h sys/param.h sys/socket.h sys/time.h sys/uio.h sys/un.h sys/wait.h netdb.h arpa/inet.h dirent.h])
- AC_CHECK_HEADERS([net/if.h net/if_types.h linux/if_tun.h net/if_tun.h net/if_tap.h net/ethernet.h net/if_arp.h netinet/in_systm.h netinet/in.h netinet/in6.h time.h],
-AC_CHECK_HEADERS([stdbool.h syslog.h sys/file.h sys/ioctl.h sys/mman.h sys/param.h sys/resource.h sys/socket.h sys/time.h sys/uio.h sys/wait.h netdb.h arpa/inet.h dirent.h])
-AC_CHECK_HEADERS([net/if.h net/if_types.h linux/if_tun.h net/if_tun.h net/tun/if_tun.h net/if_tap.h net/tap/if_tap.h net/ethernet.h net/if_arp.h netinet/in_systm.h netinet/in.h netinet/in6.h],
++AC_CHECK_HEADERS([stdbool.h syslog.h sys/file.h sys/ioctl.h sys/mman.h sys/param.h sys/resource.h sys/socket.h sys/time.h sys/uio.h sys/un.h sys/wait.h netdb.h arpa/inet.h dirent.h])
++AC_CHECK_HEADERS([net/if.h net/if_types.h linux/if_tun.h net/if_tun.h net/tun/if_tun.h net/if_tap.h net/tap/if_tap.h net/ethernet.h net/if_arp.h netinet/in_systm.h netinet/in.h netinet/in6.h time.h],
[], [], [#include "have.h"]
)
AC_CHECK_HEADERS([netinet/if_ether.h netinet/ip.h netinet/ip6.h],
AC_FUNC_MEMCMP
AC_FUNC_ALLOCA
AC_TYPE_SIGNAL
- AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall putenv random select strdup strerror strsignal strtol system time unsetenv vsyslog writev],
-AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall putenv random select strdup strerror strsignal strtol system unsetenv usleep vsyslog writev],
++AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall putenv random select strdup strerror strsignal strtol system time usleep unsetenv vsyslog writev],
[], [], [#include "have.h"]
)
AC_FUNC_MALLOC
@page
@vskip 0pt plus 1filll
+@cindex copyright
This is the info manual for @value{PACKAGE} version @value{VERSION}, a Virtual Private Network daemon.
- Copyright @copyright{} 1998-2010 Ivo Timmermans,
+ Copyright @copyright{} 1998-2011 Ivo Timmermans,
Guus Sliepen <guus@@tinc-vpn.org> and
Wessel Dankers <wsl@@tinc-vpn.org>.
Set debug level to @var{level}. The higher the debug level, the more gets
logged. Everything goes via syslog.
-@item -k, --kill[=@var{signal}]
-Attempt to kill a running tincd (optionally with the specified @var{signal} instead of SIGTERM) and exit.
-Use it in conjunction with the -n option to make sure you kill the right tinc daemon.
-Under native Windows the optional argument is ignored,
-the service will always be stopped and removed.
-
@item -n, --net=@var{netname}
- Use configuration for net @var{netname}. @xref{Multiple networks}.
+ Use configuration for net @var{netname}.
+ This will let tinc read all configuration files from
+ @file{@value{sysconfdir}/tinc/@var{netname}/}.
+ Specifying . for @var{netname} is the same as not specifying any @var{netname}.
+ @xref{Multiple networks}.
-@item -K, --generate-keys[=@var{bits}]
-Generate public/private keypair of @var{bits} length. If @var{bits} is not specified,
-2048 is the default. tinc will ask where you want to store the files,
-but will default to the configuration directory (you can use the -c or -n option
-in combination with -K). After that, tinc will quit.
+@item --controlsocket=@var{filename}
+Open control socket at @var{filename}. If unspecified, the default is
+@file{@value{localstatedir}/run/tinc.@var{netname}.control}.
@item -L, --mlock
Lock tinc into main memory.
.It Fl n, -net Ns = Ns Ar NETNAME
Connect to net
.Ar NETNAME .
-.It Fl K, -generate-keys Ns Op = Ns Ar BITS
-Generate public/private RSA keypair and exit.
-If
-.Ar BITS
-is omitted, the default length will be 2048 bits.
-When saving keys to existing files, tinc will not delete the old keys,
-you have to remove them manually.
+ This will let tinc read all configuration files from
+ .Pa @sysconfdir@/tinc/ Ar NETNAME .
+ Specifying
+ .Li .
+ for
+ .Ar NETNAME
+ is the same as not specifying any
+ .Ar NETNAME .
.It Fl L, -mlock
Lock tinc into main memory.
This will prevent sensitive data like shared private keys to be written to the system swap files/partitions.
#ifdef HAVE_TUNEMU
case DEVICE_TYPE_TUNEMU:
if(device_type == DEVICE_TYPE_TUNEMU)
- lenin = tunemu_read(device_fd, packet->data + 14, MTU - 14);
+ inlen = tunemu_read(device_fd, packet->data + 14, MTU - 14);
else
- #else
- inlen = read(device_fd, packet->data + 14, MTU - 14);
#endif
- lenin = read(device_fd, packet->data + 14, MTU - 14);
++ inlen = read(device_fd, packet->data + 14, MTU - 14);
- if(lenin <= 0) {
+ if(inlen <= 0) {
logger(LOG_ERR, "Error while reading from %s %s: %s", device_info,
device, strerror(errno));
return false;
}
static node_t *try_harder(const sockaddr_t *from, const vpn_packet_t *pkt) {
- avl_node_t *node;
+ splay_node_t *node;
- node_t *n, *found = NULL;
+ edge_t *e;
+ node_t *n = NULL;
+ bool hard = false;
static time_t last_hard_try = 0;
+ time_t now = time(NULL);
+
+ if(last_hard_try == now)
+ return NULL;
+ else
+ last_hard_try = now;
- for(node = node_tree->head; node; node = node->next) {
- n = node->data;
+ for(node = edge_weight_tree->head; node; node = node->next) {
+ e = node->data;
- if(n == myself || !n->status.reachable || !digest_active(&n->indigest))
+ if(e->to == myself)
continue;
- if(try_mac(n, pkt)) {
- found = n;
- break;
+ if(sockaddrcmp_noport(from, &e->address)) {
+ if(last_hard_try == now)
+ continue;
+ hard = true;
}
+
+ if(!try_mac(e->to, pkt))
+ continue;
+
+ n = e->to;
+ break;
}
- return found;
+ if(hard)
+ last_hard_try = now;
+
+ return n;
}
-void handle_incoming_vpn_data(int sock) {
+void handle_incoming_vpn_data(int sock, short events, void *data) {
vpn_packet_t pkt;
char *hostname;
sockaddr_t from;
}
void update_node_udp(node_t *n, const sockaddr_t *sa) {
- avl_delete(node_udp_tree, n);
+ if(n == myself) {
+ logger(LOG_WARNING, "Trying to update UDP address of myself!\n");
+ return;
+ }
+
+ splay_delete(node_udp_tree, n);
if(n->hostname)
free(n->hostname);
{SIGBUS, fatal_signal_handler},
{SIGILL, fatal_signal_handler},
{SIGPIPE, ignore_signal_handler},
- {SIGINT, sigint_handler},
- {SIGUSR1, sigusr1_handler},
- {SIGUSR2, sigusr2_handler},
{SIGCHLD, ignore_signal_handler},
- {SIGALRM, sigalrm_handler},
- {SIGWINCH, sigwinch_handler},
+ {SIGABRT, SIG_DFL},
{0, NULL}
};
#endif