Merge
This commit is contained in:
parent
7f377620ef
commit
a0336477dd
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
load_bpf
|
||||
tp_tcp.o
|
||||
.**.swp
|
@ -6,6 +6,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#include "common.h"
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
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;
|
||||
|
2
tp_tcp.c
2
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)
|
||||
|
Loading…
Reference in New Issue
Block a user