tinc
12 years agoReleasing 1.1pre1. release-1.1pre1
Guus Sliepen [Sat, 25 Jun 2011 13:28:54 +0000 (15:28 +0200)]
Releasing 1.1pre1.

12 years agoEnsure that the texinfo manual can be converted to HTML.
Guus Sliepen [Sat, 25 Jun 2011 13:28:13 +0000 (15:28 +0200)]
Ensure that the texinfo manual can be converted to HTML.

Somehow commit 2c30af6c90926340a89748c63cc453b1c0b5a589 was not properly
merged.

12 years agoUpdate manpages and info manual.
Guus Sliepen [Sat, 25 Jun 2011 12:52:47 +0000 (14:52 +0200)]
Update manpages and info manual.

12 years agoAdd Makefile.am in gui/.
Guus Sliepen [Fri, 24 Jun 2011 22:32:45 +0000 (00:32 +0200)]
Add Makefile.am in gui/.

This ensures the gui source will be included in the tarball with make dist,
and will be installed with make install.

12 years agoDon't use AM_CONDITIONAL for CURSES.
Guus Sliepen [Fri, 24 Jun 2011 22:06:06 +0000 (00:06 +0200)]
Don't use AM_CONDITIONAL for CURSES.

For some reason, this doesn't work when cross-compiling for Windows.

12 years agoDon't call event_del() from the mtuevent handler, always send_mtu_probe() in ans_key_h().
Guus Sliepen [Fri, 24 Jun 2011 20:49:18 +0000 (22:49 +0200)]
Don't call event_del() from the mtuevent handler, always send_mtu_probe() in ans_key_h().

12 years agoDelete mtuevent if it is not used.
Guus Sliepen [Fri, 24 Jun 2011 20:10:03 +0000 (22:10 +0200)]
Delete mtuevent if it is not used.

Keeping it around prevents ans_key_h() from restarting PMTU discovery.

12 years agoMerge branch 'master' of git://tinc-vpn.org/tinc into 1.1
Guus Sliepen [Fri, 24 Jun 2011 19:40:55 +0000 (21:40 +0200)]
Merge branch 'master' of git://tinc-vpn.org/tinc into 1.1

Conflicts:
NEWS
README
configure.in
src/Makefile.am

12 years agoReleasing 1.0.15. release-1.0.15
Guus Sliepen [Fri, 24 Jun 2011 12:50:20 +0000 (14:50 +0200)]
Releasing 1.0.15.

12 years agoRemove redundant @CFLAGS@ from AM_CFLAGS.
Guus Sliepen [Fri, 24 Jun 2011 10:27:04 +0000 (12:27 +0200)]
Remove redundant @CFLAGS@ from AM_CFLAGS.

12 years agoNo need to check for pselect() in tinc 1.1.
Guus Sliepen [Tue, 21 Jun 2011 21:08:05 +0000 (23:08 +0200)]
No need to check for pselect() in tinc 1.1.

12 years agoOnly log UDP address changes at the appropriate debug levels.
Guus Sliepen [Tue, 21 Jun 2011 21:06:53 +0000 (23:06 +0200)]
Only log UDP address changes at the appropriate debug levels.

12 years agoReopen log file after SIGHUP.
Guus Sliepen [Mon, 6 Jun 2011 19:19:30 +0000 (21:19 +0200)]
Reopen log file after SIGHUP.

This was missed by the previous merge.

12 years agoMerge branch 'master' of git://tinc-vpn.org/tinc into 1.1
Guus Sliepen [Mon, 6 Jun 2011 18:42:15 +0000 (20:42 +0200)]
Merge branch 'master' of git://tinc-vpn.org/tinc into 1.1

Conflicts:
NEWS
configure.in
doc/tincd.8.in
lib/pidfile.c
lib/pidfile.h
lib/xalloc.h
lib/xmalloc.c
src/conf.c
src/conf.h
src/connection.c
src/connection.h
src/event.c
src/graph.c
src/graph.h
src/net.c
src/net.h
src/node.h
src/openssl/crypto.c
src/process.c
src/protocol.c
src/protocol_key.c
src/route.c

