netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] l2tp: remove switch block in l2tp_nl_cmd_session_create()
       [not found] <cover.1516185135.git.lorenzo.bianconi@redhat.com>
@ 2018-01-17 10:41 ` Lorenzo Bianconi
  2018-01-17 11:32   ` Guillaume Nault
  2018-01-19 20:10   ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Lorenzo Bianconi @ 2018-01-17 10:41 UTC (permalink / raw)
  To: davem; +Cc: netdev, jchapman, g.nault

Remove the switch block in l2tp_nl_cmd_session_create() that
checks pseudowire-specific parameters since just L2TP_PWTYPE_ETH and
L2TP_PWTYPE_PPP are currently supported and no actual checks are
performed. Moreover the L2TP_PWTYPE_IP/default case presents a harmless
issue in error handling (break instead of goto out_tunnel)

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
---
 net/l2tp/l2tp_netlink.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
index 405a5341ed1e..e7ea9c4b89ff 100644
--- a/net/l2tp/l2tp_netlink.c
+++ b/net/l2tp/l2tp_netlink.c
@@ -620,27 +620,6 @@ static int l2tp_nl_cmd_session_create(struct sk_buff *skb, struct genl_info *inf
 		goto out_tunnel;
 	}
 
-	/* Check that pseudowire-specific params are present */
-	switch (cfg.pw_type) {
-	case L2TP_PWTYPE_NONE:
-		break;
-	case L2TP_PWTYPE_ETH_VLAN:
-		if (!info->attrs[L2TP_ATTR_VLAN_ID]) {
-			ret = -EINVAL;
-			goto out_tunnel;
-		}
-		break;
-	case L2TP_PWTYPE_ETH:
-		break;
-	case L2TP_PWTYPE_PPP:
-	case L2TP_PWTYPE_PPP_AC:
-		break;
-	case L2TP_PWTYPE_IP:
-	default:
-		ret = -EPROTONOSUPPORT;
-		break;
-	}
-
 	ret = l2tp_nl_cmd_ops[cfg.pw_type]->session_create(net, tunnel,
 							   session_id,
 							   peer_session_id,
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] l2tp: remove switch block in l2tp_nl_cmd_session_create()
  2018-01-17 10:41 ` [PATCH net-next] l2tp: remove switch block in l2tp_nl_cmd_session_create() Lorenzo Bianconi
@ 2018-01-17 11:32   ` Guillaume Nault
  2018-01-19 20:10   ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Guillaume Nault @ 2018-01-17 11:32 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: davem, netdev, jchapman

On Wed, Jan 17, 2018 at 11:41:20AM +0100, Lorenzo Bianconi wrote:
> Remove the switch block in l2tp_nl_cmd_session_create() that
> checks pseudowire-specific parameters since just L2TP_PWTYPE_ETH and
> L2TP_PWTYPE_PPP are currently supported and no actual checks are
> performed. Moreover the L2TP_PWTYPE_IP/default case presents a harmless
> issue in error handling (break instead of goto out_tunnel)
> 

Acked-by: Guillaume Nault <g.nault@alphalink.fr>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] l2tp: remove switch block in l2tp_nl_cmd_session_create()
  2018-01-17 10:41 ` [PATCH net-next] l2tp: remove switch block in l2tp_nl_cmd_session_create() Lorenzo Bianconi
  2018-01-17 11:32   ` Guillaume Nault
@ 2018-01-19 20:10   ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-01-19 20:10 UTC (permalink / raw)
  To: lorenzo.bianconi; +Cc: netdev, jchapman, g.nault

From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Date: Wed, 17 Jan 2018 11:41:20 +0100

> Remove the switch block in l2tp_nl_cmd_session_create() that
> checks pseudowire-specific parameters since just L2TP_PWTYPE_ETH and
> L2TP_PWTYPE_PPP are currently supported and no actual checks are
> performed. Moreover the L2TP_PWTYPE_IP/default case presents a harmless
> issue in error handling (break instead of goto out_tunnel)
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-19 20:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <cover.1516185135.git.lorenzo.bianconi@redhat.com>
2018-01-17 10:41 ` [PATCH net-next] l2tp: remove switch block in l2tp_nl_cmd_session_create() Lorenzo Bianconi
2018-01-17 11:32   ` Guillaume Nault
2018-01-19 20:10   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).