Skip to content

Commit a62f3d2

Browse files
committed
0.10 use dhcp6.extendprefix instead of ip6prefix to assign IPv6 PD by missing233
1 parent 24b4243 commit a62f3d2

File tree

3 files changed

+4
-32
lines changed

3 files changed

+4
-32
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk
33
PKG_NAME:=luci-app-fleth
44
LUCI_TITLE:=LuCI Support for Flet'h
55
LUCI_DESCRIPTION:=luci-app-fleth is a helper that can configure IPv4 over IPv6 tunnel automatically in Japan.
6-
PKG_VERSION:=0.9
6+
PKG_VERSION:=0.10
77
PKG_RELEASE:=1
88

99
LUCI_PKGARCH:=all

root/etc/hotplug.d/iface/25-fleth-ip6prefix

Lines changed: 0 additions & 7 deletions
This file was deleted.

root/usr/sbin/fleth

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -297,30 +297,9 @@ elif [ "$1" = "hook_none.js" ]; then
297297
elif [ "$1" = "restore_none.js" ]; then
298298
printf "'use strict';'require network';return network.registerProtocol('none',{getI18n:function(){return _('Unmanaged');}});" > /www/luci-static/resources/protocol/none.js
299299
elif [ "$h_IP6PREFIX_ENABLED" -eq 1 ] && [ "$1" = "ip6prefix" ]; then
300-
TRIES=0
301-
MAX_TRIES=30
302-
current_prefix=$(uci get network.${h_UPLINK_INTERFACE}.ip6prefix) > /dev/null
303-
while [ $TRIES -lt $MAX_TRIES ]; do
304-
ipv6_address=$(ifstatus ${h_UPLINK_INTERFACE} | grep '"address"' | awk -F '"' '{print $4}' | grep -vE '^(fe80|fc00|fd00|fd50|::|::1|::ffff:0:0|::/96)' | head -n 1)
305-
if [ -n "$ipv6_address" ]; then
306-
pd_prefix=$(echo $ipv6_address | cut -d ':' -f 1-4)::/64
307-
if [ "$pd_prefix" != "$current_prefix" ]; then
308-
logger -t fleth "Got new PD with ${h_UPLINK_INTERFACE}=${pd_prefix}"
309-
uci set network.${h_UPLINK_INTERFACE}.ip6prefix=${pd_prefix}
310-
uci commit
311-
if [ "$h_ENABLED" -eq 1 ] && [ "$ACTION" = "ifup" ]; then
312-
sleep 10
313-
/usr/sbin/fleth auto
314-
fi
315-
fi
316-
break
317-
fi
318-
sleep 1
319-
TRIES=$((TRIES + 1))
320-
done
321-
if [ $TRIES -ge $MAX_TRIES ]; then
322-
logger -t fleth "Failed to obtain a valid IPv6 address after $MAX_TRIES attempts."
323-
fi
300+
uci set network.${h_UPLINK_INTERFACE}.extendprefix=1
301+
uci delete network.${h_UPLINK_INTERFACE}.ip6prefix
302+
uci commit network.${h_UPLINK_INTERFACE}
324303
else
325304
echo "Flet'h by huggy"
326305
echo "Flet'h is a helper that can configure your IPv4 over IPv6 tunnel automatically."

0 commit comments

Comments
 (0)