mirror of
https://github.com/slackhq/nebula.git
synced 2025-11-22 00:15:37 +01:00
tell stupid ai not to meddle with the paths on other platforms by adding a copy
This commit is contained in:
@@ -344,6 +344,9 @@ func NewInterface(ctx context.Context, c *InterfaceConfig) (*Interface, error) {
|
||||
if decryptWorkers < 0 {
|
||||
decryptWorkers = 0
|
||||
}
|
||||
if runtime.GOOS != "linux" {
|
||||
decryptWorkers = 0
|
||||
}
|
||||
|
||||
queueDepth := c.DecryptQueueDepth
|
||||
if queueDepth <= 0 {
|
||||
|
||||
@@ -180,9 +180,7 @@ func (u *StdConn) ListenOut(r EncReader) {
|
||||
u.l.WithError(err).Error("unexpected udp socket receive error")
|
||||
}
|
||||
|
||||
payload := make([]byte, n)
|
||||
copy(payload, buffer[:n])
|
||||
r(netip.AddrPortFrom(rua.Addr().Unmap(), rua.Port()), payload, func() {})
|
||||
r(netip.AddrPortFrom(rua.Addr().Unmap(), rua.Port()), buffer[:n], nil)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -82,8 +82,6 @@ func (u *GenericConn) ListenOut(r EncReader) {
|
||||
return
|
||||
}
|
||||
|
||||
payload := make([]byte, n)
|
||||
copy(payload, buffer[:n])
|
||||
r(netip.AddrPortFrom(rua.Addr().Unmap(), rua.Port()), payload, func() {})
|
||||
r(netip.AddrPortFrom(rua.Addr().Unmap(), rua.Port()), buffer[:n], nil)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,12 +452,23 @@ func (s *sendShard) flushPendingLocked() error {
|
||||
if queue == nil {
|
||||
err = s.processTask(task)
|
||||
} else {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
err = s.processTask(task)
|
||||
sent := false
|
||||
func() {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
err = s.processTask(task)
|
||||
sent = true
|
||||
}
|
||||
}()
|
||||
select {
|
||||
case queue <- task:
|
||||
sent = true
|
||||
default:
|
||||
}
|
||||
}()
|
||||
queue <- task
|
||||
if !sent {
|
||||
err = s.processTask(task)
|
||||
}
|
||||
}
|
||||
s.mu.Lock()
|
||||
return err
|
||||
|
||||
@@ -149,9 +149,7 @@ func (u *RIOConn) ListenOut(r EncReader) {
|
||||
continue
|
||||
}
|
||||
|
||||
payload := make([]byte, n)
|
||||
copy(payload, buffer[:n])
|
||||
r(netip.AddrPortFrom(netip.AddrFrom16(rua.Addr).Unmap(), (rua.Port>>8)|((rua.Port&0xff)<<8)), payload, func() {})
|
||||
r(netip.AddrPortFrom(netip.AddrFrom16(rua.Addr).Unmap(), (rua.Port>>8)|((rua.Port&0xff)<<8)), buffer[:n], nil)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user