12 years agoClean up digests when freeing a connection_t.
Guus Sliepen [Mon, 6 Jun 2011 18:12:33 +0000 (20:12 +0200)]
Clean up digests when freeing a connection_t.

12 years agoImproved --logfile option.
Guus Sliepen [Mon, 6 Jun 2011 14:26:11 +0000 (16:26 +0200)]
Improved --logfile option.

Instead of UNIX time, the log messages now start with the time in RFC3339
format, which human-readable and still easy for the computer to parse and sort.
The HUP signal will also cause the log file to be closed and reopened, which is
useful when log rotation is used. If there is an error while opening the log
file, this is logged to stderr.

12 years agoAttribution for Loïc Grenié.
Guus Sliepen [Sat, 4 Jun 2011 09:27:54 +0000 (11:27 +0200)]
Attribution for Loïc Grenié.

12 years agoNearly tickless tinc.
Loïc Grenié [Sat, 4 Jun 2011 07:05:23 +0000 (09:05 +0200)]
Nearly tickless tinc.

Use pselect instead of select in main_loop (if available). This lets
tincd sleeps as long as there is nothing to do.

12 years agoDon't ignore SIGCHLD, system() needs it.
Guus Sliepen [Fri, 3 Jun 2011 13:50:20 +0000 (15:50 +0200)]
Don't ignore SIGCHLD, system() needs it.

But we do ignore SIGPIPE, and tinc 1.0.x signals that are no longer used
(SIGUSR1 and SIGUSR2), since the default handler of these signals is to
terminate tincd immediately.

12 years agoFix format strings for Windows.
Guus Sliepen [Thu, 2 Jun 2011 22:46:56 +0000 (00:46 +0200)]
Fix format strings for Windows.

Windows doesn't like %zd, so cast (s)size_t to int. Also, some shorts were
incorrectly printed with %d instead of %hd.

12 years agoUse send() when writing to sockets, and the return type is ssize_t.
Guus Sliepen [Thu, 2 Jun 2011 22:34:30 +0000 (00:34 +0200)]
Use send() when writing to sockets, and the return type is ssize_t.

12 years agoSmall fixes for Windows.
Guus Sliepen [Thu, 2 Jun 2011 21:40:27 +0000 (23:40 +0200)]
Small fixes for Windows.

12 years agoEven simpler signal handling.
Guus Sliepen [Thu, 2 Jun 2011 20:14:53 +0000 (22:14 +0200)]
Even simpler signal handling.

12 years agoRemove debugging message that was accidentily left in.
Guus Sliepen [Thu, 2 Jun 2011 19:29:11 +0000 (21:29 +0200)]
Remove debugging message that was accidentily left in.

12 years agoDon't treat packets coming in via TCP as having zero length.
Guus Sliepen [Thu, 2 Jun 2011 19:16:57 +0000 (21:16 +0200)]
Don't treat packets coming in via TCP as having zero length.

12 years agoFix nodes joining the VPN after tincctl top started.
Guus Sliepen [Thu, 2 Jun 2011 19:14:50 +0000 (21:14 +0200)]
Fix nodes joining the VPN after tincctl top started.

12 years agoMake traffic statistics more readable with configurable scaling.
Guus Sliepen [Thu, 2 Jun 2011 18:48:18 +0000 (20:48 +0200)]
Make traffic statistics more readable with configurable scaling.

12 years agoMore stable sorting in tincctl top.
Guus Sliepen [Thu, 2 Jun 2011 18:27:16 +0000 (20:27 +0200)]
More stable sorting in tincctl top.

Although we use qsort(), which is not guaranteed to be stable, resorting the
previously sorted array is more stable than recreating and resorting the array
each time.

