Commit Graph
1014 Commits
Author SHA1 Message Date
Matthias Radestock e171088fac cosmetic: remove unused type 2015-01-20 21:02:48 +00:00
Matthias Radestock 62da72e26d cosmetic: move a bunch of error types to where they belong 2015-01-20 21:01:50 +00:00
Matthias Radestock c6b68dd2bd cosmetic: move Router type from types.go to router.go 2015-01-20 20:49:23 +00:00
Matthias Radestock 74563c6e3a cosmetic: move connection types from types.go to connection.go 2015-01-20 20:44:35 +00:00
Matthias Radestock a649d45085 cosmetic: move Forwarder type from types.go to forwarder.go 2015-01-20 20:41:13 +00:00
Matthias Radestock 1bc27c303e cosmetic: move EthernetDecoder type from types.go to ethernet_decoder.go 2015-01-20 20:35:36 +00:00
Matthias Radestock f5dc851ebe cosmetic: move udp sender types from types.go to udp_sender.go 2015-01-20 20:30:25 +00:00
Matthias Radestock be4dca5bf7 cosmetic: move crypto types from types.go into crypto.go 2015-01-20 20:27:59 +00:00
Matthias Radestock 5dd62b2ecf bound check on protocol message receipt
and some refactoring to extract protocol message payload in common place
2015-01-20 20:06:29 +00:00
Matthias Radestock 1b3d65476c refactor: simplify 2015-01-20 11:51:01 +00:00
Matthias Radestock 1a31748e40 refactor: extract some helpers useful for testing 2015-01-19 21:25:28 +00:00
Matthias Radestock c7701a20b5 refactor: if->switch 2015-01-19 17:01:20 +00:00
Bryan Boreham 404c7a1ad4 When printing call-stacks from SIGQUIT, trim the buffer to remove garbage at the end 2015-01-19 16:54:40 +00:00
Matthias Radestock 24bd0a9a75 refactor: separate MacCache creation from activation 2015-01-19 16:45:06 +00:00
Matthias Radestock 1a85990bdc cosmetic: move a comment 2015-01-19 14:51:59 +00:00
Matthias Radestock b95d5ee182 refactor: split out a helper function 2015-01-19 14:02:22 +00:00
Matthias Radestock 48c8f9ea01 refactor: separate object creation from activation 2015-01-19 13:23:25 +00:00
Matthias Radestock ebe48f5e58 improve weavetools build
- use the more idiomatic `configure --disable-shared && make` instead
  of `configure && make LDFLAGS=-static`. This only works for
  libtool-based builds, so not ethtool.
- check that we really have built static executables
2015-01-18 18:27:30 +00:00
Matthias Radestock 719efd0ac4 eliminate dependency on 'curl' on host
...by bundling it in the weavetools image

Closes #351.
2015-01-18 17:57:21 +00:00
Matthias Radestock 1b229fcc30 gofmt 2015-01-17 19:20:48 +00:00
Matthias Radestock d69854d9c5 cosmetic: turn some if-then-else into 'switch' 2015-01-17 19:19:47 +00:00
Matthias Radestock 198de416ab Merge remote-tracking branch 'upstream/master' 2015-01-17 19:07:59 +00:00
Matthias Radestock 247ebaaf19 ignore heartbeats from the 'wrong' connection
The router may receive heartbeat packets that originated from (the
other end of) a different connection with the remote peer than the
current one. If we don't detect that, we may erroneously tell the
remote peer to mark the connection as 'established'. Which can lead to
a crash.

To enable detection, we include the connection UID - which is the same
at both ends - in the heartbeat frame. That way we can simply ignore
heartbeats with a different connection UID than the current connection
to the remote peer.

Previously heartbeat frames were zero length. In order to include the
64 bit connection UID we could just send 8 octets instead. However,
that would potentially trip up the Ethernet decoder at the other end,
and in any case we might as well make heartbeats fit the format of
other special frames, namely having an all-zero Ethernet header. This
in fact results in a simplification of the special frame handling,
since heartbeats are no longer *extra* special.

