From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 436EA139085 for ; Fri, 27 Jan 2017 21:54:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 827A7234027; Fri, 27 Jan 2017 21:54:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5966C234027 for ; Fri, 27 Jan 2017 21:54:39 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2690A34166E for ; Fri, 27 Jan 2017 21:54:38 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 13FEF3215 for ; Fri, 27 Jan 2017 21:54:36 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1485267036.1e14262524d65918ed6d1d13f2abd87b2f11425b.robbat2@OpenRC> Subject: [gentoo-commits] proj/netifrc:master commit in: net/ X-VCS-Repository: proj/netifrc X-VCS-Files: net/l2tp.sh X-VCS-Directories: net/ X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: 1e14262524d65918ed6d1d13f2abd87b2f11425b X-VCS-Branch: master Date: Fri, 27 Jan 2017 21:54:36 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a54af80a-047b-4a12-b900-a9fbe59c899f X-Archives-Hash: 5cad3ea94e1b1f8b275d76b1af631bd9 commit: 1e14262524d65918ed6d1d13f2abd87b2f11425b Author: Sergey Popov pinkbyte ru> AuthorDate: Tue Jan 24 14:10:36 2017 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Tue Jan 24 14:10:36 2017 +0000 URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=1e142625 Check for L2TP support in kernel net/l2tp.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/l2tp.sh b/net/l2tp.sh index 5efb535..dec1986 100644 --- a/net/l2tp.sh +++ b/net/l2tp.sh @@ -32,6 +32,10 @@ _l2tp_eval_props() { } _is_l2tp() { + # Check for L2TP support in kernel + ip l2tp show session &>/dev/null + [ $? -ne 0 ] && return 1 + eval "$(ip l2tp show session | \ awk "match(\$0, /^Session ([0-9]+) in tunnel ([0-9]+)\$/, ret) {sid=ret[1]; tid=ret[2]} match(\$0, /^[ ]*interface name: ${IFACE}\$/) {print \"session_id=\"sid\";tunnel_id=\"tid; exit}")"