Skip to content

Commit

Permalink
Add some more logging
Browse files Browse the repository at this point in the history
Signed-off-by: astoycos <[email protected]>
  • Loading branch information
astoycos committed Nov 3, 2022
1 parent 1d0a065 commit f8dd6bb
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bpf/xdp_udp.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@ static __always_inline __u16 udp_checksum(struct iphdr *ip, struct udphdr * udp,

int udp_len = bpf_ntohs(udp->len);

// Verifier fails without this check
if (udp_len >= MAX_UDP_LENGTH) {
return 1;
}

// Here we only want to iterate through payload
// NOT trailing bits
for (int i = 0; i < udp_len; i += 2) {
// Verifier Fails without this check
if ((void *)(buf + 1) > data_end) {
break;
}
Expand Down
Binary file modified userspace-go/bpf_bpfeb.o
Binary file not shown.
Binary file modified userspace-go/bpf_bpfel.o
Binary file not shown.
Binary file modified userspace-go/userspace-go
Binary file not shown.

0 comments on commit f8dd6bb

Please sign in to comment.