commit:     e7a218ea4f3d85df05a8b2ca6c0fe71c0d15e44d
Author:     Mr-TI <emericv <AT> gmail <DOT> com>
AuthorDate: Sun May  1 09:36:55 2016 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun May  1 09:36:55 2016 +0000
URL:        https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=e7a218ea

Revert "Add L2TPv3 tunnel/session support to iproute2 module"
Moving the L2TP part to an separate file

This reverts commit 4a8358aaf9c0048930194e0bbe3d2509d9da4fd0.

 net/iproute2.sh | 45 ---------------------------------------------
 1 file changed, 45 deletions(-)

diff --git a/net/iproute2.sh b/net/iproute2.sh
index 825b9b1..0b2a8d6 100644
--- a/net/iproute2.sh
+++ b/net/iproute2.sh
@@ -318,32 +318,6 @@ iproute2_pre_start()
                eend $? || return 1
                _up
        fi
-       
-       # L2TPv3
-       local l2tpsession=
-       eval l2tpsession=\$l2tpsession_${IFVAR}
-       if [ -n "${l2tpsession}" ]; then
-               ebegin "Creating L2TPv3 tunnel ${IFVAR}"
-               local l2tptunnel=
-               eval l2tptunnel=\$l2tptunnel_${IFVAR}
-               if [ -n "${l2tptunnel}" ]; then
-                       local retcode
-                       veinfo ip l2tp add tunnel ${l2tptunnel}
-                       ip l2tp add tunnel ${l2tptunnel}
-                       #a L2TPv3 tunnel can host several sessions (1 session 
<=> 1 interface)
-                       #if $?=2 the tunnel id already exists, just ignore this 
error
-                       #we assume that the existing one have the same property 
that we want to create...
-                       if [ $? -ne 0 ] && [ $? -ne 2 ]; then
-                               eend $? || return 1
-                       fi
-               fi
-               veinfo ip l2tp add session ${l2tpsession} name "${IFACE}"
-               ip l2tp add session ${l2tpsession} name "${IFACE}"
-               if [ $? -ne 0 ] && [ $? -ne 2 ]; then
-                       eend $? || return 1
-               fi
-               _up
-       fi
 
        # MTU support
        local mtu=
@@ -450,25 +424,6 @@ iproute2_post_stop()
                        ip tunnel del "${IFACE}"
                        eend $?
                fi
-               local l2tptuple
-               # Searching for l2tp session associated to ${IFACE}
-               l2tptuple="$(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 sid\":\"tid; exit}")"
-               if [ -n "$l2tptuple" ]; then
-                       local l2tpsession_id l2tptunnel_id
-                       l2tpsession_id=${l2tptuple%:*}
-                       l2tptunnel_id=${l2tptuple#*:}
-                       ebegin "Destroying L2TPv3 tunnel ${IFACE}"
-                       veinfo ip l2tp del session tunnel_id $l2tptunnel_id 
session_id $l2tpsession_id
-                       ip l2tp del session tunnel_id $l2tptunnel_id session_id 
$l2tpsession_id
-                       if [ -z "$(ip l2tp show session | grep -E "^Session 
[0-9]+ in tunnel $l2tptunnel_id\$")" ]; then
-                               #tunnel $l2tptunnel_id no longer used, 
destoying it...
-                               veinfo ip l2tp del tunnel tunnel_id 
$l2tptunnel_id
-                               ip l2tp del tunnel tunnel_id $l2tptunnel_id
-                       fi
-                       eend $?
-               fi
        fi
 }
 

Reply via email to