From beed9726e3d755efea20be3472a68741cbcfb6b4 Mon Sep 17 00:00:00 2001 From: Steven Polley Date: Tue, 16 Apr 2024 20:09:01 -0600 Subject: [PATCH] remove unreferenced macros... These were previously used while trying to parse out specific headers. They are no longer required though because the current length bounds checks covers edge cases. --- hypd/server/hyp_bpf.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/hypd/server/hyp_bpf.c b/hypd/server/hyp_bpf.c index f4f8893..e327f57 100644 --- a/hypd/server/hyp_bpf.c +++ b/hypd/server/hyp_bpf.c @@ -7,12 +7,8 @@ Copyright © 2024 Steven Polley #include "bpf_endian.h" #include - char __license[] SEC("license") = "BSD"; -#define ETH_P_IP 0x0800 -#define IP_FRAGMENTED 65343 - // representation of knock data that gets sent to userspace struct knock_data { __u32 srcip; // 4 bytes @@ -44,7 +40,6 @@ int xdp_prog_func(struct xdp_md *ctx) { // parse ethernet header struct ethhdr *eth = data; - if ((void *)eth + sizeof(*eth) <= data_end) { // parse IP header struct iphdr *ip = data + sizeof(*eth);