diff --git a/link/syscalls.go b/link/syscalls.go index 5802f8927..a661395b3 100644 --- a/link/syscalls.go +++ b/link/syscalls.go @@ -27,9 +27,8 @@ const ( var haveProgAttach = internal.FeatureTest("BPF_PROG_ATTACH", "4.10", func() error { prog, err := ebpf.NewProgram(&ebpf.ProgramSpec{ - Type: ebpf.CGroupSKB, - AttachType: ebpf.AttachCGroupInetIngress, - License: "MIT", + Type: ebpf.CGroupSKB, + License: "MIT", Instructions: asm.Instructions{ asm.Mov.Imm(asm.R0, 0), asm.Return(), diff --git a/prog.go b/prog.go index 5e990af7f..353123512 100644 --- a/prog.go +++ b/prog.go @@ -58,7 +58,12 @@ type ProgramSpec struct { Name string // Type determines at which hook in the kernel a program will run. - Type ProgramType + Type ProgramType + + // AttachType of the program, needed to differentiate allowed context + // accesses in some newer program types like CGroupSockAddr. + // + // Available on kernels 4.17 and later. AttachType AttachType // Name of a kernel data structure or function to attach to. Its