From 87e623feeca173a1ffc6e8e6ac8e95cf426a62c3 Mon Sep 17 00:00:00 2001 From: Artem Glazychev Date: Fri, 25 Mar 2022 20:46:58 +0700 Subject: [PATCH] fix comment Signed-off-by: Artem Glazychev --- .../connectioncontextkernel/ipcontext/iprule/common.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkg/kernel/networkservice/connectioncontextkernel/ipcontext/iprule/common.go b/pkg/kernel/networkservice/connectioncontextkernel/ipcontext/iprule/common.go index dc6e640c..2472da12 100644 --- a/pkg/kernel/networkservice/connectioncontextkernel/ipcontext/iprule/common.go +++ b/pkg/kernel/networkservice/connectioncontextkernel/ipcontext/iprule/common.go @@ -246,17 +246,12 @@ func del(ctx context.Context, conn *networkservice.Connection, tableIDs *Map) er return errors.WithStack(err) } defer netlinkHandle.Close() - ps, ok := tableIDs.Load(conn.GetId()) + ps, ok := tableIDs.LoadAndDelete(conn.GetId()) if ok { for tableID, policy := range ps { if err := delRule(ctx, netlinkHandle, policy, tableID); err != nil { return errors.WithStack(err) } - delete(ps, tableID) - tableIDs.Store(conn.GetId(), ps) - } - if len(ps) == 0 { - tableIDs.Delete(conn.GetId()) } } }