mirror of
https://github.com/daeuniverse/dae.git
synced 2024-12-23 01:14:46 +07:00
chore: bump submodule dae_bpf_headers (#487)
This commit is contained in:
parent
b9741c92fc
commit
7aad3a9474
@ -154,6 +154,7 @@ var (
|
|||||||
ChecksumFeatureVersion = internal.Version{5, 8, 0}
|
ChecksumFeatureVersion = internal.Version{5, 8, 0}
|
||||||
ProgTypeSkLookupFeatureVersion = internal.Version{5, 9, 0}
|
ProgTypeSkLookupFeatureVersion = internal.Version{5, 9, 0}
|
||||||
UserspaceBatchUpdateLpmTrieFeatureVersion = internal.Version{5, 13, 0}
|
UserspaceBatchUpdateLpmTrieFeatureVersion = internal.Version{5, 13, 0}
|
||||||
|
HelperBpfGetFuncIpVersionFeatureVersion = internal.Version{5, 15, 0}
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit e4da1c9601e1c3797d02c481a462b66588477495
|
Subproject commit 79f0a7618571882eb5d8243909267e27e34c8290
|
@ -27,6 +27,10 @@ This feature requires kernel version of the machine >= 5.8.
|
|||||||
|
|
||||||
Note that if you bind dae to WAN only, dae only provide network service for local programs and not impact traffic coming in from other interfaces.
|
Note that if you bind dae to WAN only, dae only provide network service for local programs and not impact traffic coming in from other interfaces.
|
||||||
|
|
||||||
|
`Use trace command`
|
||||||
|
|
||||||
|
If you want to use `dae trace` command to triage network connectivity issue, the kernel version is required to be >= 5.15.
|
||||||
|
|
||||||
## Kernel Configurations
|
## Kernel Configurations
|
||||||
|
|
||||||
Usually, mainstream desktop distributions have these items turned on. But in order to reduce kernel size, some items are turned off by default on embedded device distributions like OpenWRT, Armbian, etc.
|
Usually, mainstream desktop distributions have these items turned on. But in order to reduce kernel size, some items are turned off by default on embedded device distributions like OpenWRT, Armbian, etc.
|
||||||
|
@ -25,6 +25,10 @@
|
|||||||
|
|
||||||
如果你只在 `wan_interface` 中填写了接口或 `auto`,而未在 `lan_interface` 中填写内容,那么从局域网中传来的流量将无法被代理。如果你想同时代理本机和局域网流量,请同时填写 `wan_interface` 和 `lan_interface`。
|
如果你只在 `wan_interface` 中填写了接口或 `auto`,而未在 `lan_interface` 中填写内容,那么从局域网中传来的流量将无法被代理。如果你想同时代理本机和局域网流量,请同时填写 `wan_interface` 和 `lan_interface`。
|
||||||
|
|
||||||
|
`使用 trace 命令`
|
||||||
|
|
||||||
|
如果你想用 `dae trace` 命令来诊断网络连通性问题,所在的设备内核版本要求 >= 5.15 。
|
||||||
|
|
||||||
## 内核配置选项
|
## 内核配置选项
|
||||||
|
|
||||||
通常,主流桌面发行版都会打开这些选项。但是为了减小内核大小,在嵌入式设备发行版(如 OpenWRT、Armbian 等)上这些选项可能处于关闭状态。使用以下命令在你的设备上显示内核配置选项:
|
通常,主流桌面发行版都会打开这些选项。但是为了减小内核大小,在嵌入式设备发行版(如 OpenWRT、Armbian 等)上这些选项可能处于关闭状态。使用以下命令在你的设备上显示内核配置选项:
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit e4da1c9601e1c3797d02c481a462b66588477495
|
Subproject commit 79f0a7618571882eb5d8243909267e27e34c8290
|
@ -132,7 +132,7 @@ filter_l3_and_l4(struct sk_buff *skb)
|
|||||||
static __always_inline void
|
static __always_inline void
|
||||||
set_meta(struct meta *meta, struct sk_buff *skb, struct pt_regs *ctx)
|
set_meta(struct meta *meta, struct sk_buff *skb, struct pt_regs *ctx)
|
||||||
{
|
{
|
||||||
meta->pc = BPF_CORE_READ(ctx, ip);
|
meta->pc = bpf_get_func_ip(ctx);
|
||||||
meta->skb = (__u64)skb;
|
meta->skb = (__u64)skb;
|
||||||
meta->second_param = PT_REGS_PARM2(ctx);
|
meta->second_param = PT_REGS_PARM2(ctx);
|
||||||
meta->mark = BPF_CORE_READ(skb, mark);
|
meta->mark = BPF_CORE_READ(skb, mark);
|
||||||
|
@ -20,6 +20,8 @@ import (
|
|||||||
"github.com/cilium/ebpf/btf"
|
"github.com/cilium/ebpf/btf"
|
||||||
"github.com/cilium/ebpf/link"
|
"github.com/cilium/ebpf/link"
|
||||||
"github.com/cilium/ebpf/ringbuf"
|
"github.com/cilium/ebpf/ringbuf"
|
||||||
|
"github.com/daeuniverse/dae/common/consts"
|
||||||
|
internal "github.com/daeuniverse/dae/pkg/ebpf_internal"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -42,6 +44,15 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func StartTrace(ctx context.Context, ipVersion int, l4ProtoNo uint16, port int, outputFile string) (err error) {
|
func StartTrace(ctx context.Context, ipVersion int, l4ProtoNo uint16, port int, outputFile string) (err error) {
|
||||||
|
kernelVersion, err := internal.KernelVersion()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to get kernel version: %w", err)
|
||||||
|
}
|
||||||
|
if requirement := consts.HelperBpfGetFuncIpVersionFeatureVersion; kernelVersion.Less(requirement) {
|
||||||
|
return fmt.Errorf("your kernel version %v does not support bpf_get_func_ip; expect >=%v; upgrade your kernel and try again",
|
||||||
|
kernelVersion.String(),
|
||||||
|
requirement.String())
|
||||||
|
}
|
||||||
objs, err := rewriteAndLoadBpf(ipVersion, l4ProtoNo, port)
|
objs, err := rewriteAndLoadBpf(ipVersion, l4ProtoNo, port)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user