12 years agoFix some compiler and cppcheck warnings.
Guus Sliepen [Thu, 2 Jun 2011 16:22:26 +0000 (18:22 +0200)]
Fix some compiler and cppcheck warnings.

12 years agoRemove support for the Ethertap device.
Guus Sliepen [Thu, 2 Jun 2011 16:07:50 +0000 (18:07 +0200)]
Remove support for the Ethertap device.

12 years agoRemove unused functions and variables.
Guus Sliepen [Thu, 2 Jun 2011 15:57:53 +0000 (17:57 +0200)]
Remove unused functions and variables.

12 years agoDon't #include <alloca.h> anymore.
Guus Sliepen [Thu, 2 Jun 2011 15:55:29 +0000 (17:55 +0200)]
Don't #include <alloca.h> anymore.

12 years agoDrop the GNU memcmp.c implementation.
Guus Sliepen [Thu, 2 Jun 2011 15:53:35 +0000 (17:53 +0200)]
Drop the GNU memcmp.c implementation.

12 years agoDrop the GNU malloc.c, realloc.c, and xmalloc.c.
Guus Sliepen [Thu, 2 Jun 2011 15:45:06 +0000 (17:45 +0200)]
Drop the GNU malloc.c, realloc.c, and xmalloc.c.

We live in the 21st century, and we require C99 semantics, so we do not need to
work around buggy libcs. The xmalloc() and related functions are now static
inline functions.

12 years agoSimplify signal handling.
Guus Sliepen [Thu, 2 Jun 2011 15:14:30 +0000 (17:14 +0200)]
Simplify signal handling.

We don't override any signal handlers anymore except those for SIGPIPE and
SIGCHLD. Fatal signals (SIGSEGV, SIGBUS etc.) will terminate tincd and
optionally dump core.  The previous behaviour was to terminate gracefully and
try to restart, but that usually failed and made any core dump useless.

12 years agoRemove outgoing event in free_connection().
Guus Sliepen [Sun, 29 May 2011 20:34:19 +0000 (22:34 +0200)]
Remove outgoing event in free_connection().

12 years agoInitialise priority field to zero for packets read from the VPN interface.
Guus Sliepen [Sun, 29 May 2011 20:14:35 +0000 (22:14 +0200)]
Initialise priority field to zero for packets read from the VPN interface.

12 years agoCosmetic fix when pressing 's' in tincctl top.
Guus Sliepen [Sun, 29 May 2011 20:12:37 +0000 (22:12 +0200)]
Cosmetic fix when pressing 's' in tincctl top.

12 years agoShow hostname and port in error message when connecting to a running tincd.
Guus Sliepen [Sun, 29 May 2011 20:10:54 +0000 (22:10 +0200)]
Show hostname and port in error message when connecting to a running tincd.

12 years agodo_outgoing_connection() may delete a failed connection, and the structure
Sven-Haegar Koch [Sun, 29 May 2011 19:53:21 +0000 (21:53 +0200)]
do_outgoing_connection() may delete a failed connection, and the structure
must not be accessed afterwards.

12 years agosrc/net_socket.c bind_to_address(): Use after free in error path.
Sven-Haegar Koch [Sun, 29 May 2011 19:35:31 +0000 (21:35 +0200)]
src/net_socket.c bind_to_address(): Use after free in error path.

12 years agoAllow tincctl to connect to something besides localhost.
Guus Sliepen [Sun, 29 May 2011 12:41:05 +0000 (14:41 +0200)]
Allow tincctl to connect to something besides localhost.

This would allow tincctl to connect to a remote tincd, or to a local tincd that
isn't listening on localhost, for example if it is using the BindToInterface or
BindToAddress options.

12 years agoRemove a few unnecessary #includes.
Guus Sliepen [Sat, 28 May 2011 21:46:56 +0000 (23:46 +0200)]
Remove a few unnecessary #includes.

Some spotted by Michael Tokarev.

