Refactor - now wireguard based. (#7)
This commit is contained in:
21
peer/ping.go
Normal file
21
peer/ping.go
Normal file
@@ -0,0 +1,21 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user