Skip to content

Commit 231a9fd

Browse files
committed
features: update prog feature matrix for types added since 5.14
Add feature probe for prog type Netfilter. Signed-off-by: Tobias Klauser <[email protected]>
1 parent ae25ce5 commit 231a9fd

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

features/prog.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,15 @@ var haveProgramTypeMatrix = internal.FeatureMatrix[ebpf.ProgramType]{
190190
})
191191
},
192192
},
193+
ebpf.Netfilter: {
194+
Version: "6.4",
195+
Fn: func() error {
196+
return probeProgram(&ebpf.ProgramSpec{
197+
Type: ebpf.Netfilter,
198+
AttachType: ebpf.AttachNetfilter,
199+
})
200+
},
201+
},
193202
}
194203

195204
func init() {
@@ -261,6 +270,8 @@ func haveProgramHelper(pt ebpf.ProgramType, helper asm.BuiltinFunc) error {
261270
spec.AttachType = ebpf.AttachSkLookup
262271
case ebpf.Syscall:
263272
spec.Flags = sys.BPF_F_SLEEPABLE
273+
case ebpf.Netfilter:
274+
spec.AttachType = ebpf.AttachNetfilter
264275
}
265276

266277
prog, err := ebpf.NewProgramWithOptions(spec, ebpf.ProgramOptions{

features/prog_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ func TestHaveProgramHelper(t *testing.T) {
6666
{ebpf.CGroupSockopt, asm.FnSkStorageDelete, nil, "5.3"}, // 6ac99e8f23d4
6767
{ebpf.SkLookup, asm.FnSkcToUdp6Sock, nil, "5.9"}, // 0d4fad3e57df
6868
{ebpf.Syscall, asm.FnSysClose, nil, "5.14"}, // 3abea089246f
69+
{ebpf.Netfilter, asm.FnCgrpStorageDelete, nil, "6.4"}, // c4bcfb38a95e
6970
}
7071

7172
for _, tc := range testCases {

0 commit comments

Comments
 (0)