--- zzzz-none-000/linux-5.4.213/include/net/net_namespace.h 2022-09-15 10:04:56.000000000 +0000 +++ alder-5690pro-762/linux-5.4.213/include/net/net_namespace.h 2024-08-14 09:02:08.000000000 +0000 @@ -47,6 +47,14 @@ struct netns_ipvs; struct bpf_prog; +/* Do not include avm_pa.h to avoid include cycle. Since we can't determine + * the size here we reserve some space, including some extra space for future + * extensions without having to rebuild the world. + * + * avm_pa contains a BUILD_BUG_ON() in case the reserve is too small. + */ +#define AVM_PA_DEV_INFO_NET_RESERVE 8 +struct avm_pa_dev_info; #define NETDEV_HASHBITS 8 #define NETDEV_HASHENTRIES (1 << NETDEV_HASHBITS) @@ -180,6 +188,15 @@ #if IS_ENABLED(CONFIG_CRYPTO_USER) struct sock *crypto_nlsk; #endif +#if IS_ENABLED(CONFIG_AVM_PA) + u8 avm_pa[AVM_PA_DEV_INFO_NET_RESERVE * 2]; +#define AVM_PA_NET_IP_DEVINFO(net) ((struct avm_pa_dev_info *) &(net)->avm_pa[0]) +#define AVM_PA_NET_IP6_DEVINFO(net) ((struct avm_pa_dev_info *) (IS_ENABLED(CONFIG_IPV6) ? \ + &(net)->avm_pa[AVM_PA_DEV_INFO_NET_RESERVE] : ((void)(net), NULL))) +#else +#define AVM_PA_NET_IP_DEVINFO(net) ((struct avm_pa_dev_info *) ((void)(net), NULL)) +#define AVM_PA_NET_IP6_DEVINFO(net) ((struct avm_pa_dev_info *) ((void)(net), NULL)) +#endif struct sock *diag_nlsk; } __randomize_layout;