@@ -10,6 +10,7 @@
#include <net/dst.h>
#include <net/sock.h>
+#include <net/genetlink.h>
#ifdef CONFIG_XFRM
#include <net/xfrm.h>
@@ -196,7 +197,8 @@ struct l2tp_nl_cmd_ops {
*/
int (*session_create)(struct net *net, struct l2tp_tunnel *tunnel,
u32 session_id, u32 peer_session_id,
- struct l2tp_session_cfg *cfg);
+ struct l2tp_session_cfg *cfg,
+ struct genl_info *info);
/* The pseudowire session delete callback is responsible for initiating the deletion
* of a session instance.
@@ -243,7 +243,8 @@ static void l2tp_eth_adjust_mtu(struct l2tp_tunnel *tunnel,
static int l2tp_eth_create(struct net *net, struct l2tp_tunnel *tunnel,
u32 session_id, u32 peer_session_id,
- struct l2tp_session_cfg *cfg)
+ struct l2tp_session_cfg *cfg,
+ struct genl_info *info)
{
unsigned char name_assign_type;
struct net_device *dev;
@@ -629,7 +629,8 @@ static int l2tp_nl_cmd_session_create(struct sk_buff *skb, struct genl_info *inf
ret = l2tp_nl_cmd_ops[cfg.pw_type]->session_create(net, tunnel,
session_id,
peer_session_id,
- &cfg);
+ &cfg,
+ info);
if (ret >= 0) {
session = l2tp_tunnel_get_session(tunnel, session_id);
@@ -853,7 +853,8 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
/* Called when creating sessions via the netlink interface. */
static int pppol2tp_session_create(struct net *net, struct l2tp_tunnel *tunnel,
u32 session_id, u32 peer_session_id,
- struct l2tp_session_cfg *cfg)
+ struct l2tp_session_cfg *cfg,
+ struct genl_info *info)
{
int error;
struct l2tp_session *session;
To support creating different types of pseudowire, l2tp's netlink commands for session create and destroy are implemented using callbacks into pseudowire-specific code. The pseudowire types implemented so far (PPP and Ethernet) use common parameters which are extracted by l2tp_netlink into a session configuration structure. Different pseudowires may require different parameters: rather than adding these to the common configuration structure, make the netlink info visible to the pseudowire code so that it can perform its own validation of the extra attributes it requires. Signed-off-by: Tom Parkin <tparkin@katalix.com> --- net/l2tp/l2tp_core.h | 4 +++- net/l2tp/l2tp_eth.c | 3 ++- net/l2tp/l2tp_netlink.c | 3 ++- net/l2tp/l2tp_ppp.c | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-)