You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by wu...@apache.org on 2024/06/13 04:54:08 UTC

(skywalking-rover) branch main updated: Fixed `ip_list_rcv` probe is not exist in older linux kernel (#130)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-rover.git


The following commit(s) were added to refs/heads/main by this push:
     new 393fa59  Fixed `ip_list_rcv` probe is not exist in older linux kernel (#130)
393fa59 is described below

commit 393fa596f82157fe4707c955be911c0632b9fc56
Author: mrproliu <74...@qq.com>
AuthorDate: Thu Jun 13 04:54:04 2024 +0000

    Fixed `ip_list_rcv` probe is not exist in older linux kernel (#130)
---
 CHANGES.md                     | 1 +
 pkg/accesslog/collector/l24.go | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index 13b3b37..3c1fa83 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -11,6 +11,7 @@ Release Notes.
 #### Bug Fixes
 * Fixed the issue where `conntrack` could not find the Reply IP in the access log module.
 * Fix errors when compiling C source files into eBPF bytecode on a system with Linux headers version 6.2 or higher.
+* Fixed `ip_list_rcv` probe is not exist in older linux kernel.
 
 #### Documentation
 
diff --git a/pkg/accesslog/collector/l24.go b/pkg/accesslog/collector/l24.go
index aaf4182..ef0aeb5 100644
--- a/pkg/accesslog/collector/l24.go
+++ b/pkg/accesslog/collector/l24.go
@@ -45,13 +45,13 @@ func (c *L24Collector) startRead(_ *module.Manager, context *common.AccessLogCon
 	context.BPF.AddTracePoint("net", "netif_receive_skb", context.BPF.TracepointNetifReceiveSkb)
 
 	// l3
-	context.BPF.AddLink(link.Kprobe, map[string]*ebpf.Program{"ip_list_rcv": context.BPF.IpListRcv})
-	context.BPF.AddLink(link.Kretprobe, map[string]*ebpf.Program{"ip_list_rcv": context.BPF.IpListRcvRet})
 	context.BPF.AddLink(link.Kprobe, map[string]*ebpf.Program{"ip_rcv": context.BPF.IpRcv})
 	context.BPF.AddLink(link.Kretprobe, map[string]*ebpf.Program{"ip_rcv": context.BPF.IpRcvRet})
 	context.BPF.AddLink(link.Kprobe, map[string]*ebpf.Program{"ip_rcv_finish": context.BPF.IpRcvFinish})
 	context.BPF.AddLink(link.Kprobe, map[string]*ebpf.Program{"ip_local_deliver": context.BPF.IpLocalDeliver})
 	// it's not exist in old kernel versions
+	_ = context.BPF.AddLinkOrError(link.Kprobe, map[string]*ebpf.Program{"ip_list_rcv": context.BPF.IpListRcv})
+	_ = context.BPF.AddLinkOrError(link.Kretprobe, map[string]*ebpf.Program{"ip_list_rcv": context.BPF.IpListRcvRet})
 	_ = context.BPF.AddLinkOrError(link.Kprobe, map[string]*ebpf.Program{"ip_sublist_rcv_finish": context.BPF.IpSublistRcvFinish})
 	_ = context.BPF.AddLinkOrError(link.Kprobe, map[string]*ebpf.Program{"ip_local_deliver_finish": context.BPF.IpLocalDeliverFinish})