mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
Fixes an issue where discovery responses were not recognized. Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
parent
e2cee054c6
commit
164933d316
2 changed files with 9 additions and 0 deletions
|
|
@ -600,6 +600,11 @@ func (t *UDPv4) readLoop(unhandled chan<- ReadPacket) {
|
|||
}
|
||||
|
||||
func (t *UDPv4) handlePacket(from netip.AddrPort, buf []byte) error {
|
||||
// Unwrap IPv4-in-6 source address.
|
||||
if from.Addr().Is4In6() {
|
||||
from = netip.AddrPortFrom(netip.AddrFrom4(from.Addr().As4()), from.Port())
|
||||
}
|
||||
|
||||
rawpacket, fromKey, hash, err := v4wire.Decode(buf)
|
||||
if err != nil {
|
||||
t.log.Debug("Bad discv4 packet", "addr", from, "err", err)
|
||||
|
|
|
|||
|
|
@ -725,6 +725,10 @@ func (t *UDPv5) readLoop() {
|
|||
|
||||
// dispatchReadPacket sends a packet into the dispatch loop.
|
||||
func (t *UDPv5) dispatchReadPacket(from netip.AddrPort, content []byte) bool {
|
||||
// Unwrap IPv4-in-6 source address.
|
||||
if from.Addr().Is4In6() {
|
||||
from = netip.AddrPortFrom(netip.AddrFrom4(from.Addr().As4()), from.Port())
|
||||
}
|
||||
select {
|
||||
case t.packetInCh <- ReadPacket{content, from}:
|
||||
return true
|
||||
|
|
|
|||
Loading…
Reference in a new issue