From 56a2f849e224f899cba9122f80b9d456590212e9 Mon Sep 17 00:00:00 2001 From: Martynas Pumputis Date: Fri, 17 Apr 2020 21:33:13 +0200 Subject: [PATCH] datapath: Recreate CT entry without removing stale equivalent Previously, when a stale CT entry (of non CT_SERVICE type) was detected (from a previous connection to a service with the same IP/port, but a different rev_nat_index), the entry was removed, and only afterwards recreated. The removal included the removal of related SNAT entries. However, in such case there were no SNAT entries created, thus the removal of CT + SNAT before the recreation was redundant. Signed-off-by: Martynas Pumputis --- bpf/bpf_lxc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/bpf/bpf_lxc.c b/bpf/bpf_lxc.c index 5b0f5944b7e4..57a18fd0c869 100644 --- a/bpf/bpf_lxc.c +++ b/bpf/bpf_lxc.c @@ -199,7 +199,6 @@ static __always_inline int ipv6_l3_from_lxc(struct __ctx_buff *ctx, case CT_ESTABLISHED: /* Did we end up at a stale non-service entry? Recreate if so. */ if (unlikely(ct_state.rev_nat_index != ct_state_new.rev_nat_index)) { - ct_delete6(get_ct_map6(tuple), tuple, ctx); goto ct_recreate6; } break; @@ -557,7 +556,6 @@ static __always_inline int handle_ipv4_from_lxc(struct __ctx_buff *ctx, case CT_ESTABLISHED: /* Did we end up at a stale non-service entry? Recreate if so. */ if (unlikely(ct_state.rev_nat_index != ct_state_new.rev_nat_index)) { - ct_delete4(get_ct_map4(&tuple), &tuple, ctx); goto ct_recreate4; } break;