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.
This commit is contained in:
parent
e85b644e82
commit
beed9726e3
@ -7,12 +7,8 @@ Copyright © 2024 Steven Polley <himself@stevenpolley.net>
|
|||||||
#include "bpf_endian.h"
|
#include "bpf_endian.h"
|
||||||
#include <bpf/bpf_helpers.h>
|
#include <bpf/bpf_helpers.h>
|
||||||
|
|
||||||
|
|
||||||
char __license[] SEC("license") = "BSD";
|
char __license[] SEC("license") = "BSD";
|
||||||
|
|
||||||
#define ETH_P_IP 0x0800
|
|
||||||
#define IP_FRAGMENTED 65343
|
|
||||||
|
|
||||||
// representation of knock data that gets sent to userspace
|
// representation of knock data that gets sent to userspace
|
||||||
struct knock_data {
|
struct knock_data {
|
||||||
__u32 srcip; // 4 bytes
|
__u32 srcip; // 4 bytes
|
||||||
@ -44,7 +40,6 @@ int xdp_prog_func(struct xdp_md *ctx) {
|
|||||||
|
|
||||||
// parse ethernet header
|
// parse ethernet header
|
||||||
struct ethhdr *eth = data;
|
struct ethhdr *eth = data;
|
||||||
|
|
||||||
if ((void *)eth + sizeof(*eth) <= data_end) {
|
if ((void *)eth + sizeof(*eth) <= data_end) {
|
||||||
// parse IP header
|
// parse IP header
|
||||||
struct iphdr *ip = data + sizeof(*eth);
|
struct iphdr *ip = data + sizeof(*eth);
|
||||||
|
Loading…
Reference in New Issue
Block a user