mirror of
https://github.com/fumiama/WireGold.git
synced 2026-07-01 16:10:24 +08:00
fix
This commit is contained in:
@@ -79,7 +79,14 @@ func (l *Link) Write(p *head.Packet) (n int, err error) {
|
||||
d, err = p.Marshal(l.me.me.String(), l.peerip.String())
|
||||
logrus.Debugln("[link] write data", string(d))
|
||||
if err == nil {
|
||||
n, err = l.me.myconn.WriteToUDP(d, l.me.router.NextHop(l.peerip.String()+"/32").endpoint)
|
||||
peerlink := l.me.router.NextHop(l.peerip.String() + "/32")
|
||||
if peerlink != nil {
|
||||
peerep := peerlink.endpoint
|
||||
logrus.Infoln("[link] write data from ep", l.me.myconn.LocalAddr(), "to", peerep)
|
||||
n, err = l.me.myconn.WriteToUDP(d, peerep)
|
||||
} else {
|
||||
logrus.Warnln("[link] drop packet: nil peerlink")
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user