22 lines
388 B
Go
22 lines
388 B
Go
package peer
|
|
|
|
import (
|
|
"log"
|
|
"net/netip"
|
|
|
|
"vppn/peer/control"
|
|
)
|
|
|
|
func (a *App) sendPing(p *Peer, ts int64) {
|
|
ping := control.Ping{
|
|
PingTS: ts,
|
|
SrcV4: a.selfV4,
|
|
SrcV6: a.selfV6,
|
|
Dst: p.WGEndpoint(),
|
|
}
|
|
dst := netip.AddrPortFrom(p.VPNIP, ControlPort)
|
|
if err := a.controlConn.SendPing(dst, ping, a.scratch); err != nil {
|
|
log.Printf("sendPing %v: %v", p.VPNIP, err)
|
|
}
|
|
}
|