docs: add more debug info

This commit is contained in:
mzz2017 2023-02-11 21:34:49 +08:00
parent d67fe075a3
commit f2fba0a261
2 changed files with 6 additions and 3 deletions

View File

@ -5,7 +5,10 @@
package consts
import internal "github.com/v2rayA/dae/pkg/ebpf_internal"
import (
internal "github.com/v2rayA/dae/pkg/ebpf_internal"
"strconv"
)
const (
AppName = "dae"
@ -78,7 +81,7 @@ func (i OutboundIndex) String() string {
case OutboundLogicalAnd:
return "<AND>"
default:
return ""
return strconv.Itoa(int(i))
}
}

View File

@ -137,7 +137,7 @@ func (c *ControlPlane) handlePkt(data []byte, src, dst netip.AddrPort, outboundI
default:
}
if int(outboundIndex) >= len(c.outbounds) {
return fmt.Errorf("outbound %v out of range", outboundIndex)
return fmt.Errorf("outbound %v out of range [0, %v]", outboundIndex, len(c.outbounds)-1)
}
outbound := c.outbounds[outboundIndex]
dnsMessage, natTimeout := ChooseNatTimeout(data)