File tree 1 file changed +8
-18
lines changed
1 file changed +8
-18
lines changed Original file line number Diff line number Diff line change @@ -204,31 +204,21 @@ func bpfMapCreate(attr *bpfMapCreateAttr) (*internal.FD, error) {
204
204
}
205
205
206
206
var haveNestedMaps = internal .FeatureTest ("nested maps" , "4.12" , func () error {
207
- inner , err := bpfMapCreate (& bpfMapCreateAttr {
208
- mapType : Array ,
209
- keySize : 4 ,
210
- valueSize : 4 ,
211
- maxEntries : 1 ,
212
- })
213
- if err != nil {
214
- return err
215
- }
216
- defer inner .Close ()
217
-
218
- innerFd , _ := inner .Value ()
219
- nested , err := bpfMapCreate (& bpfMapCreateAttr {
207
+ _ , err := bpfMapCreate (& bpfMapCreateAttr {
220
208
mapType : ArrayOfMaps ,
221
209
keySize : 4 ,
222
210
valueSize : 4 ,
223
211
maxEntries : 1 ,
224
- innerMapFd : innerFd ,
212
+ // Invalid file descriptor.
213
+ innerMapFd : ^ uint32 (0 ),
225
214
})
226
- if err != nil {
215
+ if errors . Is ( err , unix . EINVAL ) {
227
216
return internal .ErrNotSupported
228
217
}
229
-
230
- _ = nested .Close ()
231
- return nil
218
+ if errors .Is (err , unix .EBADF ) {
219
+ return nil
220
+ }
221
+ return err
232
222
})
233
223
234
224
var haveMapMutabilityModifiers = internal .FeatureTest ("read- and write-only maps" , "5.2" , func () error {
You can’t perform that action at this time.
0 commit comments