diff --git a/p2p/discover/table.go b/p2p/discover/table.go
index 6d48ab00cdfc0bea1fe221ccae3d481c478e4eb6..010fa47f52a5266f46177cca77f13fc79d00a941 100644
--- a/p2p/discover/table.go
+++ b/p2p/discover/table.go
@@ -520,6 +520,9 @@ func (tab *Table) delete(node *node) {
 }
 
 func (tab *Table) addIP(b *bucket, ip net.IP) bool {
+	if len(ip) == 0 {
+		return false // Nodes without IP cannot be added.
+	}
 	if netutil.IsLAN(ip) {
 		return true
 	}
diff --git a/p2p/discover/table_test.go b/p2p/discover/table_test.go
index 895c284b270b38f9779e213c6b6191fdaa575aee..562691e5b9f9da8e94696e7e8c436e248b321a1f 100644
--- a/p2p/discover/table_test.go
+++ b/p2p/discover/table_test.go
@@ -58,7 +58,7 @@ func testPingReplace(t *testing.T, newNodeIsResponding, lastInBucketIsResponding
 
 	// Fill up the sender's bucket.
 	pingKey, _ := crypto.HexToECDSA("45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8")
-	pingSender := wrapNode(enode.NewV4(&pingKey.PublicKey, net.IP{}, 99, 99))
+	pingSender := wrapNode(enode.NewV4(&pingKey.PublicKey, net.IP{127, 0, 0, 1}, 99, 99))
 	last := fillBucket(tab, pingSender)
 
 	// Add the sender as if it just pinged us. Revalidate should replace the last node in