diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-05-08 18:22:54 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-05-10 18:01:48 +0200 |
commit | ee7bb1fb2ec7e4177b25fe0927be2887d73ae87d (patch) | |
tree | 45b734d5a3ca1762a504d0b91548246d5ff22cf6 /src | |
parent | 17c816ff84080fe55e7055a3e487379fc24259a3 (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.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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); |