Gentoo Archives: gentoo-commits

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/netifrc:master commit in: net/
Date: Fri, 27 Jan 2017 21:54:40
Message-Id: 1485267036.1e14262524d65918ed6d1d13f2abd87b2f11425b.robbat2@OpenRC
1 commit: 1e14262524d65918ed6d1d13f2abd87b2f11425b
2 Author: Sergey Popov <admin <AT> pinkbyte <DOT> ru>
3 AuthorDate: Tue Jan 24 14:10:36 2017 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 24 14:10:36 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=1e142625
7
8 Check for L2TP support in kernel
9
10 net/l2tp.sh | 4 ++++
11 1 file changed, 4 insertions(+)
12
13 diff --git a/net/l2tp.sh b/net/l2tp.sh
14 index 5efb535..dec1986 100644
15 --- a/net/l2tp.sh
16 +++ b/net/l2tp.sh
17 @@ -32,6 +32,10 @@ _l2tp_eval_props() {
18 }
19
20 _is_l2tp() {
21 + # Check for L2TP support in kernel
22 + ip l2tp show session &>/dev/null
23 + [ $? -ne 0 ] && return 1
24 +
25 eval "$(ip l2tp show session | \
26 awk "match(\$0, /^Session ([0-9]+) in tunnel ([0-9]+)\$/, ret) {sid=ret[1]; tid=ret[2]}
27 match(\$0, /^[ ]*interface name: ${IFACE}\$/) {print \"session_id=\"sid\";tunnel_id=\"tid; exit}")"