Add reserved to WireGuard config

Fixes https://github.com/XTLS/Xray-core/issues/1730
This commit is contained in:
RPRX 2023-03-02 16:55:42 +00:00 committed by GitHub
parent 6526e74d49
commit ccba465590
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 34 additions and 12 deletions

View file

@ -31,6 +31,7 @@ type netBindClient struct {
dialer internet.Dialer
dns dns.Client
dnsOption dns.IPOption
reserved []byte
readQueue chan *netReadInfo
}
@ -157,6 +158,10 @@ func (bind *netBindClient) Send(buff []byte, endpoint conn.Endpoint) error {
}
}
if len(buff) > 3 && len(bind.reserved) == 3 {
copy(buff[1:], bind.reserved)
}
_, err = nend.conn.Write(buff)
return err