Skip to content

Commit

Permalink
bpf: ct: clean up handling of ACTION_CREATE
Browse files Browse the repository at this point in the history
The magic bit operations make things unnecessarily difficult.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
  • Loading branch information
julianwiedmann committed Jun 13, 2023
1 parent 7539539 commit e70dbad
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions bpf/lib/conntrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ __ct_lookup(const void *map, struct __ctx_buff *ctx, const void *tuple,
{
bool syn = seen_flags.value & TCP_FLAG_SYN;
struct ct_entry *entry;
int reopen;

relax_verifier();

Expand Down Expand Up @@ -248,9 +247,7 @@ __ct_lookup(const void *map, struct __ctx_buff *ctx, const void *tuple,
#endif
switch (action) {
case ACTION_CREATE:
reopen = entry->rx_closing | entry->tx_closing;
reopen |= seen_flags.value & TCP_FLAG_SYN;
if (unlikely(reopen == (TCP_FLAG_SYN|0x1))) {
if (unlikely(syn && ct_entry_closing(entry))) {
ct_reset_closing(entry);
*monitor = ct_update_timeout(entry, is_tcp, dir, seen_flags);
return CT_REOPENED;
Expand Down

0 comments on commit e70dbad

Please sign in to comment.