libbpf: Support expected_attach_type at prog load
[muen/linux.git] / tools / include / uapi / linux / bpf.h
index 58060bec999dda3c2c428d908be3f77d8d7953eb..e1c1fed63396fbc0b408cb1348fe6d48da346e12 100644 (file)
@@ -296,6 +296,11 @@ union bpf_attr {
                __u32           prog_flags;
                char            prog_name[BPF_OBJ_NAME_LEN];
                __u32           prog_ifindex;   /* ifindex of netdev to prep for */
+               /* For some prog types expected attach type must be known at
+                * load time to verify attach type specific parts of prog
+                * (context accesses, allowed helpers, etc).
+                */
+               __u32           expected_attach_type;
        };
 
        struct { /* anonymous struct used by BPF_OBJ_* commands */