diff options
author | Felix Lange <fjl@twurst.com> | 2016-11-25 20:59:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-25 20:59:18 +0800 |
commit | d1a95c643eadd506f6ae85784d22c7823e411ee9 (patch) | |
tree | 7872593b296835e07a96d5bb40ddcd1f04849ea3 /node | |
parent | 9c3ea0d32d26957fd73ddf07e37d93091de596fd (diff) | |
parent | e5edd3b983189790391dca5b2ae4a0e460cb7f42 (diff) | |
download | go-tangerine-d1a95c643eadd506f6ae85784d22c7823e411ee9.tar go-tangerine-d1a95c643eadd506f6ae85784d22c7823e411ee9.tar.gz go-tangerine-d1a95c643eadd506f6ae85784d22c7823e411ee9.tar.bz2 go-tangerine-d1a95c643eadd506f6ae85784d22c7823e411ee9.tar.lz go-tangerine-d1a95c643eadd506f6ae85784d22c7823e411ee9.tar.xz go-tangerine-d1a95c643eadd506f6ae85784d22c7823e411ee9.tar.zst go-tangerine-d1a95c643eadd506f6ae85784d22c7823e411ee9.zip |
Merge pull request #3325 from fjl/p2p-netrestrict
Prevent relay of invalid IPs, add --netrestrict
Diffstat (limited to 'node')
-rw-r--r-- | node/config.go | 5 | ||||
-rw-r--r-- | node/node.go | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/node/config.go b/node/config.go index 8d85b7ff8..8d75e441b 100644 --- a/node/config.go +++ b/node/config.go @@ -34,6 +34,7 @@ import ( "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/discv5" "github.com/ethereum/go-ethereum/p2p/nat" + "github.com/ethereum/go-ethereum/p2p/netutil" ) var ( @@ -103,6 +104,10 @@ type Config struct { // Listener address for the V5 discovery protocol UDP traffic. DiscoveryV5Addr string + // Restrict communication to white listed IP networks. + // The whitelist only applies when non-nil. + NetRestrict *netutil.Netlist + // BootstrapNodes used to establish connectivity with the rest of the network. BootstrapNodes []*discover.Node diff --git a/node/node.go b/node/node.go index d49ae3a45..4b56fba4c 100644 --- a/node/node.go +++ b/node/node.go @@ -165,6 +165,7 @@ func (n *Node) Start() error { TrustedNodes: n.config.TrusterNodes(), NodeDatabase: n.config.NodeDB(), ListenAddr: n.config.ListenAddr, + NetRestrict: n.config.NetRestrict, NAT: n.config.NAT, Dialer: n.config.Dialer, NoDial: n.config.NoDial, |