[PATCH v3 04/12] l2tp: Add ppp device name to L2TP ppp session data

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: James Chapman
Date: Tuesday, March 30, 2010 - 9:17 am

When dumping L2TP PPP sessions using /proc/net/l2tp, get
the assigned PPP device name from PPP using ppp_dev_name().

Signed-off-by: James Chapman <jchapman@katalix.com>
Reviewed-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 net/l2tp/l2tp_ppp.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
index 03195ab..8f78c27 100644
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -608,6 +608,20 @@ out:
 	return error;
 }
 
+#ifdef CONFIG_PROC_FS
+static void pppol2tp_show(struct seq_file *m, void *arg)
+{
+	struct l2tp_session *session = arg;
+	struct pppol2tp_session *ps = l2tp_session_priv(session);
+
+	if (ps) {
+		struct pppox_sock *po = pppox_sk(ps->sock);
+		if (po)
+			seq_printf(m, "   interface %s\n", ppp_dev_name(&po->chan));
+	}
+}
+#endif
+
 /* connect() handler. Attach a PPPoX socket to a tunnel UDP socket
  */
 static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
@@ -697,6 +711,9 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
 
 	session->recv_skb	= pppol2tp_recv;
 	session->session_close	= pppol2tp_session_close;
+#ifdef CONFIG_PROC_FS
+	session->show		= pppol2tp_show;
+#endif
 
 	/* We need to know each time a skb is dropped from the reorder
 	 * queue.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v3 00/12] l2tp: Introduce L2TPv3 support, James Chapman, (Tue Mar 30, 9:17 am)
[PATCH v3 04/12] l2tp: Add ppp device name to L2TP ppp ses ..., James Chapman, (Tue Mar 30, 9:17 am)
[PATCH v3 05/12] l2tp: Add L2TPv3 protocol support, James Chapman, (Tue Mar 30, 9:17 am)
[PATCH v3 09/12] l2tp: Add netlink control API for L2TP, James Chapman, (Tue Mar 30, 9:18 am)
[PATCH v3 12/12] l2tp: Update documentation, James Chapman, (Tue Mar 30, 9:18 am)
Re: [PATCH v3 04/12] l2tp: Add ppp device name to L2TP ppp ..., Stephen Hemminger, (Tue Mar 30, 9:29 am)
Re: [PATCH v3 10/12] l2tp: Add L2TP ethernet pseudowire su ..., Stephen Hemminger, (Tue Mar 30, 9:30 am)
Re: [PATCH v3 10/12] l2tp: Add L2TP ethernet pseudowire su ..., Stephen Hemminger, (Tue Mar 30, 9:30 am)
Re: [PATCH v3 10/12] l2tp: Add L2TP ethernet pseudowire su ..., Stephen Hemminger, (Tue Mar 30, 9:32 am)
Re: [PATCH v3 09/12] l2tp: Add netlink control API for L2TP, Patrick McHardy, (Wed Mar 31, 1:59 am)
Re: [PATCH v3 10/12] l2tp: Add L2TP ethernet pseudowire su ..., Paul E. McKenney, (Wed Mar 31, 10:38 am)
Re: [PATCH v3 04/12] l2tp: Add ppp device name to L2TP ppp ..., Stephen Hemminger, (Wed Mar 31, 4:08 pm)