1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-27 14:20:27 +08:00

feat(p2p): add ICMP backend support

This commit is contained in:
源文雨
2026-04-11 15:02:45 +08:00
parent 9e642f875a
commit 23d9238464
19 changed files with 809 additions and 28 deletions

View File

@@ -137,8 +137,8 @@ func (m *Me) extractPeer(srcip, dstip net.IP, addr p2p.EndPoint) *Link {
logrus.Warnln(file.Header(), "packet from", srcip, "to", dstip, "is refused")
return nil
}
if bin.IsNilInterface(p.endpoint) || !p.endpoint.Euqal(addr) {
if m.ep.Network() == "tcp" && !addr.Euqal(p.endpoint) {
if bin.IsNilInterface(p.endpoint) || !p.endpoint.Equal(addr) {
if m.ep.Network() == "tcp" && !addr.Equal(p.endpoint) {
logrus.Infoln(file.Header(), "set endpoint of peer", p.peerip, "to", addr.String())
p.endpoint = addr
} else { // others are all no status link