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

liuhan pushed a commit to branch reduce-handle-connect-time
in repository https://gitbox.apache.org/repos/asf/skywalking-rover.git


The following commit(s) were added to refs/heads/reduce-handle-connect-time by 
this push:
     new c19b4ab  add filter
c19b4ab is described below

commit c19b4ab5286e951f072e70246ed08f1274179f17
Author: mrproliu <[email protected]>
AuthorDate: Sat Dec 28 11:21:20 2024 +0800

    add filter
---
 pkg/tools/ip/conntrack.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pkg/tools/ip/conntrack.go b/pkg/tools/ip/conntrack.go
index 52aad4d..988b0d9 100644
--- a/pkg/tools/ip/conntrack.go
+++ b/pkg/tools/ip/conntrack.go
@@ -61,7 +61,9 @@ func NewConnTrack() (*ConnTrack, error) {
                nfct.RegisterFiltered(context.Background(), conntrack.Conntrack,
                        
conntrack.NetlinkCtNew|conntrack.NetlinkCtUpdate|conntrack.NetlinkCtExpectedNew|conntrack.NetlinkCtExpectedUpdate,
 nil, func(event conntrack.Con) int {
                                if event.Origin == nil || event.Origin.Src == 
nil || event.Origin.Dst == nil || event.Origin.Proto == nil ||
-                                       event.Reply == nil || event.Reply.Src 
== nil || event.Reply.Dst == nil || event.Reply.Proto == nil {
+                                       event.Origin.Proto.SrcPort == nil || 
event.Origin.Proto.DstPort == nil ||
+                                       event.Reply == nil || event.Reply.Src 
== nil || event.Reply.Dst == nil || event.Reply.Proto == nil ||
+                                       event.Reply.Proto.SrcPort == nil || 
event.Reply.Proto.DstPort == nil {
                                        return 0
                                }
                                log.Infof("conntrack event: origin: 
%s:%d->%s:%d, reply: %s:%d->%s:%d",

Reply via email to