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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user