Commit graph

1150 commits

Author SHA1 Message Date
Guus Sliepen
75773efe26 Apparently it's impolite to ask GCC to subtract two pointers.
If two pointers do not belong to the same array, pointer subtraction gives
nonsensical results, depending on the level of optimisation and the
architecture one is compiling for. It is apparently not just subtracting the
pointer values and dividing by the size of the object, but uses some kind of
higher magic not intended for mere mortals. GCC will not warn about this at
all. Casting to void * is also a no-no, because then GCC does warn that strict
aliasing rules are being broken. The only safe way to query the ordering of two
pointers is to use the (in)equality operators.

The unsafe implementation of connection_compare() has probably caused the "old
connection_t for ... still lingering" messages. Our implementation of AVL trees
is augmented with a doubly linked list, which is normally what is traversed.
Only when deleting an old connection the tree itself is traversed.
2009-09-13 14:08:59 +02:00
Guus Sliepen
23e151aeed Remove superfluous call to avl_delete(). 2009-09-13 14:07:40 +02:00
Guus Sliepen
9915f2abbe Handle unicast packets larger than PMTU in switch mode.
If PMTUDiscovery is enabled, and we see a unicast packet that is larger than
the path MTU in switch mode, treat it just like we would do in router mode.
2009-09-12 14:19:36 +02:00
Guus Sliepen
7242868b64 Allow PMTUDiscovery in switch and hub modes again.
PMTUDiscovery was disabled in commit d5b56bbba5
because tinc did not handle packets larger than the path MTU in switch and hub
modes. We now allow it again in preparation of proper support, but default to
off.
2009-09-12 13:40:32 +02:00
Guus Sliepen
052ff8b2c5 Put Subnet weight in a separate environment variable.
Commit 5674bba5c5 introduced weighted Subnets,
but the weight was included in the SUBNET variable passed to subnet-up/down
scripts. This makes it harder to use in those scripts. The weight is now
stripped from the SUBNET variable and put in the WEIGHT variabel.
2009-09-12 13:34:11 +02:00
Guus Sliepen
a60a0a1f13 Don't stat() on iPhone/iPod.
Grzegorz Dymarek noted that tinc segfaults at the stat() call in
execute_script() on the iPhone.  We can omit the stat() call for the moment,
the subsequent call to system() will fail with just a warning.
2009-09-10 19:51:08 +02:00
Guus Sliepen
4a5d42178c Add support for iPhones and recent iPods.
This is a slightly modified patch from Grzegorz Dymarek that allows tinc to use
the tunemu device, which allows tinc to be compiled for iPhones and recent
iPods. To enable support for tunemu, the --enable-tunemu option has to be used
when running the configure script.
2009-09-10 19:32:54 +02:00
Guus Sliepen
ff946d0423 Another safe bitfield conversion. 2009-09-09 14:51:36 +02:00
Guus Sliepen
81afa26e4a Convert bitfields to integers in a safe way.
This is commit eb391c52ee redone, but without the
non-standard anonymous union.
2009-09-09 12:04:08 +02:00
Guus Sliepen
9b394bc887 Ensure tinc compiles with gcc -std=c99.
We use a lot of C99 features already, but also some extensions which are not in
the standard.
2009-09-08 21:45:24 +02:00
Guus Sliepen
f52ea0a7eb UNIX signal numbers start at 1. 2009-09-08 18:21:52 +02:00
Guus Sliepen
73d77dd416 Replace asprintf() by xasprintf(). 2009-09-08 18:18:36 +02:00
Michael Tokarev
63fe89e9eb Remove extra semicolon in my definition of setpriority() 2009-09-08 16:49:38 +02:00
Guus Sliepen
5a7fc58012 Always remove a node from the UDP tree before freeing it.
Valgrind caught tinc reading free'd memory during a purge(). This was caused by
first removing it from the main node tree, which will already call free_node(),
and then removing it from the UDP tree. This might cause spurious segmentation
faults.
2009-09-08 16:35:28 +02:00
Guus Sliepen
de029ce460 Change level of some debug messages, zero pointer after freeing hostname. 2009-06-11 19:39:25 +02:00
Guus Sliepen
66be914d35 Do not log errors when recvfrom() returns EAGAIN or EINTR.
Although we select() before we call recvfrom(), it sometimes happens that
select() tells us we can read but a subsequent read fails anyway. This is
harmless.
2009-06-11 19:26:34 +02:00
Guus Sliepen
df4add94a4 Remove pending MTU probe events when a node's reachability status changes. 2009-06-11 19:07:54 +02:00
Guus Sliepen
36f8e4da8b Don't try to send MTU probes to unreachable nodes.
If there is an outstanding MTU probe event for a node which is not reachable
anymore, a UDP packet would be sent to that node, which caused a key request to
be sent to that node, which triggered a NULL pointer dereference. Probes and
other UDP packets to unreachable nodes are now dropped.
2009-06-11 18:36:08 +02:00
Guus Sliepen
9b129c07e2 Fix pointer arithmetic when creating and verifying message authentication codes. 2009-06-06 20:14:51 +02:00
Guus Sliepen
4124b9682f Handle truncated message authentication codes. 2009-06-06 19:04:04 +02:00
Guus Sliepen
5a132550de Merge branch 'master' into 1.1
Conflicts:
	doc/tincd.8.in
	lib/pidfile.c
	src/graph.c
	src/net.c
	src/net.h
	src/net_packet.c
	src/net_setup.c
	src/net_socket.c
	src/netutl.c
	src/node.c
	src/node.h
	src/protocol_auth.c
	src/protocol_key.c
	src/tincd.c
2009-06-05 23:14:13 +02:00
Guus Sliepen
261d1eac1c Properly set HMAC length for incoming packets. 2009-06-05 16:14:31 +02:00
Michael Tokarev
591c38eb38 try outgoing connections before chroot/drop_privs
When chrooted, we either need to force-initialize resolver
and/or nsswitch somehow (no clean way) or resolve all the
names we want before entering chroot jail.  The latter
looks cleaner, easier and it is actually safe because
we still don't talk with the remote nodes there, only
initiating outgoing connections.
2009-06-05 11:40:08 +02:00
Michael Tokarev
a42a8dde45 cleanup setpriority thing to make it readable 2009-06-05 10:02:55 +02:00
Guus Sliepen
41c10c5a96 Add ProcessPriority option.
This option can be set to low, normal or high. On UNIX flavours, this changes
the nice value of the process by +10, 0 and -10 respectively. On Windows, it
sets the priority to BELOW_NORMAL_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS and
HIGH_PRIORITY_CLASS respectively.