Fixes #352.
2015-01-17 18:45:19 +00:00
Bryan Boreham 89ea4f9f80 Changed Twitter handle to @weaveworks 2015-01-17 17:57:18 +00:00
Matthias Radestock a3e9556e75 optimisation: create heartbeat frame only once per connection 2015-01-17 17:29:54 +00:00
Matthias Radestock aceaa66903 refactor(ish) of special frame processing in udp frame handler
- pull all special frame handling in one place
- generalise the condition for detecting special frames
- add some explanation
2015-01-17 16:48:00 +00:00
Matthias Radestock c6898de4c0 refactor: compare Peer pointers instead of names
That is what we do pretty much everywhere else and it is safe since
there are never two Peers with the same name.
2015-01-16 23:10:03 +00:00
Matthias Radestock 4829d411af tiny refactor
don't extract srcMac until we need it
2015-01-16 21:44:57 +00:00
Matthias Radestock c6a684a741 fix some typos 2015-01-16 17:24:03 +00:00
Matthias Radestock a7ed1f0e9c less willing 2015-01-16 16:06:09 +00:00
Matthias Radestock 1890662f65 FetchAll is no longer sent explicitly on ConnectionEstablished
though it is in fact still sent straight away as part of initialsing
the FetchAll timer
2015-01-16 16:02:59 +00:00
Matthias Radestock 45e9d7f17f Merge branch 'bboreham-master' 2015-01-16 16:02:11 +00:00
Matthias Radestock 79b532e4c5 Merge branch 'master' of https://github.com/bboreham/weave into bboreham-master 2015-01-16 16:01:36 +00:00
Matthias Radestock 95e5ebdb5e tweaks to handling of ConnectionEstablished
1) stop the fast heartbeater asap; reducing the liklihood of getting
an extraneous beat
2) uniformely deal with 'avoiding initial wait for timer ticks'; this
entails sending a FetchAll immediately
3) because of (2) there is now no point initiating a FetchAll from the
tcp reader
2015-01-16 15:54:48 +00:00
Bryan Boreham 18184017ec Minor re-wording after review comments 2015-01-16 15:00:46 +00:00
Bryan Boreham bddd0b5ea4 Update FetchAll description to reflect changes in #349 2015-01-16 13:25:03 +00:00
Bryan Boreham 65fd2450ae Added description of topology communication 2015-01-16 12:24:05 +00:00
Matthias Radestock 49f61c8d4c correct comment
This should have been part of #349.
2015-01-15 20:12:04 +00:00
Bryan Boreham 36cb3c77b5 Merge pull request #349 from rade/342_unidirectional_udp
LGTM.  Fixes #342
2015-01-15 16:49:29 +00:00
Bryan Boreham 92043a3dbc Merge pull request #348 from squaremo/issue346_fallback_for_rdns
LGTM.  Closes #346.
2015-01-15 15:31:49 +00:00
Matthias Radestock 9428b7c116 report 'unestablished' in status 2015-01-15 15:10:13 +00:00
Matthias Radestock f2d6b5fdb0 update docs 2015-01-15 14:58:24 +00:00
Matthias Radestock 27c9e70ea9 better handling of unidirectional udp connectivity
Currently we cannot distinguish bi-directional and uni-directional
connectivity between peers. This is what currently happens for a
connection from A to B...

A: remoteUDPAddr=X
B: remoteUDPAddr=nil
A: send fast heartbeats over UDP
B: receive heartbeat; remoteUDPAddr is nil
   remoteUDPAddr=Y
   send 'established' over TCP
   established=true
   send slow heartbeats over UDP
A: receive 'established' over TCP
   established=true
   send slow heartbeats over UDP

If udp packets make it through from A to B but not B to A then both
ends mark the connection as 'established'. Conversely, if udp packets
make it through from B to A but not A to B then the connection is not
marked as 'established' at either end.

In the new scheme, this is what happens...

A: receivedHeartbeat=false, remoteUDPAddr=X
B: receivedHeartbeat=false, remoteUDPAddr=nil
A: send fast heartbeats over UDP
B: receive heartbeat; receivedHeartbeat is false
   remoteUDPAddr=Y
   receivedHeartbeat=true
   send 'established' over TCP
   send fast heartbeats over UDP
A: receive 'established' over TCP (*)
   established=true
   send slow heartbeats over UDP
A: receive heartbeat; receivedHeartbeat is false (*)
   receivedHeartbeat=true
   send 'established' over TCP
B: receive 'established' over TCP
   established=true
   send slow heartbeats over UDP

(*) either of these may occur first

Now, if udp packets make it through from A to B not not B to A then A
marks the connection as 'established' but B doesn't. Conversely, if
udp packets make it through from B to A but not A to B then B marks
the connection as 'established' but A doesn't.
2015-01-15 14:16:16 +00:00
Matthias Radestock 956707ca86 cosmetic 2015-01-14 18:44:18 +00:00
Matthias Radestock 873c95a602 tiny refactor 2015-01-14 18:37:50 +00:00
Matthias Radestock 3765d23825 refactor: move udp sender code into separate file 2015-01-14 17:51:01 +00:00
Matthias Radestock d000beb621 refactor: make LocalConnection.handshake do (only) what it says 2015-01-14 17:36:45 +00:00
Matthias Radestock 9cf5fc5331 refactor: make LocalConnection.queryLoop do what it says 2015-01-14 17:08:38 +00:00
Michael Bridgen 5c3fe86be7 Include testing non-weave reverse queries in DNS smoke tests
Pro-tip: Do not put weaveDNS on the same subnet as the fallback DNS
server.
2015-01-14 17:02:17 +00:00
Michael Bridgen db9bae4162 Use the fallback for reverse lookups too
I considered a couple of different factorings, that is

 * Implementing the fallback as a Lookup
 * Having a server struct that held the resolv.conf and methods for
   handling queries

but ultimately, this is simple and works.
2015-01-14 16:44:12 +00:00