Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
  • Loading branch information
glazychev-art committed Mar 25, 2022
1 parent 982980d commit 87e623f
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
}
Expand Down

0 comments on commit 87e623f

Please sign in to comment.