12 years agoRemove newlines from log messages.
Guus Sliepen [Sat, 28 May 2011 21:42:18 +0000 (23:42 +0200)]
Remove newlines from log messages.

12 years agoFix sparse warnings and add an extra sprinkling of const.
Guus Sliepen [Sat, 28 May 2011 21:36:52 +0000 (23:36 +0200)]
Fix sparse warnings and add an extra sprinkling of const.

This is more or less the equivalent of Sven-Haegar Koch's fixes in the 1.1
branch.

12 years agofgets() returns NULL on error, not < 0
Sven-Haegar Koch [Sat, 28 May 2011 01:48:07 +0000 (03:48 +0200)]
fgets() returns NULL on error, not < 0

12 years agosparse fixup: warning: Using plain integer as NULL pointer
Sven-Haegar Koch [Sat, 28 May 2011 01:46:39 +0000 (03:46 +0200)]
sparse fixup: warning: Using plain integer as NULL pointer

12 years agosparse fixup: warning: non-ANSI function declaration of function '...'
Sven-Haegar Koch [Sat, 28 May 2011 01:57:20 +0000 (03:57 +0200)]
sparse fixup: warning: non-ANSI function declaration of function '...'

12 years agosparse fixup: warning: symbol '...' was not declared. Should it be static?
Sven-Haegar Koch [Sat, 28 May 2011 01:56:06 +0000 (03:56 +0200)]
sparse fixup: warning: symbol '...' was not declared. Should it be static?

12 years agosparse fixup: error: too many arguments for function send_key_changed
Sven-Haegar Koch [Sat, 28 May 2011 01:12:03 +0000 (03:12 +0200)]
sparse fixup: error: too many arguments for function send_key_changed

12 years agosparse fixup: error: dubious one-bit signed bitfield
Sven-Haegar Koch [Sat, 28 May 2011 01:08:31 +0000 (03:08 +0200)]
sparse fixup: error: dubious one-bit signed bitfield

12 years agoUse same definition for xalloc_fail_func as is really used.
Sven-Haegar Koch [Sat, 28 May 2011 00:57:40 +0000 (02:57 +0200)]
Use same definition for xalloc_fail_func as is really used.

12 years agoRemoved two newlines from the end of log messages which created empty lines.
Sven-Haegar Koch [Fri, 27 May 2011 23:36:10 +0000 (01:36 +0200)]
Removed two newlines from the end of log messages which created empty lines.

12 years agoFixed error logging on "Input buffer full" condition.
Sven-Haegar Koch [Fri, 27 May 2011 23:33:45 +0000 (01:33 +0200)]
Fixed error logging on "Input buffer full" condition.

12 years agoMake return value of SetPriorityClass() behave the same as setpriority().
Guus Sliepen [Sun, 22 May 2011 13:56:04 +0000 (15:56 +0200)]
Make return value of SetPriorityClass() behave the same as setpriority().

12 years agoAdd the ability to dump all traffic going through route() over a control connection.
Guus Sliepen [Sun, 22 May 2011 12:17:30 +0000 (14:17 +0200)]
Add the ability to dump all traffic going through route() over a control connection.

One can get the packet stream in pcap format, which can be decoded using
tcpdump, for example:

tincctl -n <netname> pcap | tcpdump -r -

12 years agoReset tcplen after use.
Guus Sliepen [Sun, 22 May 2011 12:02:27 +0000 (14:02 +0200)]
Reset tcplen after use.

12 years agoCheck if an event is initialized before calling event_del().
Guus Sliepen [Sun, 22 May 2011 11:15:27 +0000 (13:15 +0200)]
Check if an event is initialized before calling event_del().

Libevent prints a warning to stderr if we do that.

12 years agoAlways compact the buffer if it has reached MAXBUFSIZE.
Guus Sliepen [Sun, 22 May 2011 11:15:05 +0000 (13:15 +0200)]
Always compact the buffer if it has reached MAXBUFSIZE.

