mirror of
https://github.com/daeuniverse/dae.git
synced 2025-02-02 04:14:31 +07:00
fix: should check index before finding outbound
This commit is contained in:
parent
160e17f6e7
commit
94f56fcccb
@ -86,11 +86,11 @@ func (c *ControlPlane) handleConn(lConn net.Conn) (err error) {
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
outbound := c.outbounds[outboundIndex]
|
|
||||||
// TODO: Set-up ip to domain mapping and show domain if possible.
|
// TODO: Set-up ip to domain mapping and show domain if possible.
|
||||||
if outboundIndex < 0 || int(outboundIndex) >= len(c.outbounds) {
|
if outboundIndex < 0 || int(outboundIndex) >= len(c.outbounds) {
|
||||||
return fmt.Errorf("outbound id from bpf is out of range: %v not in [0, %v]", outboundIndex, len(c.outbounds)-1)
|
return fmt.Errorf("outbound id from bpf is out of range: %v not in [0, %v]", outboundIndex, len(c.outbounds)-1)
|
||||||
}
|
}
|
||||||
|
outbound := c.outbounds[outboundIndex]
|
||||||
networkType := &dialer.NetworkType{
|
networkType := &dialer.NetworkType{
|
||||||
L4Proto: consts.L4ProtoStr_TCP,
|
L4Proto: consts.L4ProtoStr_TCP,
|
||||||
IpVersion: consts.IpVersionFromAddr(dst.Addr()),
|
IpVersion: consts.IpVersionFromAddr(dst.Addr()),
|
||||||
|
Loading…
Reference in New Issue
Block a user