Matthias Radestock
0b7d462adf
enforce a message size limit
...
so we do not allocate loads of memory when receiving (accidental or
deliberate) garbage
2015-07-20 23:51:04 +01:00
Matthias Radestock
6f8622a1a0
replace outermost framing on tcp connection
...
switch from gob to length-prefix encoding
2015-07-20 23:51:04 +01:00
Matthias Radestock
af049efb40
refactor: s/SimpleTCP{Sender,Receiver}/GobTCP{Sender,Receiver}
2015-07-20 23:51:02 +01:00
Matthias Radestock
ad4e4ce6b8
refactor: make 'inner' encoder/decoder explicit
2015-07-20 23:50:10 +01:00
Matthias Radestock
ca523c716c
cosmetic
2015-07-17 10:58:01 +01:00
Bryan Boreham
acf13dc157
Add sender to OnGossipBroadcast()
2015-07-15 12:07:56 +01:00
Matthias Radestock
bbacaa42b8
cosmetic
2015-07-14 13:23:28 +01:00
Matthias Radestock
2f35ad1d42
Merge pull request #1098 from dpw/encrypt-features
...
New connection protocol version with encrypted features map
Closes #1029 . Closes #912 .
2015-07-14 13:20:18 +01:00
Matthias Radestock
85b4a05c9a
Merge branch '1.0'
2015-07-13 19:07:47 +01:00
Adam Harrison
f3c4a9fc6d
Limit router accept rate with token bucket
2015-07-13 15:02:31 +01:00
Adam Harrison
9634526a67
Add token bucket implementation
2015-07-13 15:01:04 +01:00
Adam Harrison
b67c102fe5
Remove simple sleep from router accept
2015-07-13 15:01:04 +01:00
Matthias Radestock
7aab5cc5b4
refactor: simplify NewPeers
2015-07-11 17:46:57 +01:00
Matthias Radestock
2b61bc91df
cosmetic: remove blank log lines
2015-07-11 16:43:33 +01:00
Matthias Radestock
aaba681db1
remove dead code
2015-07-11 01:54:37 +01:00
Matthias Radestock
a05c65c73b
simplify feature extraction
2015-07-09 14:38:08 +01:00
David Wragg
14d346db8b
Add a --protocol-min-version option to router
...
To allow users to forgo compatibility with Weave Net 1.0 in order to
avoid #912 , by setting --protocol-min-version=2.
Defaults to --protocol-min-version=1, i.e. compatible but vulnerable.
2015-07-09 14:38:06 +01:00
David Wragg
882f14d50c
Version 2 protocol, which encrypts the features map
...
With V1 compatibility
2015-07-09 14:37:42 +01:00
Bryan Boreham
b93070f91a
Fix log message on peer move
2015-07-09 12:51:52 +01:00
Bryan Boreham
cbcd5da680
Fix log message on peer move
2015-07-09 12:33:39 +01:00
David Wragg
501f40d9c1
Consolidate remote peer checks
2015-07-08 17:21:32 +01:00
Tom Wilkie
c8718d85dc
Extend router/peers.go to allow multiple OnGC callbacks, and call the callbacks outside of the peers lock.
2015-07-08 14:47:02 +00:00
David Wragg
e50b1f1fe7
Remove the "found" return value from Peers Fetch method
...
Callers can simply check whether the returned *Peer is nil.
2015-07-08 09:06:33 +01:00
David Wragg
5e10b901a3
Drop the check for duplicate connections in the handshake
...
Duplicate connections are also detected and handled in AddConnection,
I have not been able to reproduce #182 without the check, so although
it may once have been necessary, it doesn't seem to be needed now.
2015-07-08 09:03:51 +01:00
David Wragg
a6a74001bd
Make TCPReceiver more closely mirror TCPSender
2015-07-08 08:53:53 +01:00
Matthias Radestock
bf73029d15
cosmetic: goimports -w .
2015-07-03 20:41:35 +01:00
Matthias Radestock
4dbd657a26
import gopacket from github instaead of google code
...
The latter redirects to the former, which breaks `go get`.
Closes #1071 .
2015-07-03 20:32:27 +01:00
Paul Bellamy
5b79e274e8
fixup logging changes, so it compiles
2015-07-02 17:04:21 +01:00
Alvaro Saurin
f6ffd604dd
Removed all the imports from "code.google.com"
2015-07-02 13:32:52 +02:00
Bryan Boreham
013380c7e7
Update router code to use common logger
2015-07-01 12:26:23 +01:00
Matthias Radestock
ab943d938a
refactor: don't return encoder from handshake()
...
We did this for symmetry/completeness, but the encoder is actually
"consumed" by handshake() in the creation of the tcp senders, hence it
is in fact dangerous to return it.
2015-06-29 12:38:21 +01:00
David Wragg
d6fedc1e6e
Remove error return value from DecodeLayers
...
It is never checked, so add a comment explaining why.
2015-06-29 10:47:56 +01:00
David Wragg
3222478449
Remove the LogFrame when fragmenting
...
Subsequent commits make this LogFrame call a little tricky to retain,
and it's not clear that it is really needed.
2015-06-29 10:47:26 +01:00
Matthias Radestock
039a2030db
refactor: make DF flag passing logic more obvious
...
...and provide a better abstraction for sending special frames.
2015-06-26 11:11:17 +01:00
Matthias Radestock
33d85aaee5
Merge pull request #1016 from dpw/defer-df
...
Don't inspect the DF flag earlier than we need to
2015-06-26 11:10:42 +01:00
Matthias Radestock
ee2a66323e
Merge branch '1.0'
...
Conflicts:
ipam/ring/ring_test.go
2015-06-25 19:57:09 +01:00
David Wragg
64ac7745fe
Don't inspect the DF flag earlier than we need to
2015-06-25 17:11:52 +01:00
David Wragg
5690902173
Move DF indication into LogFrame
2015-06-25 17:11:20 +01:00
David Wragg
4162dcafd3
Make the full EthernetDecoder available to LogFrame
...
So that LogFrame can include information about the decoded frame beyond
the ethernet layer.
2015-06-25 17:11:20 +01:00
Bryan Boreham
b472da18f0
Improve logging of unicast gossip errors
2015-06-25 14:04:37 +01:00
Bryan Boreham
9f784b3c31
Report errors in unicasting gossip
2015-06-25 12:22:53 +01:00
David Wragg
7387caa2eb
Eliminate forwarder Start methods
2015-06-24 17:37:07 +01:00
David Wragg
576dd69b0b
Add a comment to Router's Start method
2015-06-24 17:37:02 +01:00
David Wragg
5e6b107d01
Eliminate the GossipSender Start method
2015-06-24 17:35:26 +01:00
David Wragg
f444ae9224
Eliminate ConnectionMaker Start method
2015-06-24 17:35:26 +01:00
David Wragg
8f5d1eec11
Eliminate the Routes Start method
2015-06-24 17:35:17 +01:00
David Wragg
72039bbe5a
Eliminate the LocalPeer Start method
2015-06-23 16:08:43 +01:00
David Wragg
d6bceb139e
Eliminate MacCache Start method
2015-06-23 16:08:43 +01:00
David Wragg
a311623bb9
Eliminate the Start method on LocalConnection
2015-06-23 16:08:43 +01:00
Paul Bellamy
cdee7a5d6f
Replacing custom testing helpers with testify, where possible
2015-06-17 16:58:03 +01:00