fix(discovery): properly unmarshal local discovery (#9880)
Damage from recent protobuf refactoring
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
@@ -198,9 +199,9 @@ func (c *localClient) recvAnnouncements(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var pkt discoproto.Announce
|
var pkt discoproto.Announce
|
||||||
err := proto.Unmarshal(buf[:4], &pkt)
|
err := proto.Unmarshal(buf[4:], &pkt)
|
||||||
if err != nil && err != io.EOF {
|
if err != nil && !errors.Is(err, io.EOF) {
|
||||||
l.Debugf("discover: Failed to unmarshal local announcement from %s:\n%s", addr, hex.Dump(buf))
|
l.Debugf("discover: Failed to unmarshal local announcement from %s (%s):\n%s", addr, err, hex.Dump(buf[4:]))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user