Skip to content

Commit 32dda97

Browse files
committed
p2p/discover: ignore packet version numbers
The strict matching can get in the way of protocol upgrades.
1 parent 631bf36 commit 32dda97

File tree

2 files changed

+0
-5
lines changed

2 files changed

+0
-5
lines changed

p2p/discover/udp.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ var (
3939
errPacketTooSmall = errors.New("too small")
4040
errBadHash = errors.New("bad hash")
4141
errExpired = errors.New("expired")
42-
errBadVersion = errors.New("version mismatch")
4342
errUnsolicitedReply = errors.New("unsolicited reply")
4443
errUnknownNode = errors.New("unknown node")
4544
errTimeout = errors.New("RPC timeout")
@@ -522,9 +521,6 @@ func (req *ping) handle(t *udp, from *net.UDPAddr, fromID NodeID, mac []byte) er
522521
if expired(req.Expiration) {
523522
return errExpired
524523
}
525-
if req.Version != Version {
526-
return errBadVersion
527-
}
528524
t.send(from, pongPacket, pong{
529525
To: makeEndpoint(from, req.From.TCP),
530526
ReplyTok: mac,

p2p/discover/udp_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ func TestUDP_packetErrors(t *testing.T) {
122122
defer test.table.Close()
123123

124124
test.packetIn(errExpired, pingPacket, &ping{From: testRemote, To: testLocalAnnounced, Version: Version})
125-
test.packetIn(errBadVersion, pingPacket, &ping{From: testRemote, To: testLocalAnnounced, Version: 99, Expiration: futureExp})
126125
test.packetIn(errUnsolicitedReply, pongPacket, &pong{ReplyTok: []byte{}, Expiration: futureExp})
127126
test.packetIn(errUnknownNode, findnodePacket, &findnode{Expiration: futureExp})
128127
test.packetIn(errUnsolicitedReply, neighborsPacket, &neighbors{Expiration: futureExp})

0 commit comments

Comments
 (0)