Skip to content

Commit

Permalink
Fix will_drop
Browse files Browse the repository at this point in the history
  • Loading branch information
hack3ric committed Mar 28, 2024
1 parent 6b7e4b7 commit f152e60
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/bpf/ingress.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ int ingress_handler(struct xdp_md* xdp) {

u32 buf_len = bpf_xdp_get_buff_len(xdp);
u32 payload_len = buf_len - ip_end - sizeof(*tcp);
// log_trace("ingress: payload_len = %d", payload_len);

// TODO: verify checksum

Expand Down Expand Up @@ -173,10 +172,8 @@ int ingress_handler(struct xdp_md* xdp) {
log_tcp(log_verbosity, LOG_LEVEL_TRACE, true, LOG_TYPE_TCP_PKT, 0, bpf_ntohl(tcp->seq), bpf_ntohl(tcp->ack_seq));
log_tcp(log_verbosity, LOG_LEVEL_TRACE, true, LOG_TYPE_STATE, state, seq, ack_seq);

if (will_send_ctrl_packet) {
send_ctrl_packet(conn_key, syn, ack, rst, seq, ack_seq);
return XDP_DROP;
}
if (will_send_ctrl_packet) send_ctrl_packet(conn_key, syn, ack, rst, seq, ack_seq);
if (will_drop) return XDP_DROP;

__be32 ipv4_saddr = 0, ipv4_daddr = 0;
struct in6_addr ipv6_saddr = {}, ipv6_daddr = {};
Expand Down

0 comments on commit f152e60

Please sign in to comment.