]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/l2tp/l2tp_eth.c
l2tp: pass tunnel pointer to ->session_create()
[mirror_ubuntu-bionic-kernel.git] / net / l2tp / l2tp_eth.c
index 4de2ec94b08cbf5aba016da754b799c46d5f378a..87da9ef61860886d9bf5cc668524ef8b48a60c31 100644 (file)
@@ -262,24 +262,19 @@ static void l2tp_eth_adjust_mtu(struct l2tp_tunnel *tunnel,
        dev->needed_headroom += session->hdr_len;
 }
 
-static int l2tp_eth_create(struct net *net, u32 tunnel_id, u32 session_id, u32 peer_session_id, struct l2tp_session_cfg *cfg)
+static int l2tp_eth_create(struct net *net, struct l2tp_tunnel *tunnel,
+                          u32 session_id, u32 peer_session_id,
+                          struct l2tp_session_cfg *cfg)
 {
        unsigned char name_assign_type;
        struct net_device *dev;
        char name[IFNAMSIZ];
-       struct l2tp_tunnel *tunnel;
        struct l2tp_session *session;
        struct l2tp_eth *priv;
        struct l2tp_eth_sess *spriv;
        int rc;
        struct l2tp_eth_net *pn;
 
-       tunnel = l2tp_tunnel_find(net, tunnel_id);
-       if (!tunnel) {
-               rc = -ENODEV;
-               goto out;
-       }
-
        if (cfg->ifname) {
                strlcpy(name, cfg->ifname, IFNAMSIZ);
                name_assign_type = NET_NAME_USER;