Skip to content

Commit

Permalink
Merge pull request #8235 from fasaxc/pick-map-fix
Browse files Browse the repository at this point in the history
Fix incorrect cleanup of policy maps.
  • Loading branch information
fasaxc committed Nov 17, 2023
2 parents 615b2bd + 5b6e6ae commit 0cee59a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion felix/dataplane/linux/bpf_ep_mgr.go
Expand Up @@ -1130,13 +1130,19 @@ func (m *bpfEndpointManager) syncIfStateMap() {
// about as we will not hear about that device again.
for _, fn := range []func() int{
v.XDPPolicy,
} {
if idx := fn(); idx != -1 {
_ = jumpMapDeleteEntry(m.bpfmaps.XDPJumpMap, idx)
}
}
for _, fn := range []func() int{
v.IngressPolicy,
v.EgressPolicy,
v.TcIngressFilter,
v.TcEgressFilter,
} {
if idx := fn(); idx != -1 {
_ = jumpMapDeleteEntry(m.bpfmaps.XDPJumpMap, idx)
_ = jumpMapDeleteEntry(m.bpfmaps.JumpMap, idx)
}
}
} else {
Expand Down

0 comments on commit 0cee59a

Please sign in to comment.