A high priority might help to reduce latency and packet loss on the VPN.
2009-05-28 22:51:30 +02:00
Florian Forster
41a05f59ba src/net_socket.c: Bind outgoing TCP sockets to `BindToAddress'.
If a host has multiple addresses on an interface, the source address of the TCP
connection(s) was picked by the operating system while the UDP packets used a
bound socket, i. e. the source address was the address specified by the user.
This caused problems because the receiving code requires the TCP connection and
the UDP connection to originate from the same IP address.

This patch adds support for the `BindToInterface' and `BindToAddress' options
to the setup of outgoing TCP connections.

Tested with Debian Etch on x86 and Debian Lenny on x86_64.

Signed-off-by: Florian Forster <octo@verplant.org>
2009-05-28 00:35:00 +02:00
Florian Forster
6b415a1a7f src/linux/device.c: Fix segfault when running without `--net'.
If running without `--net', the (global) variable `netname' is NULL. This
creates a segmentation fault because this NULL-pointer is passed to strdup:

 Program terminated with signal 11, Segmentation fault.
 #0  0xb7d30463 in strlen () from /lib/tls/i686/cmov/libc.so.6
 (gdb) bt
 #0  0xb7d30463 in strlen () from /lib/tls/i686/cmov/libc.so.6
 #1  0xb7d30175 in strdup () from /lib/tls/i686/cmov/libc.so.6
 #2  0x0805bf47 in xstrdup (s=0x0) at xmalloc.c:118  <---
 #3  0x0805be33 in setup_device () at device.c:66
 #4  0x0805072e in setup_myself () at net_setup.c:432
 #5  0x08050db2 in setup_network () at net_setup.c:536
 #6  0x0805b27f in main (argc=Cannot access memory at address 0x0) at tincd.c:580

