Files
openwrt-R7800-nss/target/linux/ipq806x/patches-6.6/990-0340-ppp-Add-PPP-channel-specific-methods-for-PPTP-and-L2.patch
SqTER-PL ddf1e90667 Updated PPPoE,PPTP,L2TP and GRE patches.
Source: codelinaro.org
2025-08-04 18:52:30 +02:00

105 lines
2.8 KiB
Diff

From 7d3846d95a5b5fa800031411d53078f2d775d2e6 Mon Sep 17 00:00:00 2001
From: Murat Sezgin <msezgin@codeaurora.org>
Date: Fri, 16 Jan 2015 16:54:08 -0800
Subject: [PATCH 301/500] ppp: Add PPP channel specific methods for PPTP and
L2TP types.
These methods are required for handling these types of PPP protocols
in the acceleration subsystem.
Change-Id: I7967573ee440a96af3f842300e2f021465a0a62c
Signed-off-by: Murat Sezgin <msezgin@codeaurora.org>
---
drivers/net/ppp/pptp.c | 27 +++++++++++++++++++++++++++
net/l2tp/l2tp_ppp.c | 30 ++++++++++++++++++++++++++++++
2 files changed, 57 insertions(+)
--- a/drivers/net/ppp/pptp.c
+++ b/drivers/net/ppp/pptp.c
@@ -603,9 +603,36 @@ static int pptp_ppp_ioctl(struct ppp_cha
return err;
}
+/* pptp_hold_chan() */
+static void pptp_hold_chan(struct ppp_channel *chan)
+{
+ struct sock *sk = (struct sock *)chan->private;
+
+ sock_hold(sk);
+}
+
+/* pptp_release_chan() */
+static void pptp_release_chan(struct ppp_channel *chan)
+{
+ struct sock *sk = (struct sock *)chan->private;
+
+ sock_put(sk);
+}
+
+/* pptp_get_channel_protocol()
+ * Return the protocol type of the PPTP over PPP protocol
+ */
+static int pptp_get_channel_protocol(struct ppp_channel *chan)
+{
+ return PX_PROTO_PPTP;
+}
+
static const struct ppp_channel_ops pptp_chan_ops = {
.start_xmit = pptp_xmit,
.ioctl = pptp_ppp_ioctl,
+ .get_channel_protocol = pptp_get_channel_protocol,
+ .hold = pptp_hold_chan,
+ .release = pptp_release_chan,
};
static struct proto pptp_sk_proto __read_mostly = {
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -123,9 +123,15 @@ struct pppol2tp_session {
};
static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb);
+static int pppol2tp_get_channel_protocol(struct ppp_channel *);
+static void pppol2tp_hold_chan(struct ppp_channel *);
+static void pppol2tp_release_chan(struct ppp_channel *);
static const struct ppp_channel_ops pppol2tp_chan_ops = {
.start_xmit = pppol2tp_xmit,
+ .get_channel_protocol = pppol2tp_get_channel_protocol,
+ .hold = pppol2tp_hold_chan,
+ .release = pppol2tp_release_chan,
};
static const struct proto_ops pppol2tp_ops;
@@ -328,6 +334,30 @@ error:
return error;
}
+/* pppol2tp_hold_chan() */
+static void pppol2tp_hold_chan(struct ppp_channel *chan)
+{
+ struct sock *sk = (struct sock *)chan->private;
+
+ sock_hold(sk);
+}
+
+/* pppol2tp_release_chan() */
+static void pppol2tp_release_chan(struct ppp_channel *chan)
+{
+ struct sock *sk = (struct sock *)chan->private;
+
+ sock_put(sk);
+}
+
+/* pppol2tp_get_channel_protocol()
+ * Return the protocol type of the L2TP over PPP protocol
+ */
+static int pppol2tp_get_channel_protocol(struct ppp_channel *chan)
+{
+ return PX_PROTO_OL2TP;
+}
+
/* Transmit function called by generic PPP driver. Sends PPP frame
* over PPPoL2TP socket.
*