diff options
author | Eric Dumazet <edumazet@google.com> | 2021-12-09 23:44:26 -0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-12-10 06:38:27 -0800 |
commit | 11b311a867b6b3208fdc3cee8a780f14659bf5f9 (patch) | |
tree | 509db89a9091f6bbdd5dd5bafb19ed3298ddb494 /drivers/net/ppp | |
parent | 285ec2fef4b87ba26400658b003ca9c76278d960 (diff) | |
download | linux-11b311a867b6b3208fdc3cee8a780f14659bf5f9.tar.gz |
ppp: add netns refcount tracker
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ppp')
-rw-r--r-- | drivers/net/ppp/ppp_generic.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index 1180a0e2445f..9e52c5d2d77f 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c @@ -173,6 +173,7 @@ struct channel { spinlock_t downl; /* protects `chan', file.xq dequeue */ struct ppp *ppp; /* ppp unit we're connected to */ struct net *chan_net; /* the net channel belongs to */ + netns_tracker ns_tracker; struct list_head clist; /* link in list of channels per unit */ rwlock_t upl; /* protects `ppp' and 'bridge' */ struct channel __rcu *bridge; /* "bridged" ppp channel */ @@ -2879,7 +2880,7 @@ int ppp_register_net_channel(struct net *net, struct ppp_channel *chan) pch->ppp = NULL; pch->chan = chan; - pch->chan_net = get_net(net); + pch->chan_net = get_net_track(net, &pch->ns_tracker, GFP_KERNEL); chan->ppp = pch; init_ppp_file(&pch->file, CHANNEL); pch->file.hdrlen = chan->hdrlen; @@ -3519,7 +3520,7 @@ ppp_disconnect_channel(struct channel *pch) */ static void ppp_destroy_channel(struct channel *pch) { - put_net(pch->chan_net); + put_net_track(pch->chan_net, &pch->ns_tracker); pch->chan_net = NULL; atomic_dec(&channel_count); |