Skip to content

Commit

Permalink
Fix incorrect cleanup of policy maps.
Browse files Browse the repository at this point in the history
We would always clean up entries in the XDP map,
not the TC map when a device was removed.
  • Loading branch information
fasaxc committed Nov 17, 2023
1 parent 8d31b26 commit 5b6e6ae
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion felix/dataplane/linux/bpf_ep_mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -1124,13 +1124,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 5b6e6ae

Please sign in to comment.