[Devel] [PATCH rh7] l2tp: Drop VE_FEATURE_PPP feature test

Cyrill Gorcunov gorcunov at odin.com
Wed Dec 2 02:11:50 PST 2015


Actually if we're to support l2tp control via VE_FEATURE_PPP
we need more than plain bit test but the whole logic converted
from pcs6 code (which implies tunnel list and such).

As far as I know we don't have the plans at moment to control
l2tp this way so lets rip this code out otherwise there is
a net leak (because net_generic with @pppol2tp_net_id
always return nil and proc entry never released).

Signed-off-by: Cyrill Gorcunov <gorcunov at virtuozzo.com>
CC: Vladimir Davydov <vdavydov at virtuozzo.com>
CC: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 net/l2tp/l2tp_ppp.c |    9 ---------
 1 file changed, 9 deletions(-)

Index: linux-pcs7.git/net/l2tp/l2tp_ppp.c
===================================================================
--- linux-pcs7.git.orig/net/l2tp/l2tp_ppp.c
+++ linux-pcs7.git/net/l2tp/l2tp_ppp.c
@@ -1751,9 +1751,6 @@ static __net_init int pppol2tp_init_net(
 	struct proc_dir_entry *pde;
 	int err = 0;
 
-	if (!(net->owner_ve->features & VE_FEATURE_PPP))
-		return net_assign_generic(net, pppol2tp_net_id, NULL);
-
 	pde = proc_create("pppol2tp", S_IRUGO, net->proc_net,
 			  &pppol2tp_proc_fops);
 	if (!pde) {
@@ -1767,12 +1764,6 @@ out:
 
 static __net_exit void pppol2tp_exit_net(struct net *net)
 {
-	struct pppoe_net *pn;
-
-	pn = net_generic(net, pppol2tp_net_id);
-	if (!pn) /* no VE_FEATURE_PPP */
-		return;
-
 	remove_proc_entry("pppol2tp", net->proc_net);
 }
 


More information about the Devel mailing list