def print_req_policy_fwd(cw, struct, ri=None, terminate=True):
- if terminate and ri and kernel_can_gen_family_struct(struct.family):
+ if terminate and ri and policy_should_be_static(struct.family):
return
if terminate:
prefix = 'extern '
else:
- if kernel_can_gen_family_struct(struct.family) and ri:
+ if ri and policy_should_be_static(struct.family):
prefix = 'static '
else:
prefix = ''
return family.proto == 'genetlink'
+def policy_should_be_static(family):
+ return family.kernel_policy == 'split' or kernel_can_gen_family_struct(family)
+
+
def print_kernel_op_table_fwd(family, cw, terminate):
exported = not kernel_can_gen_family_struct(family)