Skip to content

Commit

Permalink
[FAB-2710] Gossip: Log WARN upon bad network config
Browse files Browse the repository at this point in the history
This commit adds a log warning in case a peer detects peers
with the same PKI-ID as itself but with different endpoints.
The only reason that this can happen is that someone configured different
peers with the same identity.

Change-Id: Ie29d871627b521cb586a50bb447e1615710b366c
Signed-off-by: Yacov Manevich <yacovm@il.ibm.com>
Signed-off-by: Artem Barger <bartem@il.ibm.com>
  • Loading branch information
yacovm authored and C0rWin committed Mar 9, 2017
1 parent 450b122 commit 3ad3e43
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions gossip/discovery/discovery_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,16 @@ func (d *gossipDiscoveryImpl) handleAliveMessage(m *proto.SignedGossipMessage) {
pkiID := m.GetAliveMsg().Membership.PkiId
if equalPKIid(pkiID, d.self.PKIid) {
d.logger.Debug("Got alive message about ourselves,", m)
diffExternalEndpoint := d.self.Endpoint != m.GetAliveMsg().Membership.Endpoint
var diffInternalEndpoint bool
secretEnvelope := m.GetSecretEnvelope()
if secretEnvelope != nil && secretEnvelope.InternalEndpoint() != "" {
diffInternalEndpoint = secretEnvelope.InternalEndpoint() != d.self.InternalEndpoint
}
if diffInternalEndpoint || diffExternalEndpoint {
d.logger.Error("Bad configuration detected: Received AliveMessage from a peer with the same PKI-ID as myself:", m.GossipMessage)
}

return
}

Expand Down

0 comments on commit 3ad3e43

Please sign in to comment.