12 years agoCompact input buffer before trying to read instead of after.
Guus Sliepen [Sun, 22 May 2011 10:56:51 +0000 (12:56 +0200)]
Compact input buffer before trying to read instead of after.

Also log an error when the input buffer contains more than MAXBUFSIZE bytes
already, instead of silently claiming the other side closed the connection.

12 years agoFix some compiler warnings.
Guus Sliepen [Tue, 17 May 2011 08:58:22 +0000 (10:58 +0200)]
Fix some compiler warnings.

12 years agoUse GetItemCount() on ListCtrls instead of directly accessing ItemCount.
Guus Sliepen [Tue, 17 May 2011 08:57:30 +0000 (10:57 +0200)]
Use GetItemCount() on ListCtrls instead of directly accessing ItemCount.

12 years agoAdd top.h.
Guus Sliepen [Mon, 16 May 2011 07:48:19 +0000 (09:48 +0200)]
Add top.h.

12 years agoAdd tincctl.h.
Guus Sliepen [Mon, 16 May 2011 07:46:54 +0000 (09:46 +0200)]
Add tincctl.h.

12 years agoNicer top command.
Guus Sliepen [Sun, 15 May 2011 14:30:13 +0000 (16:30 +0200)]
Nicer top command.

- Configurable refresh interval.
- Switch between cumulative count or current rate.
- Configurable sorting.

12 years agoAllow inserting items in the middle of a list.
Guus Sliepen [Sun, 15 May 2011 14:29:54 +0000 (16:29 +0200)]
Allow inserting items in the middle of a list.

12 years agoAdd a very primitive "top" command to tincctl.
Guus Sliepen [Sun, 15 May 2011 11:16:48 +0000 (13:16 +0200)]
Add a very primitive "top" command to tincctl.

12 years agoAdd an autoconf check for the curses library.
Guus Sliepen [Sun, 15 May 2011 10:06:21 +0000 (12:06 +0200)]
Add an autoconf check for the curses library.

12 years agoDump traffic statistics over control sockets.
Guus Sliepen [Sun, 15 May 2011 09:59:13 +0000 (11:59 +0200)]
Dump traffic statistics over control sockets.

12 years agoAdd per-node traffic counters.
Guus Sliepen [Sat, 14 May 2011 22:42:29 +0000 (00:42 +0200)]
Add per-node traffic counters.

12 years agoSeveral fixes for the buffer code.
Guus Sliepen [Sat, 14 May 2011 20:30:23 +0000 (22:30 +0200)]
Several fixes for the buffer code.

12 years agoRemove use of bufferevent and eventbuffers, use our own buffering instead.
Guus Sliepen [Sat, 14 May 2011 17:20:56 +0000 (19:20 +0200)]
Remove use of bufferevent and eventbuffers, use our own buffering instead.

12 years agoAdd simple buffer management code.
Guus Sliepen [Sat, 14 May 2011 17:15:04 +0000 (19:15 +0200)]
Add simple buffer management code.

Libevent 2.0's buffer code is not completely backward compatible with 1.4's.
In order to not (mis)use it anymore, we implement it ourselves. The buffers
are automatically expanding when necessary. When consuming data from the
buffer, no memmove()s are performed. Only when adding to the buffer would
write past the end do we shift everything back to the start.

12 years agoFix check for event initialization due to the merge.
Guus Sliepen [Sat, 14 May 2011 09:52:35 +0000 (11:52 +0200)]
Fix check for event initialization due to the merge.

12 years agoReorder checks for libraries to allow ./configure LDFLAGS=-static.
Guus Sliepen [Fri, 13 May 2011 10:37:26 +0000 (12:37 +0200)]
Reorder checks for libraries to allow ./configure LDFLAGS=-static.

