Skip to content

Commit

Permalink
fix prefix removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Gandem committed Jul 18, 2024
1 parent a4c5383 commit 55d4105
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions interpreter/nodev8/v8.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,19 +584,19 @@ func (i *v8Instance) SynchronizeMappings(ebpf interpreter.EbpfHandler,
}
}

// Remove prefixes not seen
for prefix, generation := range i.prefixes {
if generation == i.mappingGeneration {
continue
}
_ = ebpf.DeletePidInterpreterMapping(pid, prefix)
delete(i.prefixes, prefix)
}
for m, generation := range i.mappings {
if generation == i.mappingGeneration {
continue
}
log.Debugf("Disabling V8 for %#x/%#x", m.Vaddr, m.Length)
prefixes, err := lpm.CalculatePrefixList(m.Vaddr, m.Vaddr+m.Length)
if err != nil {
return fmt.Errorf("new anonymous mapping lpm failure %#x/%#x", m.Vaddr, m.Length)
}
for _, prefix := range prefixes {
_ = ebpf.DeletePidInterpreterMapping(pid, prefix)
delete(i.prefixes, prefix)
}
delete(i.mappings, m)
}

Expand Down

0 comments on commit 55d4105

Please sign in to comment.