wireguard: Fix set reserved

This commit is contained in:
世界 2024-12-05 17:40:15 +08:00
parent 1e787cb607
commit 8c3a98faa2
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -152,6 +152,13 @@ func (w *WireGuard) start() error {
}
bind = wireguard.NewClientBind(w.ctx, w, w.listener, isConnect, connectAddr, reserved)
}
if w.useStdNetBind || len(w.peers) > 1 {
for _, peer := range w.peers {
if peer.Reserved != [3]uint8{} {
bind.SetReservedForEndpoint(peer.Endpoint, peer.Reserved)
}
}
}
err = w.tunDevice.Start()
if err != nil {
return err