Matthias Radestock
8caa58af26
Merge branch 'weave-common-signals' of https://github.com/inercia/weave into inercia-weave-common-signals
2015-05-06 19:33:06 +01:00
Alvaro Saurin
f723d5afd8
Move the router to the new signals handler
2015-05-06 15:07:36 +02:00
Matthias Radestock
e656d74633
cosmetic
2015-05-05 22:08:03 +01:00
Matthias Radestock
22e612a738
Merge branch 'reduced_gob' of https://github.com/awh/weave into awh-reduced_gob
2015-05-05 21:36:09 +01:00
Adam Harrison
ab68a1c325
Introduce PeerSummary
2015-05-05 10:59:09 +01:00
Matthias Radestock
e40f1fe9a7
fix typo and reformat
2015-05-02 17:46:21 +01:00
David Wragg
be983931fc
Produce a better error message when there is no real SetImmediateMode
...
If gopacket is compiled against an older pcap.h that doesn't have
pcap_set_immediate_mode, it supplies a dummy definition that
always returns PCAP_ERROR. That becomes "Generic error", which
is not very helpful. The real pcap_set_set_immediate never
returns PCAP_ERROR, so this turns it into a more informative
message.
2015-05-01 21:40:53 +01:00
Matthias Radestock
137776bcb2
remove decryptor shutdown
...
we only needed it because of the nonce channels
2015-04-30 14:47:16 +01:00
Matthias Radestock
e223899982
remove nonce transmission from protocol
2015-04-30 14:47:16 +01:00
Matthias Radestock
b365c3806b
replace random nonces with message sequence numbers in udp crypto
2015-04-30 14:47:16 +01:00
Matthias Radestock
696bfe464c
replace random nonces with message sequence numbers in tcp crypto
...
Since TCP is reliable, we do not need to transmit the nonce itself;
the recipient can simply construct the nonce from its own message
counter. Hence there is no message envelope and we can thus remove a
whole layer of encoding.
2015-04-30 14:47:16 +01:00
Adam Harrison
b48a93c483
Remove obsolete connsIterator
2015-04-30 13:06:57 +01:00
Adam Harrison
047614b540
Encode/decode []ConnectionSummary instead of []byte
2015-04-30 13:03:18 +01:00
Adam Harrison
26dfc42034
Bump protocol version due to gob restructuring
2015-04-29 16:39:14 +01:00
Matthias Radestock
61a5640a95
do not connect to weave port of outbound connection endpoints
...
There is no point.
2015-04-28 16:07:34 +01:00
Matthias Radestock
e45ea65e45
tiny simplifying refactor
2015-04-27 15:51:25 +01:00
Matthias Radestock
b74348e59d
d'oh
2015-04-27 08:58:02 +01:00
Matthias Radestock
ce03f27044
refactor: use 'copy' instead of for loop for slice->array copy
2015-04-27 07:42:52 +01:00
Matthias Radestock
1de86f4312
cosmetic
2015-04-27 07:30:17 +01:00
Matthias Radestock
02a7875eb8
refactor: remove last dependency of crypto on LocalConnection
2015-04-27 07:27:31 +01:00
Matthias Radestock
ea4e84cdd3
refactor: (almost) remove dependency of crypto on LocalConnection
2015-04-27 07:14:30 +01:00
Matthias Radestock
29c02d2724
refactor: lift error handling out of Encryptor.Bytes()
...
in order to reduce dependency on LocalConnection
2015-04-27 07:12:21 +01:00
Matthias Radestock
fcd44c37e1
refactor: reduce coupling between connections and crypto
2015-04-27 06:13:41 +01:00
Matthias Radestock
ff49bb5125
document why we carry the DF flag in payload
2015-04-25 12:36:05 +01:00
Matthias Radestock
d82f60f18b
cosmetic
2015-04-25 12:06:20 +01:00
Matthias Radestock
d15575212a
refactor: no need to record 'df' in two places in state
2015-04-25 12:05:17 +01:00
David Wragg
dceef04ffa
Separate Forwarder and ForwarderDF
...
Much of the state and code associated with Forwarder only applied in the
DF case.
2015-04-18 10:38:05 +01:00
Matthias Radestock
a5a91ebb33
do not shut down connections on PacketDecodingError
2015-04-15 21:52:56 +01:00
Matthias Radestock
f4ba0f7287
log udp packet processing errors against the connection
2015-04-15 21:10:22 +01:00
Matthias Radestock
57b7276ceb
create forwarders before AddConnection, if we can
...
This is beneficial for reasons explained in the comments. And we used
to do that previously, when initHeartbeats was called before
AddConnection.
2015-04-15 20:55:42 +01:00
Matthias Radestock
9b25815641
don't send heartbeats on new but ultimately invalid connections
...
It is wasteful and can trip up crypto at the other end. See comment
for why.
To accomplish this we move the responsibility for shutting down the
new, invalid connection from LocalPeer.AddConnection to its caller,
i.e. LocalConnection.run. So rather than always firing up all the
connection machinery and getting told asynchronously by AddConnection
to shut it all down again, we now only fire it up if AddConnection
succeeded.
2015-04-15 20:04:40 +01:00
Matthias Radestock
a9963675b6
remove dead code
2015-04-15 16:13:18 +01:00
Matthias Radestock
339f85cbcb
get rid of Router.NormalisePeerAddr
...
There was only one call site left and it always gets invoked with an
ip:port, so normalisation is a no-op.
Also remove mysterious comment.
2015-04-15 11:44:48 +01:00
Matthias Radestock
290d5443cc
more discriminate connectivity
...
If a peer was specified on the command line w/o a port, then do not
connect to it if we have inbound connections from that IP.
This eliminates unnecessary (and ultimately failing) connection
attempts in the common scenario of several peers having been told
about each other on their command lines.
We represent a command line peer address with a TCPAddr, which avoids
back and forth conversion to string and extra fields to carry the "did
the original include a port?" information.
2015-04-15 11:42:53 +01:00
Matthias Radestock
5415e3a60a
drop "Peer " prefix in Peers section of status
...
it's redundant and the output looks much better w/o it
2015-04-15 11:09:35 +01:00
Matthias Radestock
f0998d6196
declutter status' reconnects section
2015-04-15 10:56:29 +01:00
Matthias Radestock
f6def13ea9
change style for connections in status' reconnects section
...
to match how they are shown in the logs
2015-04-15 10:55:14 +01:00
Matthias Radestock
b1fd1334b4
always include the remote address in connection log entries
...
in addition to the peer name
This is handy for debugging, especially in situations when there are
multiple connections in flight to the same peer.
2015-04-14 22:14:29 +01:00
Matthias Radestock
31775a8b84
cosmetic
2015-04-14 17:58:13 +01:00
Matthias Radestock
973996184d
fix bug
2015-04-14 13:27:10 +01:00
Matthias Radestock
798bfeb0a7
make the Router include the RouterConfig
...
rather than copying the bulk of it
2015-04-14 11:39:11 +01:00
Matthias Radestock
961801b792
refactor: shrink function by extracting helpers
2015-04-14 06:49:47 +01:00
Matthias Radestock
c2972b7558
cosmetic: remove dead code
2015-04-13 21:28:07 +01:00
Matthias Radestock
b062facbe9
refactor: inline
2015-04-13 15:56:52 +01:00
rade
a80b8eacac
Merge pull request #552 from bboreham/status-conn-errors
...
Allow ConnectionMaker to report the reason the connection broke
2015-04-13 15:46:09 +01:00
Matthias Radestock
8ab14ea1c6
don't crash
...
this got broken in a93a09dd35
2015-04-13 15:37:44 +01:00
Matthias Radestock
3db4e86564
remove established connections from ConnectionMaker state
...
This got broken in 6409a8647c
The issue is that for successful connections nothing ever sets
attempting=false, so we need some other means of removing such
entries.
2015-04-13 14:59:32 +01:00
Bryan Boreham
8ad244e0f9
Let ConnectionMaker report the reason the connection broke
2015-04-13 14:35:27 +01:00
Bryan Boreham
f8ec56ea79
Move connection shutdown logging into shutdown()
2015-04-13 14:21:11 +01:00
Matthias Radestock
a93a09dd35
remember user-supplied peer addresses as given
...
rather than post name resolution. This way we can forget them as given
even when name resolution has changed or fails.
2015-04-12 20:44:12 +01:00