draft: Tun respond ICMP port unreachable when rejecting UDP packets

This commit is contained in:
H1JK
2026-01-01 06:48:36 +08:00
parent 1f8bee9710
commit 58c4110b57
9 changed files with 100 additions and 16 deletions

View File

@@ -274,6 +274,10 @@ func (s *packetAdapter) Key() string {
return s.key
}
func (s *packetAdapter) Upstream() any {
return s.UDPPacket
}
func NewPacketAdapter(packet UDPPacket, metadata *Metadata) PacketAdapter {
return &packetAdapter{
packet,

View File

@@ -1,5 +1,11 @@
package constant
import (
"io"
"github.com/metacubex/sing/common/exceptions"
)
// Rule Type
const (
Domain RuleType = iota
@@ -129,3 +135,7 @@ type RuleGroup interface {
Rule
GetRecodeSize() int
}
var (
ErrResetByRule = exceptions.Cause(io.EOF, "reset by rule") // TODO: replace function from sing
)