https://github.com/tendermint/tendermint
Revision 882622ec10ba3fdc9f360da65bfb2bbbd13193ed authored by Ethan Buchman on 01 April 2019, 23:59:57 UTC, committed by GitHub on 01 April 2019, 23:59:57 UTC
* OriginalAddr -> SocketAddr

OriginalAddr records the originally dialed address for outbound peers,
rather than the peer's self reported address. For inbound peers, it was
nil. Here, we rename it to SocketAddr and for inbound peers, set it to
the RemoteAddr of the connection.

* use SocketAddr

Numerous places in the code call peer.NodeInfo().NetAddress().
However, this call to NetAddress() may perform a DNS lookup if the
reported NodeInfo.ListenAddr includes a name. Failure of this lookup
returns a nil address, which can lead to panics in the code.

Instead, call peer.SocketAddr() to return the static address of the
connection.

* remove nodeInfo.NetAddress()

Expose `transport.NetAddress()`, a static result determined
when the transport is created. Removing NetAddress() from the nodeInfo
prevents accidental DNS lookups.

* fixes from review

* linter

* fixes from review
1 parent 1ecf814
History
Tip revision: 882622ec10ba3fdc9f360da65bfb2bbbd13193ed authored by Ethan Buchman on 01 April 2019, 23:59:57 UTC
Fixes tendermint/tendermint#3522
Tip revision: 882622e
File Mode Size
.circleci
.github
DOCKER
abci
benchmarks
blockchain
cmd
config
consensus
crypto
docs
evidence
libs
lite
mempool
networks
node
p2p
privval
proxy
rpc
scripts
state
test
tools
types
version
.editorconfig -rw-r--r-- 280 bytes
.gitignore -rw-r--r-- 481 bytes
.golangci.yml -rw-r--r-- 1.1 KB
CHANGELOG.md -rw-r--r-- 100.7 KB
CHANGELOG_PENDING.md -rw-r--r-- 164 bytes
CODE_OF_CONDUCT.md -rw-r--r-- 4.9 KB
CONTRIBUTING.md -rw-r--r-- 6.9 KB
Gopkg.lock -rw-r--r-- 15.0 KB
Gopkg.toml -rw-r--r-- 1.9 KB
LICENSE -rw-r--r-- 11.1 KB
Makefile -rw-r--r-- 10.4 KB
PHILOSOPHY.md -rw-r--r-- 7.5 KB
README.md -rw-r--r-- 6.9 KB
ROADMAP.md -rw-r--r-- 861 bytes
SECURITY.md -rw-r--r-- 1.7 KB
UPGRADING.md -rw-r--r-- 12.6 KB
Vagrantfile -rw-r--r-- 2.1 KB
appveyor.yml -rw-r--r-- 279 bytes
codecov.yml -rw-r--r-- 330 bytes
docker-compose.yml -rw-r--r-- 1.3 KB

README.md

back to top