1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-30 05:55:20 -05:00

fix tun app lints

This commit is contained in:
Shelikhoo
2023-10-23 01:44:36 +01:00
parent e87af12bf8
commit 0ca849637d
10 changed files with 39 additions and 27 deletions

View File

@@ -3,11 +3,14 @@ package packetparse
import (
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/v2fly/v2ray-core/v5/common/net"
)
var errNotIPPacket = newError("not an IP packet")
var errNotUDPPacket = newError("not a UDP packet")
var (
errNotIPPacket = newError("not an IP packet")
errNotUDPPacket = newError("not a UDP packet")
)
var nullDestination = net.UnixDestination(net.DomainAddress("null"))
@@ -56,7 +59,7 @@ func TryParseAsUDPPacket(packet []byte) (src, dst net.Destination, data []byte,
src = net.UDPDestination(srcIP, srcPort)
dst = net.UDPDestination(dstIP, dstPort)
data = udp.Payload
return
return // nolint: nakedret
}
func TryConstructUDPPacket(src, dst net.Destination, data []byte) ([]byte, error) {