aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/compat/compat.h4
-rw-r--r--src/netlink.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h
index efd4d45..65a1076 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -37,6 +37,10 @@
#define headers_end data
#endif
+#ifndef __ro_after_init
+#define __ro_after_init __read_mostly
+#endif
+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
#include "udp_tunnel/udp_tunnel_partial_compat.h"
#endif
diff --git a/src/netlink.c b/src/netlink.c
index ff32fb6..71da081 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -471,12 +471,10 @@ static const struct genl_ops genl_ops[] = {
}
};
-#ifndef COMPAT_CANNOT_USE_GENL_NOPS
static struct genl_family genl_family __ro_after_init = {
+#ifndef COMPAT_CANNOT_USE_GENL_NOPS
.ops = genl_ops,
.n_ops = ARRAY_SIZE(genl_ops),
-#else
-static struct genl_family genl_family = {
#endif
.name = WG_GENL_NAME,
.version = WG_GENL_VERSION,