OpenSSL depends on libdl and libz. When linking dynamically, libcrypto will
automatically link with the other two libraries.  However, when linking
statically, these libraries need to be specified explicitly while linking.  By
moving the autoconf checks for libdl and libz before those for libcrypto, we
ensure the latter test will be done with the proper libraries.

12 years agoMerge branch 'master' of git://tinc-vpn.org/tinc into 1.1
Guus Sliepen [Mon, 9 May 2011 19:35:14 +0000 (21:35 +0200)]
Merge branch 'master' of git://tinc-vpn.org/tinc into 1.1

Conflicts:
NEWS
README
configure.in
doc/tincd.8.in
lib/pidfile.c
src/bsd/device.c
src/dropin.h
src/net.c
src/net_packet.c
src/node.c
src/process.c
src/tincd.c

12 years agoReleasing 1.0.14. release-1.0.14
Guus Sliepen [Sun, 8 May 2011 21:17:46 +0000 (23:17 +0200)]
Releasing 1.0.14.

12 years agoInclude <inttypes.h> when using intptr_t.
Guus Sliepen [Sun, 8 May 2011 21:12:44 +0000 (23:12 +0200)]
Include <inttypes.h> when using intptr_t.

12 years agoEnsure proper linking with OpenSSL with recent versions of MinGW.
Guus Sliepen [Sun, 8 May 2011 21:12:06 +0000 (23:12 +0200)]
Ensure proper linking with OpenSSL with recent versions of MinGW.

12 years agoUpdate THANKS and copyright information.
Guus Sliepen [Sun, 8 May 2011 19:22:20 +0000 (21:22 +0200)]
Update THANKS and copyright information.

12 years agoCheck for EVP_EncryptInit_ex instead of SHA1_Version in OpenSSL.
Guus Sliepen [Sun, 8 May 2011 19:06:06 +0000 (21:06 +0200)]
Check for EVP_EncryptInit_ex instead of SHA1_Version in OpenSSL.

The latter function disappeared, and wasn't actually used in tinc, so now we
check on a function that we do use.

12 years agoAlways use the default signal handler for ABRT signals.
Guus Sliepen [Sun, 8 May 2011 10:40:44 +0000 (12:40 +0200)]
Always use the default signal handler for ABRT signals.

This will allow coredumps to be generated when tinc is daemonized.
Also add the -kABRT option.

12 years agoIncrease threshold for detecting two nodes with the same Name.
Guus Sliepen [Sun, 8 May 2011 10:16:26 +0000 (12:16 +0200)]
Increase threshold for detecting two nodes with the same Name.

In commit 4a21aabada23d1d2c8a10f54dd7248171c4ec82f, code was added to detect
contradicting ADD_EDGE and DEL_EDGE messages being sent, which is an indication
of two nodes with the same Name connected to the same VPN.  However, these
contradictory messages can also happen when there is a network partitioning. In
the former case a loop happens which causes many contradictory message, while
in the latter case only a few of those messages will be sent. So, now we
increase the threshold to at least 10 of both ADD_EDGE and DEL_EDGE messages.

12 years agoFix command-line '-o' option for host configuration
Julien Muchembled [Thu, 28 Apr 2011 11:21:55 +0000 (13:21 +0200)]
Fix command-line '-o' option for host configuration

This fixes a regression introduced by commit 667b1ba while refactoring option
parsing code.

13 years agoDo not set indirect flag on edges from nodes with multiple addresses.
Guus Sliepen [Wed, 9 Mar 2011 08:34:56 +0000 (09:34 +0100)]
Do not set indirect flag on edges from nodes with multiple addresses.

Since tinc now handles UDP packets with a different source address and port
than used for TCP connections, the heuristic to treat edges as indirect when
tinc could detect that multiple addresses were used does not make sense
anymore, and can actually reduce performance.

13 years agoPrevent anything from updating our own UDP address.
Guus Sliepen [Fri, 18 Feb 2011 22:11:43 +0000 (23:11 +0100)]
Prevent anything from updating our own UDP address.

