Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
32dda976
Commit
32dda976
authored
Sep 30, 2015
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
p2p/discover: ignore packet version numbers
The strict matching can get in the way of protocol upgrades.
parent
631bf361
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
5 deletions
+0
-5
udp.go
p2p/discover/udp.go
+0
-4
udp_test.go
p2p/discover/udp_test.go
+0
-1
No files found.
p2p/discover/udp.go
View file @
32dda976
...
...
@@ -39,7 +39,6 @@ var (
errPacketTooSmall
=
errors
.
New
(
"too small"
)
errBadHash
=
errors
.
New
(
"bad hash"
)
errExpired
=
errors
.
New
(
"expired"
)
errBadVersion
=
errors
.
New
(
"version mismatch"
)
errUnsolicitedReply
=
errors
.
New
(
"unsolicited reply"
)
errUnknownNode
=
errors
.
New
(
"unknown node"
)
errTimeout
=
errors
.
New
(
"RPC timeout"
)
...
...
@@ -522,9 +521,6 @@ func (req *ping) handle(t *udp, from *net.UDPAddr, fromID NodeID, mac []byte) er
if
expired
(
req
.
Expiration
)
{
return
errExpired
}
if
req
.
Version
!=
Version
{
return
errBadVersion
}
t
.
send
(
from
,
pongPacket
,
pong
{
To
:
makeEndpoint
(
from
,
req
.
From
.
TCP
),
ReplyTok
:
mac
,
...
...
p2p/discover/udp_test.go
View file @
32dda976
...
...
@@ -122,7 +122,6 @@ func TestUDP_packetErrors(t *testing.T) {
defer
test
.
table
.
Close
()
test
.
packetIn
(
errExpired
,
pingPacket
,
&
ping
{
From
:
testRemote
,
To
:
testLocalAnnounced
,
Version
:
Version
})
test
.
packetIn
(
errBadVersion
,
pingPacket
,
&
ping
{
From
:
testRemote
,
To
:
testLocalAnnounced
,
Version
:
99
,
Expiration
:
futureExp
})
test
.
packetIn
(
errUnsolicitedReply
,
pongPacket
,
&
pong
{
ReplyTok
:
[]
byte
{},
Expiration
:
futureExp
})
test
.
packetIn
(
errUnknownNode
,
findnodePacket
,
&
findnode
{
Expiration
:
futureExp
})
test
.
packetIn
(
errUnsolicitedReply
,
neighborsPacket
,
&
neighbors
{
Expiration
:
futureExp
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment