func runGC(e *endpoint.Endpoint, prefix string, ctType ctmap.CtType) { file := prefix + strconv.Itoa(int(e.ID)) fd, err := bpf.ObjGet(file) if err != nil { log.Warningf("Unable to open CT map %s: %s\n", file, err) e.LogStatus(endpoint.Warning, fmt.Sprintf("Unable to open CT map %s: %s", file, err)) return } f := os.NewFile(uintptr(fd), file) m := ctmap.CtMap{Fd: fd, Type: ctType} deleted := m.GC(uint16(GcInterval)) if deleted > 0 { log.Debugf("Deleted %d entries from map %s", deleted, file) } f.Close() }