Blame SOURCES/bcc-0.16.0-tools-tcptracer-fix-alignement-in-tcp_ipv6_event_t.patch

f0a508
From 52c4e8cec4dd560503ff011f8fe7eec5f67b33c9 Mon Sep 17 00:00:00 2001
f0a508
From: Jerome Marchand <jmarchan@redhat.com>
f0a508
Date: Thu, 17 Sep 2020 10:37:02 +0200
f0a508
Subject: [PATCH 2/2] tools: tcptracer: fix alignement in tcp_ipv6_event_t
f0a508
f0a508
On IPv6, tcptracer ports always appears as zeros:
f0a508
f0a508
Tracing TCP established connections. Ctrl-C to end.
f0a508
T  PID    COMM             IP SADDR            DADDR            SPORT  DPORT
f0a508
X  7055   nc               4  127.0.0.1        127.0.0.1        49476  9999
f0a508
C  7074   nc               4  127.0.0.1        127.0.0.1        49478  9999
f0a508
X  7074   nc               4  127.0.0.1        127.0.0.1        49478  9999
f0a508
C  7085   nc               6  [::]             [0:0:0:1::]      0      0
f0a508
X  7085   nc               6  [::]             [0:0:0:1::]      0      0
f0a508
C  7086   nc               6  [::]             [0:0:0:1::]      0      0
f0a508
f0a508
This seems related to alignment issue wrt to the __int128 type in
f0a508
tcp_ipv6_event_t structure. Moving the u8 field ip to the end of the
f0a508
structure fixes the issue.
f0a508
f0a508
Fixes #2781
f0a508
---
f0a508
 tools/tcptracer.py | 2 +-
f0a508
 1 file changed, 1 insertion(+), 1 deletion(-)
f0a508
f0a508
diff --git a/tools/tcptracer.py b/tools/tcptracer.py
f0a508
index 2e486b15..3220105e 100755
f0a508
--- a/tools/tcptracer.py
f0a508
+++ b/tools/tcptracer.py
f0a508
@@ -73,12 +73,12 @@ struct tcp_ipv6_event_t {
f0a508
     u32 type;
f0a508
     u32 pid;
f0a508
     char comm[TASK_COMM_LEN];
f0a508
-    u8 ip;
f0a508
     unsigned __int128 saddr;
f0a508
     unsigned __int128 daddr;
f0a508
     u16 sport;
f0a508
     u16 dport;
f0a508
     u32 netns;
f0a508
+    u8 ip;
f0a508
 };
f0a508
 BPF_PERF_OUTPUT(tcp_ipv6_event);
f0a508
 
f0a508
-- 
f0a508
2.25.4
f0a508