aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2016-05-08 18:22:54 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2016-05-10 18:01:48 +0200
commitee7bb1fb2ec7e4177b25fe0927be2887d73ae87d (patch)
tree45b734d5a3ca1762a504d0b91548246d5ff22cf6 /src
parent17c816ff84080fe55e7055a3e487379fc24259a3 (diff)
gtp: fix missing initialization of netns file descriptor
0 is a valid file descriptor and it is the default value after calloc(), so set this -1 so we don't send it through netlink as used init_netns. Fixes: 200b2f4 ("gtp-rtnl: and netns support") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/gtp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gtp.c b/src/gtp.c
index bb5eaaf..bcc3e74 100644
--- a/src/gtp.c
+++ b/src/gtp.c
@@ -29,7 +29,14 @@
struct gtp_tunnel *gtp_tunnel_alloc(void)
{
- return calloc(1, sizeof(struct gtp_tunnel));
+ struct gtp_tunnel *t;
+
+ t = calloc(1, sizeof(struct gtp_tunnel));
+ if (!t)
+ return NULL;
+
+ t->ifns = -1;
+ return t;
}
EXPORT_SYMBOL(gtp_tunnel_alloc);