From a0336477dd9e8e3ff1e350b20c0d981c9d3beb81 Mon Sep 17 00:00:00 2001 From: gbucchino Date: Mon, 8 Jul 2024 10:56:32 +0200 Subject: [PATCH] Merge --- .gitignore | 3 +++ load_bpf.c | 2 ++ tp_tcp.c | 2 -- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f70a512 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +load_bpf +tp_tcp.o +.**.swp diff --git a/load_bpf.c b/load_bpf.c index 06f44cd..ddcfb9a 100644 --- a/load_bpf.c +++ b/load_bpf.c @@ -6,6 +6,7 @@ #include #include "common.h" #include +#include static void clean_obj(struct bpf_object *obj){ printf("Cleaning\n"); @@ -37,6 +38,7 @@ int main(void){ err = bpf_object__load(obj); if (err){ + printf("%s\n", strerror(errno)); printf("Failed to load object\n"); clean_obj(obj); return -1; diff --git a/tp_tcp.c b/tp_tcp.c index ff95271..06257f2 100644 --- a/tp_tcp.c +++ b/tp_tcp.c @@ -115,13 +115,11 @@ int tcp_retransmit(struct ctx_send_reset *ctx){ f_family = bpf_map_lookup_elem(&filter_family, &keys); if (!f_family) return 0; - } index = bpf_map_lookup_elem(&tcp_stats_index, &keys); if (!index) return 0; - // Get the family of the socket bpf_probe_read_kernel(&family, sizeof(family), &sk->__sk_common.skc_family); if (family != *f_family)