This patch fixes this by checking `netname' in `setup_device'. An alternative
would be to check for NULL-pointers in `xstrdup' and return NULL in this case.

Signed-off-by: Florian Forster <octo@verplant.org>
2009-05-27 10:55:09 +02:00
Michael Tokarev
a8a65cee08 tunnelserver: log which ADD_SUBNET was refused
Add some logging about refused ADD_SUBNET
(it causes subsequent client disconnect so it's
important to know which subnet was at fault).

Maybe we should just ignore it completely.
2009-05-25 16:55:55 +02:00
Guus Sliepen
4e9e3ca89d Do not forward broadcast packets when TunnelServer is enabled.
First of all, the idea behind the TunnelServer option is to hide all other
nodes from each other, so we shouldn't forward broadcast packets from them
anyway. The other reason is that since edges from other nodes are ignored, the
calculated minimum spanning tree might not be correct, which can result in
routing loops.
2009-05-25 15:04:33 +02:00
Guus Sliepen
7fc69bc73b Use packet size before decompression to calculate path MTU.
Since compression can either grow or shrink a packet, the size of an MTU probe
after decompression might not reflect the real path MTU. Now we use the size
before decompression, which is independent of the compression algorithm, and
substract a safety margin such that the calculated path MTU will be safe even
for packets which grow as much as possible after compression.
2009-05-25 12:19:37 +02:00
Guus Sliepen
1b3add6c29 Add declaration for sockaddrcmp_noport(). 2009-05-25 12:19:08 +02:00
Michael Tokarev
ca5b67111e Fix ans_key exchange in recent changes
send_ans_key() was using the wrong in vs. outkeylength to
terminate the key being sent, so it was always empty.
2009-05-25 01:30:01 +02:00
Guus Sliepen
7034338bc3 Use xrealloc instead of if(ptr) ptr = xmalloc(). 2009-05-24 19:35:51 +02:00
Guus Sliepen
e012e752f4 Fix initialisation of packet decryption context broken by commit 3308d13e7e.
Instead of a single, global decryption context, each node has its own context.
However, in send_ans_key(), the global context was initialised. This commit
fixes that and removes the global context completely.

Also only set status.validkey after all checks have been evaluated.
2009-05-24 19:31:31 +02:00
Michael Tokarev
0246939ce1 don't log every strange packet coming to the UDP port
it's a sure way to fill up syslog.  Only log those if
debug level is up to PROTOCOL
2009-05-24 17:28:24 +02:00
Guus Sliepen
2c67eafc6e If PMTUDiscovery is not set, do not forward packets via TCP unnecessarily. 2009-05-24 15:58:47 +02:00
Michael Tokarev
7e4d57adf5 ignore indirect edge registrations in tunnelserver mode
In tunnelserver mode we're not interested to hear about
our client edges, just like in case of subnets.  Just
ignore all requests which are not about our node or the
client node.

The fix is very similar to what was done for subnets.

Note that we don't need to add the "unknown" nodes to
the list in tunnelserver mode too, so move allocation
of new nodes down the line.
2009-05-22 00:43:48 +02:00
Michael Tokarev
3759aa5f77 TunnelServer: Don't disconnect client on DEL_SUBNET too
Similar changes as was in 2327d3f6eb
but for del_subnet_h().

Before, we vere returning false (and causing disconnect of the
client) in case of tunnelserver and the client sending DEL_SUBNET
for non-his subnet or for subnet which owner isn't in our connection
list.

After the mentioned change to add_subnet_h() that routine does not
add such indirect owners to the connection list anymore, so that
was ok (owner == NULL and we return true).

But if we too has a connection with the node about which the client
is sending DEL_SUBNET notification, say, because that client lost
connection with that other node, we'll disconnect this client from
us too, returning false for indirect DEL_SUBNET.

Fix that by allowing and ignoring indirect DEL_SUBNET in tunnelserver
mode.

Also rearranged the function a bit, to match add_subnet_h() (in
particular, syntax-check everything first, see if we've seen this
request before).

And also fix some comments.
2009-05-20 20:16:19 +02:00
Michael Tokarev
218adee785 format 'not supported on this platform' error message
Format it in a similar way in all places, to make translation happier.
No functional changes.
2009-05-18 15:35:52 +02:00
Michael Tokarev
54cb6b1aec change error messages in droppriv code to match the rest
Change formatting of error messages about failed syscalls
to be the same as in other places in tincd.

Also suggest a change in "$foo not supported on this platform"
message as it's now used more than once.
2009-05-18 15:05:43 +02:00
Michael Tokarev
d4f9863635 bugfix: chdir(/) after chroot
Fix the famous chdir(".") vs chdir("/") after chroot(something).
2009-05-18 15:05:43 +02:00
Michael Tokarev
6be5d4f5b6 bugfix: move mlock to after detach() so it works for child, not parent
mlock()/mlockall() are not persistent across fork(), and it's
done in parent process before daemon() which does fork().  So
basically, current --mlock does nothing useful.

Move mlock() to after detach() so it works for child process
instead of parent.

Also, check if the platform supports mlock right when processing
options (since else we'll have to die after startup, not at
startup, the error message will be in log only).
2009-05-18 15:03:56 +02:00
Michael Tokarev
ec316aa32e Implement privilege dropping
Add two options, -R/--chroot and -U/--user=user, to chroot to the
config directory (where tinc.conf is located) and to perform
setuid to the user specified, after all the initialization is done.

What's left is handling of pid file since we can't remove it anymore.
2009-05-18 14:34:24 +02:00
Michael Tokarev
6698f7c390 Rename setup_network_connections() and split out try_outgoing_connections()
In preparation of chroot/setuid operations, split out call to
try_outgoing_connections() from setup_network_connections()
(which was the last call in setup_network_connections()).
This is because dropping privileges should be done in-between
setup_network_connections() and try_outgoing_connections().

This patch renames setup_network_connections() to setup_network()
and moves call to try_outgoing_connections() into main routine.

No functional changes.
2009-05-18 14:34:24 +02:00
Guus Sliepen
3308d13e7e Handle UDP packets from different and ports than advertised.
Previously, tinc used a fixed address and port for each node for UDP packet
exchange.  The port was the one advertised by that node as its listening port.
However, due to NAT the port might be different.  Now, tinc sends a different
session key to each node. This way, the sending node can be determined from
incoming packets by checking the MAC against all session keys. If a match is
found, the address and port for that node are updated.
2009-04-03 01:05:23 +02:00
Guus Sliepen
08aabbf931 Merge branch 'master' into 1.1
Conflicts:
	NEWS
	README
	doc/tinc.conf.5.in
	doc/tinc.texi
	po/nl.po
	src/conf.c
	src/connection.c
	src/event.c
	src/graph.c
	src/net.c
	src/net_packet.c
	src/net_socket.c
	src/node.c
	src/node.h
	src/openssl/rsagen.h
	src/protocol_auth.c
	src/protocol_key.c
	src/protocol_misc.c
	src/subnet.c
	src/subnet.h
	src/tincd.c
2009-03-09 19:02:24 +01:00
Guus Sliepen
43fa7283ac Use a simple Random Early Drop algorithm in send_tcppacket(). 2009-03-09 14:04:31 +01:00
Guus Sliepen
d5b56bbba5 Disable PMTUDiscovery in switch and hub modes.
In switch and hub modes, tinc does not generate ICMP packets in response to
packets that are larger than the path MTU.  However, if PMTUDiscovery is
enabled, the IP_MTU_DISCOVER and IPV6_MTU_DISCOVER option is set on the UDP
sockets, which causes all UDP packets to be sent with the DF bit set, causing
large packets to be dropped, even if they would otherwise be routed fine.
2009-03-09 13:48:54 +01:00
Guus Sliepen
78fc59e994 Update THANKS and copyright information. 2009-03-05 14:12:36 +01:00
Guus Sliepen
5674bba5c5 Allow weight to be assigned to Subnets.
Tinc allows multiple nodes to own the same Subnet, but did not have a sensible
way to decide which one to send packets to. Tinc also did not check the
reachability of nodes when deciding where to route packets to, so it would not
automatically fail over to a reachable node.

Tinc now assigns a weight to each Subnet. The default weight is 10, with lower
weights having higher priority.  The Subnets are now internally sorted in the
same way as the kernel's routing table, and the Subnets are search linearly,
skipping those of unreachable nodes. A small cache of recently used addresses
is used to speed up the lookup functions.
2009-03-05 13:34:13 +01:00
Michael Tokarev
76a1bcaffc Enable PMTUDiscovery only if BOTH sides wants it.
Don't enable PMTUDiscovery if at least one side does not support it.
Before it was enabled if at least one side supported it, now both are required.
2009-03-04 21:12:20 +01:00
Guus Sliepen
1c1a67fd93 Handle neighbor solicitation requests without link layer addresses.
Apparently FreeBSD likes to send out neighbor solicitation requests, even on a
tun interface where this is completely pointless. These requests do not have an
option header containing a link layer address, so the proxy-neighborsol code
was treating these requests as invalid. We now handle such requests, and send
back equally pointless replies, also without a link layer address. This seems
to satisfy FreeBSD.
2009-02-17 14:43:05 +01:00
Michael Tokarev
2327d3f6eb Allow tunnelserver to work with clients that have other peers.
In TunnelServer mode, tinc server disconnects any client if it announces
indirect subnets -- subnets that are not theirs (e.g. subnets for nodes
the CLIENT has connections now, even if those nodes are known to the server
too).  Fix that by ignoring such (indirect) announces instead.

While we're at it, move check for such indirect subnet registration to
before allocating new node structure, as in TunnelServer mode we don't
really need to know that other node.
2009-02-09 23:51:10 +01:00
Guus Sliepen
23730375f2 Disable old RSA keys when generating new ones.
When generating an RSA keypair, the new public and private keys are appended to
files. However, when OpenSSL reads keys it only reads the first in a file, not
the last. Instead of printing an easily ignored warning, tinc now disables old
keys when appending new ones.
2009-02-03 14:54:45 +01:00
Guus Sliepen
0d0dfd0852 Validate Name before using it in a filename when generating a keypair. 2009-01-20 14:21:50 +01:00
Guus Sliepen
0966cca8ab Allow reading config files with CRLF endings on Unix systems. 2009-01-20 14:20:44 +01:00
Guus Sliepen
d1910ac198 Remove unused definitions from net.h. 2009-01-20 13:19:31 +01:00
Guus Sliepen
503c32eb0e Use a global list to track outgoing connections.
Previously an outgoing_t was maintained for each outgoing connection,
but the pointer to it was either stored in a connection_t or in an event_t.
This made it very hard to keep track of and to clean up.

Now a list is created when tinc starts and reads all the ConnectTo variables,
and which is recreated when tinc receives a HUP signal.
2009-01-20 13:12:41 +01:00
Guus Sliepen
a7e793c94e Add missing cleanup functions in close_network_connections(). 2009-01-19 23:17:28 +01:00
Guus Sliepen
116065afe3 Change flush_events() to expire_events().
The former function made a totally bogus shallow copy of the event_tree, called
the handler of each event and then deleted the whole tree.  This should've
caused tinc to crash when an ALARM signal was sent more than once, but for some
reason it didn't. It also behaved incorrectly when a handler added a new event.

The new function just moves the expiration time of all events to the past.
2009-01-19 22:50:05 +01:00
Guus Sliepen
a39a9506cd Move free()s at the end om main() to the proper destructor functions. 2009-01-09 12:36:06 +01:00
Guus Sliepen
67df7fb7e1 Only send packets via UDP if UDP communication is possible.
When no session key is known for a node, or when it is doing PMTU discovery but
no MTU probes have returned yet, packets are sent via TCP. Some logic is added
to make sure intermediate nodes continue forwarding via TCP.  The per-node
packet queue is now no longer necessary and has been removed.
2009-01-03 22:33:55 +01:00
Guus Sliepen
b069da90d6 Consistently allocate device and iface variables on the heap.
This fixes a segfault when no Device has been specified and tinc exits, and it
would try to free() a static string. Thanks to Borg for spottin.
2009-01-03 22:06:10 +01:00
Guus Sliepen
a4d99ebf50 Add missing parentheses in check for IPv4 multicast addresses. 2008-12-26 12:46:45 +00:00
Guus Sliepen
099bc56f53 Apply patch from Max Rijevski fixing a memory leak when closing connections.
It also cleans up more when stopping tinc, helping tools like valgrind.
2008-12-23 23:14:37 +00:00
Guus Sliepen
de032054de Handle broadcast and multicast packets in router mode.
Multicast packets are treated as broadcast packets.
Based on a patch from Max Rijevski.
2008-12-23 22:31:38 +00:00
Guus Sliepen
0e4d419aae Enable PMTU discovery by default. 2008-12-22 20:35:45 +00:00
Guus Sliepen
e9576632dc Update copyright information. 2008-12-22 20:27:52 +00:00
Guus Sliepen
26b490e86b Make sure IPv6 sockets are IPv6 only.
This will get rid of the "Can't bind to 0.0.0.0 port 655/tcp: Address already
in use" message on Linux.
2008-12-22 19:40:40 +00:00
Guus Sliepen
c6830ba821 Use TUNIFHEAD by default on FreeBSD to make sure IPv6 works. 2008-12-22 19:33:37 +00:00
Guus Sliepen
a269ec4193 Treat virtual network device as tap if Mode = switch or hub.
On OpenBSD, the link0 flag should still be set in tinc-up or by other means.
2008-12-21 16:19:31 +00:00
Guus Sliepen
551cd19406 Move RSA key generation into the wrappers. 2008-12-14 12:47:26 +00:00
Guus Sliepen
911c05f873 Make sure IPv6 sockets are IPv6 only. 2008-12-11 20:49:14 +00:00
Guus Sliepen
6e80da3370 Use Dijkstra's algorithm. Based on patches from Max Rijevskiy. 2008-12-11 18:07:26 +00:00
Guus Sliepen
26a228e302 Remove wrong checks. 2008-12-11 18:05:59 +00:00
Guus Sliepen
636200d1a2 Remove unnecessary parentheses from sizeof, apply sizeof to variables instead of types whereever possible. 2008-12-11 15:56:18 +00:00
Guus Sliepen
a9bdfb424e Fix compiler warnings. 2008-12-11 15:42:46 +00:00
Guus Sliepen
76165488f8 Backport fixes from trunk since revision 1555. 2008-12-11 15:21:40 +00:00
Guus Sliepen
046158a216 Use the crypto wrappers again instead of calling OpenSSL directly.
This theoretically allows other cryptographic libraries to be used,
and it improves the readability of the code.
2008-12-11 14:44:44 +00:00
Guus Sliepen
8e8fe805c8 Only show meta connection related debug messages when debug level >= 4 2008-12-11 14:03:52 +00:00
Guus Sliepen
40bebbb19f Look in the configured sbin directory for the tincd binary. 2008-12-11 13:59:46 +00:00
Guus Sliepen
38c2d6c1da Correct debug message. 2008-12-05 14:17:39 +00:00
Guus Sliepen
a36259435c Prevent freeing a NULL pointer when a hostname is unresolvable. 2008-11-18 15:11:27 +00:00
Guus Sliepen
4a1740ede7 Do not try to send REQ_KEY or ANS_KEY requests to unreachable nodes. 2008-10-25 19:54:00 +00:00
Guus Sliepen
cb52aa0683 Fix reading configuration files that do not end with a newline. 2008-10-25 18:10:08 +00:00
Guus Sliepen
b2cee41b18 Make sure the prefixlength of subnets is sane.
Thanks to Sven-Haegar Koch for spotting the bug and providing a fix.
2007-12-14 21:17:08 +00:00
Scott Lamb
fe2f1fceb5 Use a control socket directory to restrict access
This provides reasonable security even on Solaris. The sysadmin is
responsible for securing the control socket's ancestors from the
grandparent on.

We could add a cryptographic handshake later if desired.
2007-11-08 19:18:44 +00:00
Scott Lamb
b1f8c65a2c Coding style corrections 2007-11-07 06:45:28 +00:00
Scott Lamb
d82fcc88f3 Reload configuration through control socket
I also kept the SIGHUP handler, which many people will expect to see.
The control socket is better, though - it will tell you if there is a
problem.
2007-11-07 02:51:24 +00:00
Scott Lamb
f0a57eab4c Retry connections through control socket 2007-11-07 02:50:58 +00:00
Scott Lamb
a62a6825a8 Alter debugging levels through control socket 2007-11-07 02:50:27 +00:00
Scott Lamb
1065879c8c Purge through the control socket 2007-11-07 02:49:57 +00:00
Scott Lamb
6eaefb4dbc Dump through control socket
Note this removes SIGUSR1, SIGUSR2, and the graph dumping config option.
It seems cleaner to do everything through the control socket.
2007-11-07 02:49:25 +00:00
Scott Lamb
50ad3f2a89 Fancier protocol for control socket
* pass error status back
* pass message boundaries
2007-11-07 02:48:33 +00:00
Scott Lamb
b0b5299184 Fix reload crash
sighup_handler was expecting the connection_tree to stay the same across
terminate_connection(), which hasn't been true since r1539.
2007-11-07 02:48:15 +00:00
Scott Lamb
40731d030f Temporarily revert to old crypto code
(The new code is still segfaulting for me, and I'd like to proceed with other
work.)

This largely rolls back to the revision 1545 state of the existing code
(new crypto layer is still there with no callers), though I reintroduced
the segfault fix of revision 1562.
2007-11-07 02:47:05 +00:00
Guus Sliepen
269892f70b Prevent double free() of a used challenge nonce. 2007-10-20 11:21:44 +00:00
Guus Sliepen
b0709d2649 Fix meta data segfault when receiving a partial command. 2007-10-19 19:07:30 +00:00
Guus Sliepen
67d9a72ea2 Use a dummy function as the read callback for connection bufferevents. Should not be triggered. 2007-10-19 18:54:43 +00:00
Guus Sliepen
54892b2e3e Fix connection weight estimation. 2007-10-19 18:53:48 +00:00
Guus Sliepen
6c453769fd Apply patch from Scott Lamb: Update documentation to match tincctl changes 2007-09-04 15:06:35 +00:00
Guus Sliepen
86358fabfe Small fixes to make gcrypt routines compile. 2007-09-04 14:58:52 +00:00
Guus Sliepen
f8733d1935 Fix formatting of --help output. 2007-09-04 14:58:11 +00:00
Guus Sliepen
d7ca0300a3 Handle SERVICE_CONTROL_INTERROGATE requests. Thanks to Carsten Ralle for noticing this. 2007-08-17 22:09:00 +00:00
Scott Lamb
1fd1d5bd93 const correctness
cipher_encrypt and cipher_decrypt should take "const void *" data
2007-07-20 20:10:46 +00:00
Guus Sliepen
1b8f891836 Finish crypto wrapping. Also provide wrappers for OpenSSL.
Disable libgcrypt by default. Since it doesn't support the OFB cipher mode,
we can't use it in a backwards compatible way.
2007-05-23 13:45:49 +00:00
Guus Sliepen
f42e57f663 Some more crypto wrapper functions are needed. 2007-05-22 23:41:22 +00:00
Guus Sliepen
19413a8048 Make sure the crypto wrapper functions can actually be compiled. 2007-05-22 21:44:17 +00:00
Guus Sliepen
e8689a4753 Create wrappers for the cryptographic operations used in tinc.
Implement them using libgcrypt.
2007-05-22 21:32:48 +00:00
Guus Sliepen
465837dd7f Parse PEM RSA keys ourself, and use libgcrypt to do RSA encryption and decryption. 2007-05-20 22:28:49 +00:00
Guus Sliepen
fbf305c09d Use libevent for meta socket input/output buffering. 2007-05-19 22:23:02 +00:00
Guus Sliepen
59108e4e4f Use bufferevents to handle control socket buffering. 2007-05-19 16:21:52 +00:00
Guus Sliepen
8c6131deda Implement "stop" command, and allow tincctl to retrieve a running tincd's PID. 2007-05-19 15:21:26 +00:00
Guus Sliepen
e9043e17c7 Move key generation to tincctl. 2007-05-19 14:55:35 +00:00
Guus Sliepen
bf8e3ce13d Remove pidfile in favour of control socket. 2007-05-19 14:13:21 +00:00
Guus Sliepen
bc0a24ec81 Fix retrying outgoing connections. 2007-05-19 13:34:32 +00:00
Guus Sliepen
ce976717ea We can safely delete a connection_t in terminate_connection() now. 2007-05-19 12:07:30 +00:00
Guus Sliepen
01f47c46af Start of control socket implementation. 2007-05-18 16:52:34 +00:00
Guus Sliepen
e37ef57a95 More consistent variable naming. 2007-05-18 11:19:31 +00:00
Guus Sliepen
29fbce4497 Detect duplicate outgoing connections. 2007-05-18 10:29:10 +00:00
Guus Sliepen
fb0cfccf7d Use splay trees instead of AVL trees. 2007-05-18 10:05:26 +00:00
Guus Sliepen
f02d3ed3e1 K&R style braces 2007-05-18 10:00:00 +00:00
Guus Sliepen
760dd966ef Remove last references to the global variable "running". 2007-05-18 09:51:54 +00:00
Guus Sliepen
3909b8e51b Remove the last bits of the legacy main_loop(). 2007-05-18 09:43:52 +00:00
Guus Sliepen
ddc6a81a85 Remove global variable "now". 2007-05-18 09:34:06 +00:00
Guus Sliepen
7e1117197c Move key regeneration handling to net_setup.c. 2007-05-17 23:57:48 +00:00
Guus Sliepen
563577a147 Use libevent to handle key expiration. 2007-05-17 23:33:07 +00:00
Guus Sliepen
8852d4407d Use libevent to age learned MAC addresses. 2007-05-17 23:24:40 +00:00
Guus Sliepen
a530f94e7c Use libevent to age past requests. 2007-05-17 23:14:42 +00:00
Guus Sliepen
aaf1851315 Redo SIGALRM handling. 2007-05-17 23:04:02 +00:00
Guus Sliepen
6d19ebd612 Use libevent to handle all non-fatal signals. 2007-05-17 22:41:34 +00:00
Guus Sliepen
531d5a904a Properly use the timeout_initialized() macro. 2007-05-17 22:17:24 +00:00
Guus Sliepen
bf6490825e Remove legacy event system. 2007-05-17 22:13:12 +00:00
Guus Sliepen
a67ab277c9 Use libevent for retrying outgoing connections. 2007-05-17 22:09:55 +00:00
Guus Sliepen
3321591d93 Use libevent to send MTU probes. 2007-05-17 22:01:07 +00:00
Guus Sliepen
ee7844905f Configure events after obtaining a socket. 2007-05-17 21:47:27 +00:00
Guus Sliepen
294ce72441 Use libevent to handle HUP signal. 2007-05-17 21:34:58 +00:00
Guus Sliepen
4d0621b1f3 Use libevent to dump graphs when necessary.
event_add() can be called repeatedly, the second and later calls are ignored if
the event hasn't been removed yet.
2007-05-17 21:14:30 +00:00
Guus Sliepen
0f6f54ff8a Use a separate event structure to handle meta data writes.
Make meta socket events persistent.
2007-05-17 20:20:10 +00:00
Guus Sliepen
17c8033029 128 listener sockets is way too much. 2007-05-17 19:52:12 +00:00
Guus Sliepen
d8dea8091f Properly delete listener socket events on shutdown. 2007-05-17 19:51:26 +00:00
Guus Sliepen
6ea1dfc995 Port fixes from release 1.0.8. 2007-05-17 19:15:48 +00:00
Guus Sliepen
6af8900f8e Don't free struct addrinfo too early. Spotted by Christian Cier-Zniewski. 2007-05-16 14:46:25 +00:00
Guus Sliepen
480dd127c8 Make sure connection->name is never NULL. 2007-05-16 14:42:08 +00:00
Guus Sliepen
f0cf4991e2 Apply patch from "dnk" making sockets non-blocking under Windows. 2007-05-14 09:21:09 +00:00
Guus Sliepen
3730156165 Only free members of connection_t that have been allocated. 2007-03-12 17:55:43 +00:00
Scott Lamb
38c25d62c2 Convert to libevent.
This is a quick initial conversion that doesn't yet show much advantage:
- We roll our own timeouts.
- We roll our own signal handling.
- We build up the meta connection fd events on each loop rather than
  on state changes.
2007-02-27 01:57:01 +00:00
Scott Lamb
834290b00f A couple missed tevent things.
(Sorry; had a couple changes queued.)
2007-02-27 01:30:57 +00:00
Scott Lamb
6362b12df7 Rename "event_t" to "tevent_t", along with associated functions.
This relieves some confusion and problems during the libevent transition.
In particular, "event_add" was defined by both.
(The 't' stands for 'timeout', 'tinc', 'temporary', or some such.)
2007-02-27 01:26:11 +00:00
Guus Sliepen
45fca3c723 Apply patch from Scott Lamb fixing some memory and resource leaks. 2007-02-14 09:21:34 +00:00
Guus Sliepen
6c6535a416 Apply patch from Scott Lamb preventing an infinite loop when sending SIGALRM. 2007-02-14 09:20:20 +00:00
Guus Sliepen
a1e72f84d0 Update copyright notices. 2007-01-05 13:18:36 +00:00
Guus Sliepen
d80cc7a5cc rename() cannot replace existing files on Windows. 2007-01-05 05:44:01 +00:00
Guus Sliepen
5214ece030 Fix generic BSD tun device to write only the actual packet length.
Due to a copy&paste bug, it tried to write a packet with the maximum size.
This was not a problem until the maximum size was increased to support VLANs.
2007-01-05 04:49:02 +00:00
Guus Sliepen
40f02ff8ee Tapreader socket should be bound to localhost only. 2007-01-04 15:28:36 +00:00
Guus Sliepen
03f3fc01e8 Use a ringbuffer in shared memory to transfer packets from the tapreader thread to the main thread.
It's a wonder it ever worked before. The socket that is created is not of a
datagram type, therefore packet boundaries were not preserved, which becomes
a problem as soon as the TAP-Win32 device receives packets in fast succession.
2007-01-03 18:18:54 +00:00
Guus Sliepen
855806b2f7 Do a simple test for linux/if_tun.h instead of no test at all. 2006-12-16 16:53:58 +00:00
Guus Sliepen
0322c0883b Remove the test for linux/if_tun.h.
It has been available for years on any decent Linux distribution.
Although linux/if_tun.h is now required to compile tinc,
you can still run it on systems which only support Ethertap.
2006-12-16 16:40:09 +00:00
Guus Sliepen
b834d67d7c Use the correct next pointer. 2006-12-12 14:54:39 +00:00
Guus Sliepen
8b55dfacb1 When building the minimum spanning tree, make sure we start from a reachable node. 2006-12-12 14:49:09 +00:00
Guus Sliepen
47d916ec5e Search for lzo/lzo1x.h, lzo2/lzo1x.h and lzo1x.h. 2006-11-29 17:18:39 +00:00
Guus Sliepen
1bb5a284fe Make sure resolved addressed for outgoing connections are freed, if there are any. 2006-11-29 16:57:46 +00:00
Guus Sliepen
e5b1b5cefb EWOULDBLOCK does not exist on platforms without O_NONBLOCK 2006-11-14 12:28:04 +00:00
Guus Sliepen
0714ac6c59 Nodes use events, so event system should be initialised first and destroyed last. 2006-11-11 22:44:15 +00:00
Guus Sliepen
8d393b30a9 Support and autodetect LZO version 2.0 and later. 2006-11-11 20:10:46 +00:00
Guus Sliepen
0d1ac68c59 popen() requires pclose(). 2006-11-11 14:37:03 +00:00
Guus Sliepen
0200d3cd5d Added graph dumping ability based on Markus Goetz's patch. 2006-11-11 14:11:16 +00:00
Guus Sliepen
1728d5b2c4 The "active" bit in node.status is not used. 2006-11-11 13:43:00 +00:00
Guus Sliepen
134dc8995b memcpy() addresses from packet headers before calling the lookup functions.
This probably fixes a problem on the ARM architecture that causes tinc to fail to lookup IPv4 addresses.
2006-08-09 22:31:10 +00:00
Guus Sliepen
64e0519cb5 Remove unused variable. 2006-08-08 13:50:58 +00:00
Guus Sliepen
ddcf079cad Remove unused parameter from maskcmp(). 2006-08-08 13:44:37 +00:00
Guus Sliepen
c620df3c15 Remove unused variables. 2006-08-08 13:44:19 +00:00
Guus Sliepen
9fa27097dd Fix format string warnings. 2006-08-08 13:29:17 +00:00
Guus Sliepen
eb391c52ee Do not break strict aliasing of status_t structs. 2006-08-08 13:21:08 +00:00
Guus Sliepen
2077451e07 Add generic host-up and host-down scripts.
Thanks to Menno Smits for a patch.
2006-06-12 21:45:39 +00:00
Guus Sliepen
f88c9942e1 Use memcpy() to copy sockaddrs returned by getaddrinfo().
Thanks to Miles Nordin for spotting this.
2006-06-11 18:53:27 +00:00
Guus Sliepen
412f3fb510 Restore length of the original packet in send_udppacket(). 2006-04-26 16:29:47 +00:00
Guus Sliepen
de78d79db8 Update copyright notices, remove Ivo's email address. 2006-04-26 13:52:58 +00:00
Guus Sliepen
8ebb017a10 Fix a bug in handling prefixlengths that are not a multiple of 4.
Thanks to Sven-Haegar Koch for spotting the bug and providing the fix.
2006-04-12 08:38:35 +00:00
Guus Sliepen
af95368c0f Fix signedness compiler warnings. 2006-03-19 13:06:21 +00:00
Guus Sliepen
fb1cda2ca4 Export flush_meta(). 2006-03-19 12:43:45 +00:00
Guus Sliepen
098090468a Missing #include. 2006-03-19 12:43:28 +00:00
Guus Sliepen
a90f1b652c Make sure $NAME is set correctly when executing tinc-down script. 2006-02-06 12:30:51 +00:00
Guus Sliepen
228e7a5c8f Apply patch from Scott Lamb adding an output buffer for the TCP sockets.
This helps coalescing multiple send_meta() commands into one TCP packet.
Also limit the size of the output buffer before dropping PACKETs.
2006-01-19 17:13:18 +00:00
Guus Sliepen
a5a4d2b865 Apply patch from Scott Lamb unifying configuration of TCP socket options. 2006-01-13 11:21:59 +00:00
Guus Sliepen
e02f13cdb3 EVP_Cleanup() when quitting. 2006-01-13 11:09:19 +00:00
Guus Sliepen
0912260755 Enable OpenSSL ENGINE, so crypto hardware gets used. Thanks to Andreas van Cranenburgh. 2005-11-16 10:45:11 +00:00
Guus Sliepen
e810545dc2 Prevent possible buffer overflows when using very large (>= 8192 bit) RSA keys.
Thanks to Tonnerre Lombard for noticing!
2005-06-03 10:16:03 +00:00
Guus Sliepen
df3220a154 Update copyright notices. 2005-05-04 18:09:30 +00:00
Guus Sliepen
faaaa1ef38 Searching through splay trees may change the tree variable. 2005-05-04 15:52:55 +00:00
Guus Sliepen
dc09f6fe89 Be on the safe side with initialisation of c->name. 2005-05-04 15:51:45 +00:00
Guus Sliepen
92c4a28d7d Remove unused (and potentially segfaulting) net2str() call. 2005-04-06 20:43:37 +00:00
Guus Sliepen
6363ed4d9c Don't try to add a non-existing node back to the node_udp_tree. 2005-01-20 15:14:25 +00:00
Guus Sliepen
39fe3b445c Nodes should only be in the node_udp_tree if they are reachable. 2005-01-04 22:19:56 +00:00
Guus Sliepen
fe0bfa3e65 Correct size argument for strncat(). 2005-01-04 22:18:58 +00:00
Guus Sliepen
56c36a14d8 Use the proper free function. 2004-12-03 13:27:33 +00:00
Guus Sliepen
18c617ecf2 Free memory used by connection_t after it is deleted from the connection tree. 2004-12-03 13:22:18 +00:00
Guus Sliepen
672ad5634c Small fix. 2004-12-01 21:26:51 +00:00
Guus Sliepen
40b1692940 subnet-up/down hooks, use list_t for the todo list. 2004-12-01 20:06:39 +00:00
Guus Sliepen
c46f56a8b8 subnet-up/down hooks 2004-12-01 20:06:05 +00:00
Guus Sliepen
0077cfaae1 Make sure broadcast packet reach the local network interface. 2004-11-16 19:02:54 +00:00
Guus Sliepen
d8fe2ecdd8 Set BSD tuns to broadcast mode. On OpenBSD, this enables IPv6 on the tun device! 2004-11-10 23:20:59 +00:00
Guus Sliepen
4fe7aff4d1 Add BlockingTCP option, useful when using TCPOnly on slow or congested links. 2004-11-10 21:56:31 +00:00
Guus Sliepen
5bba3124c8 Support tunneling IPv6 on Solaris. 2004-11-10 21:14:08 +00:00
Guus Sliepen
d02d81ff9d Let compiler decide when to inline. 2004-11-10 19:36:02 +00:00
Guus Sliepen
923abcfa35 Use the generic BSD tun/tap code. 2004-11-10 18:11:44 +00:00
Guus Sliepen
e8b11b1cca Missing check for NULL-pointer. 2004-11-10 18:10:59 +00:00
Guus Sliepen
ca7948fc06 Hopefully this really fixes late packet handling. 2004-11-09 09:51:35 +00:00
Guus Sliepen
f7b9761000 Fixed another bug in late packet handling. 2004-11-08 22:30:13 +00:00
Guus Sliepen
14eab17829 Update to make it compile again. 2004-11-08 22:11:33 +00:00
Guus Sliepen
1f00810da3 static 2004-11-01 17:02:19 +00:00
Guus Sliepen
82b29e9a3b Generic device driver for *BSD and MacOS/X 2004-11-01 17:01:56 +00:00
Guus Sliepen
922e5b7bea Support alternative tun/tap driver from http://www-user.rhrk.uni-kl.de/~nissler/tuntap/ 2004-11-01 15:18:53 +00:00
Guus Sliepen
faff649882 Don't let tinc service depend on NDIS component. 2004-11-01 15:18:22 +00:00
Guus Sliepen
396ac4be80 Correct return value. 2004-11-01 15:16:12 +00:00
Guus Sliepen
58153cca98 Allow tinc to work with the latest TAP-Win32 driver. 2004-10-01 18:26:15 +00:00
Guus Sliepen
6411e0d8bd strndupa() is too arcane for some environments. 2004-10-01 18:24:41 +00:00
Guus Sliepen
b0a80007e8 Fix several #includes. 2004-10-01 18:23:08 +00:00
Guus Sliepen
7717cb0c54 Remove duplicate #include "system.h" 2004-09-20 20:56:14 +00:00
Guus Sliepen
5373129344 Marking potential late packets was in the wrong place. 2004-09-20 20:55:49 +00:00
Guus Sliepen
c44f69a302 Don't set $INTERFACE automatically, don't quit on EINTR/EAGAIN. 2004-07-17 12:04:30 +00:00
Guus Sliepen
dcec713675 Added UML network socket handling.
Now you can use tinc instead of uml_switch.
2004-07-17 00:09:14 +00:00
Guus Sliepen
fe84fafcb6 Handle timeouts during connecting the same way as other errors. 2004-06-21 14:37:52 +00:00
Guus Sliepen
e5e0dd7534 Clean up environment after executing scripts. 2004-06-14 14:32:10 +00:00
Guus Sliepen
9e44f116bf Increase MTU by 4 bytes to allow VLAN tagged Ethernet frames in hub and switch mode. 2004-04-15 14:09:56 +00:00
Guus Sliepen
7926a156e5 Update copyrights, links, email addresses and let Subversion update $Id$ keywords. 2004-03-21 14:21:22 +00:00
Guus Sliepen
af86a3226e Revert Martin Kihlgren's patch, it doesn't work the way it should. 2004-03-20 22:23:42 +00:00
Guus Sliepen
8df2224829 Fix declaration of update_node_address(). 2004-03-20 15:33:07 +00:00
Guus Sliepen
56aad1bb48 Applied Martin Kihlgren's IdentityGenerosity patch,
simplified and renamed to StrictSource.
2004-03-20 15:28:55 +00:00
Guus Sliepen
a92c471a2b Only read our public key if it wasn't already in the private key file. 2004-03-15 18:15:02 +00:00
Guus Sliepen
a67a21ef3c Eat trailing whitespace in config files. 2004-03-15 18:05:41 +00:00
Guus Sliepen
4350704d65 Remove CVS related cruft. 2004-03-15 17:54:19 +00:00
Guus Sliepen
519d63bedb Don't forget to update destination MAC address. 2003-12-27 16:32:52 +00:00
Guus Sliepen
aebc97a77f Small fixes for PMTU discovery. 2003-12-24 10:48:15 +00:00
Guus Sliepen
35399784b6 Improvements for PMTU discovery and IPv4 packet fragmentation. 2003-12-22 11:04:17 +00:00
Guus Sliepen
6d41b429a2 Better name, show probed MTU in dump. 2003-12-20 21:25:17 +00:00
Guus Sliepen
9bab08e972 More sensible name, and try to set PMTU discovery on IPv6 sockets as well. 2003-12-20 21:09:33 +00:00
Guus Sliepen
6b12bea62f Let tinc figure out the exact MTU of the link. 2003-12-20 19:47:53 +00:00
Guus Sliepen
e8fbef5de6 Forget multicast. Always inline some function. 2003-12-13 21:50:26 +00:00
Guus Sliepen
5a1406adef Code beautification, start of multicast support. 2003-12-12 19:52:25 +00:00
Guus Sliepen
354b7ab20e Fix proxy-neighborsolicitation. 2003-12-08 12:00:40 +00:00
Guus Sliepen
331cef948d Don't retry if configuration is wrong from the beginning. 2003-12-07 14:31:09 +00:00
Guus Sliepen
a3cd273751 Missing space between words. 2003-12-07 14:29:02 +00:00
Guus Sliepen
25447b3841 Read MaxTimeout from tinc.conf like the manpage says. 2003-12-07 14:28:39 +00:00
Guus Sliepen
0b5e6cf04e Complain if pid file cannot be created. 2003-11-27 23:24:59 +00:00
Guus Sliepen
e3220cacb5 Replace Opaque and Strict options with a TunnelServer option. 2003-11-17 15:30:18 +00:00
Guus Sliepen
0e59fb022c Add Opaque option which prevent information from being forwarded to certain nodes. 2003-11-10 22:31:53 +00:00
Guus Sliepen
d35a510fff Fix another bug in meta.c. 2003-10-12 11:40:00 +00:00
Guus Sliepen
ffb7327c20 Fix bug that could lead to an assertion failure in libcrypto when multiple
requests arrive and TCP packets are heavily fragmented.
2003-10-11 14:18:52 +00:00
Guus Sliepen
258b7ce220 Parentheses in the wrong spots. 2003-10-11 12:28:48 +00:00
Guus Sliepen
a1ab57e275 Check all EVP_ function calls. 2003-10-11 12:16:13 +00:00
Guus Sliepen
b0dd705a26 Check return value of EVP_* functions, and check if length before en/decryption
matches that after in meta.c.
2003-10-10 16:24:24 +00:00
Guus Sliepen
9d2bf718f2 Fix ASCII art. 2003-10-10 16:23:30 +00:00
Guus Sliepen
98edfb14fc Some platforms don't know sa_family_t or define it other than uint16_t. 2003-10-08 12:09:37 +00:00
Guus Sliepen
f2ebdf7580 Set media status for newer TAP-Win32 driver. 2003-10-08 11:37:53 +00:00
Guus Sliepen
acf5f9c968 Missing declaration. 2003-10-08 11:37:20 +00:00
Guus Sliepen
ad39db95fe Make sure type of AF_UNKNOWN is sa_family_t. 2003-10-06 16:49:42 +00:00
Guus Sliepen
5900c07fab PIDs are of type pid_t, and use %ld when reading/writing them to the pidfile. 2003-10-06 16:13:08 +00:00
Guus Sliepen
6350334aa4 Don't confuse users with "Address family not supported" warnings. 2003-10-06 14:41:45 +00:00
Guus Sliepen
0842998c0b Unused variable in struct. 2003-10-06 14:33:04 +00:00
Guus Sliepen
c97b8827ed const 2003-10-06 13:57:12 +00:00
Guus Sliepen
60943122f7 Copy structs from packets to the stack before using them, to prevent
alignment issues.
2003-10-06 13:49:57 +00:00
Guus Sliepen
acbb9d6692 Better length checks. 2003-10-01 09:14:01 +00:00
Guus Sliepen
eeb97e3ef4 Generate keys with 0x10001 as public exponent, which has less prime factors
than 0xFFFF.
2003-09-25 10:34:16 +00:00
Guus Sliepen
288d956728 Check for short packets from the tun/tap device and from other tinc daemons. 2003-09-23 20:59:01 +00:00
Guus Sliepen
cbf5a741aa Remove pidfile when exitting. 2003-09-08 21:52:47 +00:00
Guus Sliepen
0dba26267c Prevent multiple inclusions. 2003-09-03 16:20:33 +00:00
Guus Sliepen
6c5f3d8b74 We don't have to tell GCC how to cast. 2003-08-28 21:05:11 +00:00
Guus Sliepen
762cc2d279 Remove old edges from unreachable nodes to us. This prevents the hosts/NAME-up
script from being called twice in some situations.
2003-08-28 15:27:12 +00:00
Guus Sliepen
3e0b28b0c4 Remove debug message. 2003-08-22 15:07:57 +00:00
Guus Sliepen
89c9f3ed8f When purging nodes, only delete them if nobody references them anymore. 2003-08-22 15:04:26 +00:00
Guus Sliepen
22dd23b650 Add checkpoints. 2003-08-22 15:03:59 +00:00
Guus Sliepen
570e7e9c61 Don't overwrite the first " when installing a service. 2003-08-22 15:05:01 +00:00
Guus Sliepen
72bdc05cb7 Allow tinc to handle unknown type addresses from other tinc daemons. 2003-08-22 11:18:42 +00:00
Guus Sliepen
5ac4179df6 If we're not in main_loop() and the service is stopped, exit immediately. 2003-08-17 12:05:08 +00:00
Guus Sliepen
46cfe61994 Do what the SDK documentation tells. 2003-08-17 12:04:35 +00:00
Guus Sliepen
3112e6a863 Use the event log under Windows. 2003-08-17 09:04:00 +00:00
Guus Sliepen
5e7c52610f Fix --logfile under Windows. 2003-08-17 09:03:30 +00:00
Guus Sliepen
f4e80cc5e0 Don't getsockopt() SO_ERROR. We get the error from send()/recv() anyway. 2003-08-16 12:40:01 +00:00
Guus Sliepen
fd40130eb6 stat() batch files under Windows. 2003-08-16 12:11:11 +00:00
Guus Sliepen
7ed2559025 Fix permissions check for rsa_key.priv. 2003-08-14 14:21:35 +00:00
Guus Sliepen
1f2670aab2 Small fixes. 2003-08-12 14:48:13 +00:00
Guus Sliepen
ae070b9170 Add a description for the Service control panel. 2003-08-10 13:35:05 +00:00
Guus Sliepen
7eed829d28 Only system() needs script name quoted. 2003-08-08 22:45:46 +00:00
Guus Sliepen
9bde92ce97 Simpler checking of permissions on private RSA key and other fixes. 2003-08-08 22:11:54 +00:00
Guus Sliepen
96f5d98fc2 Small things. 2003-08-08 19:56:11 +00:00
Guus Sliepen
ef65a64443 Better error checking and reporting. 2003-08-08 19:49:47 +00:00
Guus Sliepen
bb2f18a3fc Under Windows, the installation directory can be found in the registry. 2003-08-08 19:45:21 +00:00
Guus Sliepen
7f05445047 Quote when needed and don't try stuff that doesn't work under Windows. 2003-08-08 19:43:47 +00:00
Guus Sliepen
b4c913aaa9 Log error first, try to close later. 2003-08-08 19:42:35 +00:00
Guus Sliepen
6f30995955 Typo. 2003-08-08 17:20:12 +00:00
Guus Sliepen
691907caae Readd quotes. 2003-08-08 17:17:13 +00:00
Guus Sliepen
7e74e00d16 Allow empty lines in config files. 2003-08-08 14:59:27 +00:00
Guus Sliepen
863349638b Simplify execute_script(). It will probably work under Windows as well. 2003-08-08 14:48:33 +00:00
Guus Sliepen
deba3ed900 Correct error message when remote host closed connection. 2003-08-08 14:24:09 +00:00
Guus Sliepen
070aee3be1 Tell windows to be patient. 2003-08-08 12:55:05 +00:00
Guus Sliepen
adb68b9c2a Windows uses backslashes... 2003-08-08 12:24:52 +00:00
Guus Sliepen
ef091d1ddb Sync CABAL branch with release-1_0 branch. 2003-08-08 11:45:37 +00:00
Guus Sliepen
5193a14dde Use our own port when connecting to ourself. 2003-08-03 21:45:41 +00:00
Guus Sliepen
62a7fa9a7b Simplify translation 2003-08-03 21:45:13 +00:00