Because we don't want to keep track of that, and this will cause the node
structure from being relinked into the node tree, which results in myself
pointing to an invalid address.

13 years agoFix spurious misidentification of incoming UDP packets.
Guus Sliepen [Fri, 18 Feb 2011 22:02:11 +0000 (23:02 +0100)]
Fix spurious misidentification of incoming UDP packets.

When a UDP packet was received with an unknown source address/port, and if it
failed a HMAC check against known keys, it could still incorrectly assign that
UDP address to another node. This would temporarily cause outgoing UDP packets
to go to the wrong destination address, until packets from the correct address
were received again.

13 years agoDragonFlyBSD support
Rumko [Sat, 12 Feb 2011 17:22:14 +0000 (18:22 +0100)]
DragonFlyBSD support

* added DragonFly BSD support
* added a check for sys/resource.h (needed on DragonFly)

13 years agoAdd support for VDE through libvdeplug.
Guus Sliepen [Mon, 7 Feb 2011 17:34:55 +0000 (18:34 +0100)]
Add support for VDE through libvdeplug.

When compiled with vde/device.c, tinc will connect to a vde_switch instance
instead of using a tun/tap device.

13 years agoFix typo spotted by Andrew Scheller.
Guus Sliepen [Sat, 29 Jan 2011 09:49:44 +0000 (10:49 +0100)]
Fix typo spotted by Andrew Scheller.

13 years agoProper check and dropin replacement for usleep().
Guus Sliepen [Wed, 12 Jan 2011 19:57:14 +0000 (20:57 +0100)]
Proper check and dropin replacement for usleep().

13 years agoUpdate the NEWS.
Guus Sliepen [Sun, 2 Jan 2011 16:25:24 +0000 (17:25 +0100)]
Update the NEWS.

13 years agoUpdate the manual.
Guus Sliepen [Sun, 2 Jan 2011 16:25:03 +0000 (17:25 +0100)]
Update the manual.

13 years agoDocument the behavior of "-n."
Guus Sliepen [Sun, 2 Jan 2011 16:24:23 +0000 (17:24 +0100)]
Document the behavior of "-n."

13 years agoRemove unused variables.
Guus Sliepen [Sun, 2 Jan 2011 15:59:42 +0000 (16:59 +0100)]
Remove unused variables.

13 years agoReplace bogus #else with #endif.
Guus Sliepen [Sun, 2 Jan 2011 15:55:42 +0000 (16:55 +0100)]
Replace bogus #else with #endif.

Found by cppcheck, which complained about lenin not being initialized, but the
real problem is that reading packets would fail when using code compiled with
--tunemu on a normal tun device.

13 years agoLimit field width when scanning PID file.
Guus Sliepen [Sun, 2 Jan 2011 15:52:36 +0000 (16:52 +0100)]
Limit field width when scanning PID file.

Cppcheck warns that scanf() might otherwise crash when presented with a huge,
bogus PID file.

13 years agoClose all filedescriptors in Solaris close_device().
Guus Sliepen [Sun, 2 Jan 2011 15:50:24 +0000 (16:50 +0100)]
Close all filedescriptors in Solaris close_device().

13 years agoAlways send MTU probes at least once every PingInterval.
Guus Sliepen [Sun, 2 Jan 2011 14:02:23 +0000 (15:02 +0100)]
Always send MTU probes at least once every PingInterval.

Before, if MTU probes failed, tinc would stop sending probes until the next
time keys were regenerated (by default, once every hour).  Now it continues to
send them every PingInterval, so it recovers faster from temporary failures.

13 years agoUse setpriority() instead of nice() on UNIX-like systems.
Guus Sliepen [Sat, 20 Nov 2010 14:31:11 +0000 (14:31 +0000)]
Use setpriority() instead of nice() on UNIX-like systems.

The return value of nice() can not reliably indicate errors. The return value
of the setpriority() call is well-defined.