Skip to content

Commit

Permalink
Update http_trace.bpf.c
Browse files Browse the repository at this point in the history
  • Loading branch information
feiskyer authored Dec 28, 2024
1 parent ecd1629 commit 1e96382
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions bpf-apps/http_trace.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ int http_trace(struct __sk_buff *skb)
event->sport = bpf_ntohs(tcph.source);
event->dport = bpf_ntohs(tcph.dest);
event->payload_length = payload_length;
__u32 read_length =
payload_length > MAX_LENGTH ? MAX_LENGTH : payload_length;
bpf_skb_load_bytes(skb, payload_offset, event->payload, read_length);
bpf_skb_load_bytes(skb, payload_offset, event->payload, sizeof(event->payload));
bpf_skb_load_bytes(skb, ETH_HLEN + offsetof(struct iphdr, saddr),
&event->saddr, 4);
bpf_skb_load_bytes(skb, ETH_HLEN + offsetof(struct iphdr, daddr),
Expand Down

0 comments on commit 1e96382

Please sign in to comment.