Update WireGuard and Tailscale
This commit is contained in:
@@ -162,7 +162,7 @@ func (c *ClientBind) SetMark(mark uint32) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *ClientBind) Send(bufs [][]byte, ep conn.Endpoint) error {
|
||||
func (c *ClientBind) Send(bufs [][]byte, ep conn.Endpoint, offset int) error {
|
||||
udpConn, err := c.connect()
|
||||
if err != nil {
|
||||
c.pauseManager.WaitActive()
|
||||
@@ -170,15 +170,18 @@ func (c *ClientBind) Send(bufs [][]byte, ep conn.Endpoint) error {
|
||||
return err
|
||||
}
|
||||
destination := netip.AddrPort(ep.(remoteEndpoint))
|
||||
for _, b := range bufs {
|
||||
if len(b) > 3 {
|
||||
for _, buf := range bufs {
|
||||
if offset > 0 {
|
||||
buf = buf[offset:]
|
||||
}
|
||||
if len(buf) > 3 {
|
||||
reserved, loaded := c.reservedForEndpoint[destination]
|
||||
if !loaded {
|
||||
reserved = c.reserved
|
||||
}
|
||||
copy(b[1:4], reserved[:])
|
||||
copy(buf[1:4], reserved[:])
|
||||
}
|
||||
_, err = udpConn.WriteToUDPAddrPort(b, destination)
|
||||
_, err = udpConn.WriteToUDPAddrPort(buf, destination)
|
||||
if err != nil {
|
||||
udpConn.Close()
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user