Fix lint errors
This commit is contained in:
parent
a9f4123ba2
commit
46aa536b37
41 changed files with 498 additions and 406 deletions
|
|
@ -35,6 +35,9 @@
|
|||
// only use the first FD to write outbound packets. Once 5 tuple hashes for
|
||||
// all outbound packets are available we will make use of all underlying FD's to
|
||||
// write outbound packets.
|
||||
|
||||
//go:build darwin
|
||||
|
||||
package fdbased
|
||||
|
||||
import (
|
||||
|
|
@ -46,7 +49,7 @@ import (
|
|||
"github.com/sagernet/gvisor/pkg/tcpip"
|
||||
"github.com/sagernet/gvisor/pkg/tcpip/header"
|
||||
"github.com/sagernet/gvisor/pkg/tcpip/stack"
|
||||
"github.com/sagernet/sing-tun/internal/rawfile_darwin"
|
||||
rawfile "github.com/sagernet/sing-tun/internal/rawfile_darwin"
|
||||
"github.com/sagernet/sing/common"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
//go:build darwin
|
||||
|
||||
package fdbased
|
||||
|
||||
import (
|
||||
|
|
@ -92,5 +94,5 @@ func endpointinitLockNames() {}
|
|||
|
||||
func init() {
|
||||
endpointinitLockNames()
|
||||
endpointprefixIndex = locking.NewMutexClass(reflect.TypeOf(endpointRWMutex{}), endpointlockNames)
|
||||
endpointprefixIndex = locking.NewMutexClass(reflect.TypeFor[endpointRWMutex](), endpointlockNames)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
//go:build darwin
|
||||
|
||||
package fdbased
|
||||
|
||||
import (
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build darwin
|
||||
|
||||
package fdbased
|
||||
|
||||
import (
|
||||
|
|
@ -19,7 +21,7 @@ import (
|
|||
"github.com/sagernet/gvisor/pkg/tcpip"
|
||||
"github.com/sagernet/gvisor/pkg/tcpip/stack"
|
||||
"github.com/sagernet/gvisor/pkg/tcpip/stack/gro"
|
||||
"github.com/sagernet/sing-tun/internal/rawfile_darwin"
|
||||
rawfile "github.com/sagernet/sing-tun/internal/rawfile_darwin"
|
||||
"github.com/sagernet/sing-tun/internal/stopfd_darwin"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
|
|
@ -177,7 +179,7 @@ func (d *recvMMsgDispatcher) dispatch() (bool, tcpip.Error) {
|
|||
d.gro.Dispatcher = dsp
|
||||
defer d.pkts.Reset()
|
||||
|
||||
for k := 0; k < nMsgs; k++ {
|
||||
for k := range nMsgs {
|
||||
n := int(d.msgHdrs[k].DataLen)
|
||||
payload := d.bufs[k].pullBuffer(n)
|
||||
pkt := stack.NewPacketBuffer(stack.PacketBufferOptions{
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
//go:build darwin
|
||||
|
||||
package fdbased
|
||||
|
||||
import (
|
||||
|
|
@ -60,5 +62,5 @@ func processorinitLockNames() {}
|
|||
|
||||
func init() {
|
||||
processorinitLockNames()
|
||||
processorprefixIndex = locking.NewMutexClass(reflect.TypeOf(processorMutex{}), processorlockNames)
|
||||
processorprefixIndex = locking.NewMutexClass(reflect.TypeFor[processorMutex](), processorlockNames)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build darwin
|
||||
|
||||
package fdbased
|
||||
|
||||
import (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue