mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
65 lines
2.4 KiB
Diff
65 lines
2.4 KiB
Diff
--- a/l2tp/l2tpv2/nss_connmgr_l2tpv2.h
|
|
+++ b/l2tp/l2tpv2/nss_connmgr_l2tpv2.h
|
|
@@ -30,10 +30,10 @@
|
|
|
|
#define L2TP_V_2 2
|
|
|
|
-#define tunnel_hold(tunnel) atomic_inc(&tunnel->ref_count)
|
|
-#define tunnel_put(tunnel) atomic_dec(&tunnel->ref_count)
|
|
-#define session_hold(session) atomic_inc(&session->ref_count)
|
|
-#define session_put(session) atomic_dec(&session->ref_count)
|
|
+#define tunnel_hold(tunnel) refcount_inc(&tunnel->ref_count)
|
|
+#define tunnel_put(tunnel) refcount_dec(&tunnel->ref_count)
|
|
+#define session_hold(session) refcount_inc(&session->ref_count)
|
|
+#define session_put(session) refcount_dec(&session->ref_count)
|
|
|
|
/*
|
|
* ----------------------------------------------------------------------------------
|
|
--- a/l2tp/l2tpv2/nss_connmgr_l2tpv2.c
|
|
+++ b/l2tp/l2tpv2/nss_connmgr_l2tpv2.c
|
|
@@ -244,7 +244,7 @@ static struct nss_connmgr_l2tpv2_session
|
|
*/
|
|
data->l2tpv2.session.session_id = session->session_id;
|
|
data->l2tpv2.session.peer_session_id = session->peer_session_id;
|
|
- data->l2tpv2.session.offset = session->offset;
|
|
+ data->l2tpv2.session.offset = 0;
|
|
data->l2tpv2.session.hdr_len = session->hdr_len;
|
|
data->l2tpv2.session.reorder_timeout = session->reorder_timeout;
|
|
data->l2tpv2.session.recv_seq = session->recv_seq;
|
|
@@ -253,7 +253,7 @@ static struct nss_connmgr_l2tpv2_session
|
|
nss_connmgr_l2tpv2_info("sess %u, peer=%u nr=%u ns=%u off=%u hdr_len=%u timeout=%x"
|
|
" recv_seq=%x send_seq=%x\n",
|
|
session->session_id, session->peer_session_id, session->nr,
|
|
- session->ns, session->offset, session->hdr_len,
|
|
+ session->ns, 0, session->hdr_len,
|
|
session->reorder_timeout, session->recv_seq,
|
|
session->send_seq);
|
|
|
|
--- a/l2tp/l2tpv2/nss_l2tpv2_stats.c
|
|
+++ b/l2tp/l2tpv2/nss_l2tpv2_stats.c
|
|
@@ -21,6 +21,7 @@
|
|
*/
|
|
|
|
#include <linux/types.h>
|
|
+#include <linux/netdevice.h>
|
|
#include <linux/ppp_channel.h>
|
|
#include <nss_api_if.h>
|
|
#include <nss_dynamic_interface.h>
|
|
@@ -103,14 +104,14 @@ void nss_l2tpv2_update_dev_stats(struct
|
|
/*
|
|
* Update tunnel & session stats
|
|
*/
|
|
- tunnel = l2tp_tunnel_find(dev_net(dev), data.l2tpv2.tunnel.tunnel_id);
|
|
+ tunnel = l2tp_tunnel_get(dev_net(dev), data.l2tpv2.tunnel.tunnel_id);
|
|
if (!tunnel) {
|
|
dev_put(dev);
|
|
return;
|
|
}
|
|
tunnel_hold(tunnel);
|
|
|
|
- session = l2tp_session_find(dev_net(dev), tunnel, data.l2tpv2.session.session_id);
|
|
+ session = l2tp_session_get(dev_net(dev), data.l2tpv2.session.session_id);
|
|
if (!session) {
|
|
tunnel_put(tunnel);
|
|
dev_put(dev);
|