|
From: <abe...@us...> - 2017-06-07 13:34:32
|
Revision: 8379
http://sourceforge.net/p/astlinux/code/8379
Author: abelbeck
Date: 2017-06-07 13:34:30 +0000 (Wed, 07 Jun 2017)
Log Message:
-----------
arnofw, net-prefix-translation plugin, filter out ULA's and handle the edge condition when a GUA prefix is lost
Modified Paths:
--------------
branches/1.0/package/arnofw/net-prefix-translation/20net-prefix-translation.plugin.sh
Modified: branches/1.0/package/arnofw/net-prefix-translation/20net-prefix-translation.plugin.sh
===================================================================
--- branches/1.0/package/arnofw/net-prefix-translation/20net-prefix-translation.plugin.sh 2017-06-07 12:11:24 UTC (rev 8378)
+++ branches/1.0/package/arnofw/net-prefix-translation/20net-prefix-translation.plugin.sh 2017-06-07 13:34:30 UTC (rev 8379)
@@ -5,7 +5,7 @@
PLUGIN_VERSION="1.00"
PLUGIN_CONF_FILE="net-prefix-translation.conf"
#
-# Last changed : May 28, 2017
+# Last changed : June 7, 2017
# Requirements : AIF 2.0.1g+, ip6tables NETMAP support
# Comments : NPTv6 (Network Prefix Translation) for IPv6
# Perform a 1:1 mapping of ULA <-> GUA prefixes
@@ -40,7 +40,8 @@
IFS=' ,'
for lan in $NET_PREFIX_TRANSLATION_IF; do
ip -6 -o addr show dev $lan scope global 2>/dev/null \
- | awk '$3 == "inet6" { print $4; }'
+ | awk '$3 == "inet6" { print $4; }' \
+ | grep -i -v '^fd'
done
}
@@ -115,6 +116,8 @@
if [ -z "$global_prefix" ]; then
echo "${INDENT}Network Prefix Translation Global Prefix: Not Found"
+
+ : > "$NET_PREFIX_TRANSLATION_GLOBAL_IPV6"
return 1
fi
@@ -183,6 +186,16 @@
if [ -z "$global_prefix" ]; then
echo " Network Prefix Translation Global Prefix: Not Found"
+
+ if [ -n "$old_prefix" ]; then
+ if [ "$NET_PREFIX_TRANSLATION_UPDATE_ON_STATUS" != "0" ]; then
+ # update rules
+ ip6tables -t nat -F NET_PREFIX_TRANSLATION_IN
+ ip6tables -t nat -F NET_PREFIX_TRANSLATION_OUT
+
+ : > "$NET_PREFIX_TRANSLATION_GLOBAL_IPV6"
+ fi
+ fi
return 0
fi
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|