From 05e59e5fb0064c97a1c10921ecd549f2d4a58565 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Wed, 09 Oct 2024 06:14:40 +0000 Subject: [PATCH] add REDIRECT --- kernel/samples/bpf/tcp_rwnd_kern.c | 13 +++---------- 1 files changed, 3 insertions(+), 10 deletions(-) diff --git a/kernel/samples/bpf/tcp_rwnd_kern.c b/kernel/samples/bpf/tcp_rwnd_kern.c index 09ff65b..223d9c2 100644 --- a/kernel/samples/bpf/tcp_rwnd_kern.c +++ b/kernel/samples/bpf/tcp_rwnd_kern.c @@ -8,7 +8,7 @@ * and the first 5.5 bytes of the IPv6 addresses are not the same (in this * example that means both hosts are not the same datacenter). * - * Use load_sock_ops to load this BPF program. + * Use "bpftool cgroup attach $cg sock_ops $prog" to load this BPF program. */ #include <uapi/linux/bpf.h> @@ -16,17 +16,10 @@ #include <uapi/linux/if_packet.h> #include <uapi/linux/ip.h> #include <linux/socket.h> -#include "bpf_helpers.h" -#include "bpf_endian.h" +#include <bpf/bpf_helpers.h> +#include <bpf/bpf_endian.h> #define DEBUG 1 - -#define bpf_printk(fmt, ...) \ -({ \ - char ____fmt[] = fmt; \ - bpf_trace_printk(____fmt, sizeof(____fmt), \ - ##__VA_ARGS__); \ -}) SEC("sockops") int bpf_rwnd(struct bpf_sock_ops *skops) -- Gitblit v1.6.2