-
Describe the bug My .c file: #include "vmlinux.h" #define AF_INET 2 char __license[] SEC("license") = "Dual MIT/GPL"; struct { struct event {
}; SEC("fentry/tcp_v4_connect")
} my go file: package main import (
) type bpfEvent struct {
} func main() {
link, err := link.AttachTracing(link.TracingOptions{
} func intToIP(ipNum uint32) net.IP { As you can see both structs in map and go are equal types: type bpfEvent struct {
} VS struct event {
}; But the data that I get isn't reliable To Reproduce $ telnet www.google.com 443 --> the program prints: Dest Port 55354 Dest IP is cutted and Port isn't correct. go version
uname -a
cat /etc/issue Expected behavior |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @YJesus, I've converted your issue to a discussion since this is unlikely to be a bug. Your markup is messed up and it's not possible to read your code, maybe something to fix. P.S.: Showing which changes you made to the example might also help. |
Beta Was this translation helpful? Give feedback.
-
You are right, my mistake for the bad paste :( I attach the code |
Beta Was this translation helpful? Give feedback.
-
Meh, again my mistake struct sockaddr_in *ipv4 = (struct sockaddr_in *)uaddr->sa_data; Must be: struct sockaddr_in *ipv4 = (struct sockaddr_in *)uaddr; shame on me !! |
Beta Was this translation helpful? Give feedback.
Meh, again my mistake
struct sockaddr_in *ipv4 = (struct sockaddr_in *)uaddr->sa_data;
Must be:
struct sockaddr_in *ipv4 = (struct sockaddr_in *)uaddr;
shame on me !!