mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
ppp: add netns refcount tracker
Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
285ec2fef4
commit
11b311a867
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user