l2tp: remove switch block in l2tp_nl_cmd_session_create()
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 l2tp: remove switch block in l2tp_nl_cmd_session_create()
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)
--- net/l2tp/l2tp_netlink.c | 21 --------------------- 1 file changed, 21 deletions(-)
net/l2tp/l2tp_netlink.c +0 -21
@@ -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,
Signature · 1 line
2.13.6
Quoted 6 lines · Lorenzo Bianconi
Remove the switch block in
l2tp_nl_cmd_session_create()that checks pseudowire-specific parameters since justL2TP_PWTYPE_ETHandL2TP_PWTYPE_PPPare 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 gotoout_tunnel)
From: Lorenzo Bianconi <[email protected]>
Date: Wed, 17 Jan 2018 11:41:20 +0100
Quoted 7 lines
Remove the switch block in
l2tp_nl_cmd_session_create()that checks pseudowire-specific parameters since justL2TP_PWTYPE_ETHandL2TP_PWTYPE_PPPare 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 gotoout_tunnel)Signed-off-by Lorenzo Bianconi <[email protected]>
Applied, thanks.