summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2014-02-20 01:45:12 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2014-02-20 02:34:40 +0100
commitd7cdbddebdd5620d6b2d3b94380e693f3d6671a0 (patch)
tree292c6e26c28e1135affdb46df3be16a770667053
parent4e93f63f6f459d873980c66069001c55857a7623 (diff)
gtp: compile with Linux kernel 3.10.28
Add tweak to get this compiling with 3.10.28. Test shows that works for me.
-rw-r--r--gtp.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gtp.c b/gtp.c
index 466146a..7c14828 100644
--- a/gtp.c
+++ b/gtp.c
@@ -1237,7 +1237,11 @@ static struct nla_policy gtp_genl_policy[GTPA_MAX + 1] = {
[GTPA_MS_ADDRESS] = { .type = NLA_NESTED, },
};
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)
static const struct genl_ops gtp_genl_ops[] = {
+#else
+static struct genl_ops gtp_genl_ops[] = {
+#endif
{
.cmd = GTP_CMD_TUNNEL_NEW,
.doit = gtp_genl_tunnel_new,
@@ -1269,10 +1273,17 @@ static int __init gtp_init(void)
get_random_bytes(&gtp_h_initval, sizeof(gtp_h_initval));
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)
err = genl_register_family_with_ops(&gtp_genl_family, gtp_genl_ops);
if (err < 0)
return err;
-
+#else
+ err = genl_register_family_with_ops(&gtp_genl_family,
+ gtp_genl_ops,
+ ARRAY_SIZE(gtp_genl_ops));
+ if (err < 0)
+ return err;
+#endif
err = rtnl_link_register(&gtp_link_ops);
if (err < 0)
goto err1;