aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discover/udp_test.go
Commit message (Collapse)AuthorAgeFilesLines
* p2p/discover, p2p/discv5: use flexible comparison for IPsPéter Szilágyi2016-12-151-1/+1
|
* p2p, p2p/discover, p2p/discv5: add IP network restriction featureFelix Lange2016-11-231-1/+1
| | | | | | The p2p packages can now be configured to restrict all communication to a certain subset of IP networks. This feature is meant to be used for private networks.
* p2p/discover, p2p/discv5: prevent relay of invalid IPs and low portsFelix Lange2016-11-231-3/+4
| | | | | | | | | | | | | | | | | | | | | The discovery DHT contains a number of hosts with LAN and loopback IPs. These get relayed because some implementations do not perform any checks on the IP. go-ethereum already prevented relay in most cases because it verifies that the host actually exists before adding it to the local table. But this verification causes other issues. We have received several reports where people's VPSs got shut down by hosting providers because sending packets to random LAN hosts is indistinguishable from a slow port scan. The new check prevents sending random packets to LAN by discarding LAN IPs sent by Internet hosts (and loopback IPs from LAN and Internet hosts). The new check also blacklists almost all currently registered special-purpose networks assigned by IANA to avoid inciting random responses from services in the LAN. As another precaution against abuse of the DHT, ports below 1024 are now considered invalid.
* p2p/discover, p2p/discv5: use netutil.IsTemporaryErrorFelix Lange2016-11-231-50/+0
|
* all: fix go vet warningsFelix Lange2016-04-151-1/+1
|
* all: Rename crypto.Sha3{,Hash}() to crypto.Keccak256{,Hash}()Ricardo Catalinas Jiménez2016-02-221-1/+1
| | | | As we aren't really using the standarized SHA-3
* p2p/discover: EIP-8 changesFelix Lange2016-02-191-0/+112
|
* p2p/discover: fix Windows-specific issue for larger-than-buffer packetsFelix Lange2016-01-231-4/+52
| | | | | | | | | | On Windows, UDPConn.ReadFrom returns an error for packets larger than the receive buffer. The error is not marked temporary, causing our loop to exit when the first oversized packet arrived. The fix is to treat this particular error as temporary. Fixes: #1579, #2087 Updates: #2082
* p2p/discover: attempt to deflake TestUDP_responseTimeoutsFelix Lange2015-12-181-1/+2
| | | | | The test expected the timeout to fire after a matcher for the response was added, but the timeout is random and fired sooner sometimes.
* p2p/discover: support incomplete node URLs, add ResolveFelix Lange2015-12-181-1/+1
|
* node: customizable protocol and service stacksPéter Szilágyi2015-11-271-1/+1
|
* p2p/discover: ignore packet version numbersFelix Lange2015-09-301-1/+0
| | | | The strict matching can get in the way of protocol upgrades.
* p2p/discover: fix UDP reply packet timeout handlingFelix Lange2015-08-111-0/+73
| | | | | | | | | | | | If the timeout fired (even just nanoseconds) before the deadline of the next pending reply, the timer was not rescheduled. The timer would've been rescheduled anyway once the next packet was sent, but there were cases where no next packet could ever be sent due to the locking issue fixed in the previous commit. As timing-related bugs go, this issue had been present for a long time and I could never reproduce it. The test added in this commit did reproduce the issue on about one out of 15 runs.
* p2p/discover: unlock the table during ping replacementFelix Lange2015-08-111-1/+1
| | | | | | Table.mutex was being held while waiting for a reply packet, which effectively made many parts of the whole stack block on that packet, including the net_peerCount RPC call.
* all: fix license headers one more timeFelix Lange2015-07-241-1/+1
| | | | I forgot to update one instance of "go-ethereum" in commit 3f047be5a.
* all: update license headers to distiguish GPL/LGPLFelix Lange2015-07-231-4/+4
| | | | | All code outside of cmd/ is licensed as LGPL. The headers now reflect this by calling the whole work "the go-ethereum library".
* all: update license informationFelix Lange2015-07-071-0/+16
|
* p2p/discover: deflake TestUDP_successfulPingFelix Lange2015-06-101-33/+22
|
* p2p/discover: fix out-of-bounds slicing for chunked neighbors packetsFelix Lange2015-05-141-18/+13
| | | | | The code assumed that Table.closest always returns at least 13 nodes. This is not true for small tables (e.g. during bootstrap).
* fix test.subtly2015-05-141-1/+1
|
* Manual send of multiple neighbours packets. Test receiving multiple ↵subtly2015-05-141-2/+12
| | | | neighbours packets.
* removed redundant newlines in import blockBas van Kervel2015-05-121-1/+1
|
* replaced several path.* with filepath.* which is platform independentBas van Kervel2015-05-121-2/+2
|
* p2p/discover: new distance metric based on sha3(id)Felix Lange2015-05-061-10/+6
| | | | | | | The previous metric was pubkey1^pubkey2, as specified in the Kademlia paper. We missed that EC public keys are not uniformly distributed. Using the hash of the public keys addresses that. It also makes it a bit harder to generate node IDs that are close to a particular node.
* p2p/discover: track sha3(ID) in NodeFelix Lange2015-04-301-8/+12
|
* p2p/discover: new endpoint formatFelix Lange2015-04-301-28/+53
| | | | | | This commit changes the discovery protocol to use the new "v4" endpoint format, which allows for separate UDP and TCP ports and makes it possible to discover the UDP address after NAT.
* cmd/bootnode, eth, p2p, p2p/discover: use a fancier db designPéter Szilágyi2015-04-241-3/+7
|
* cmd/bootnode, eth, p2p, p2p/discover: clean up the seeder and mesh into eth.Péter Szilágyi2015-04-241-2/+2
|
* p2p/discovery: fix broken tests due to API updatePéter Szilágyi2015-04-241-1/+1
|
* p2p/discover: implement node bondingFelix Lange2015-04-011-147/+275
| | | | | | | | | | | | | | | | This a fix for an attack vector where the discovery protocol could be used to amplify traffic in a DDOS attack. A malicious actor would send a findnode request with the IP address and UDP port of the target as the source address. The recipient of the findnode packet would then send a neighbors packet (which is 16x the size of findnode) to the victim. Our solution is to require a 'bond' with the sender of findnode. If no bond exists, the findnode packet is not processed. A bond between nodes α and β is created when α replies to a ping from β. This (initial) version of the bonding implementation might still be vulnerable against replay attacks during the expiration time window. We will add stricter source address validation later.
* p2p/discover: map listening port using configured mechanismFelix Lange2015-02-131-7/+7
|
* p2p/discover: deflake UDP testsFelix Lange2015-02-091-55/+107
|
* p2p/discover: add node URL functions, distinguish TCP/UDP portsFelix Lange2015-02-071-5/+8
| | | | | The discovery RPC protocol does not yet distinguish TCP and UDP ports. But it can't hurt to do so in our internal model.
* p2p/discover: add some helper functionsFelix Lange2015-02-061-7/+7
|
* p2p/discover: new package implementing the Node Discovery ProtocolFelix Lange2015-02-061-0/+156