Skip to content

Commit 9bc6753

Browse files
committed
cgroups: ebpf: also check for ebpf.ErrNotSupported
It is possible for LinkAttachProgram to return ErrNotSupported if program attachment is not supported at all (which doesn't matter in this case), but it seems possible that upstream will start returning ErrNotSupported for BPF_F_REPLACE at some point so it's best to make sure we don't cause additional regressions here. Signed-off-by: Aleksa Sarai <[email protected]>
1 parent dea0e04 commit 9bc6753

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libcontainer/cgroups/devices/ebpf_linux.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,10 @@ func haveBpfProgReplace() bool {
133133
Attach: ebpf.AttachCGroupDevice,
134134
Flags: unix.BPF_F_ALLOW_MULTI,
135135
})
136-
if errors.Is(err, unix.EINVAL) {
136+
if errors.Is(err, ebpf.ErrNotSupported) || errors.Is(err, unix.EINVAL) {
137137
// not supported
138138
return
139139
}
140-
// attach_flags test succeeded.
141140
if !errors.Is(err, unix.EBADF) {
142141
logrus.Debugf("checking for BPF_F_REPLACE: got unexpected (not EBADF or EINVAL) error: %v", err)
143142
}

0 commit comments

Comments
 (0)