From afe633e874b4cd8c8f723d5999d126ec7e1cdc1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= Date: Wed, 27 Jan 2021 12:33:08 +0100 Subject: [PATCH] fff-hoods: Allow correct ula_prefix syntax in hoodfiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In earlier firmware versions the prefix had to be written in an incorrect syntax (missing a trailing colon). To make hoodfiles with this old incorrect syntax work with newer firmware versions like this one, we have to fix the incorrect syntax. Both the old, incorrect and the correct syntax work with this fix, so in the far away future, the correct syntax can be used in hoodfiles. Signed-off-by: Fabian Bläse Reviewed-by: Adrian Schmutzler --- src/packages/fff/fff-hoods/Makefile | 2 +- .../fff/fff-hoods/files/usr/sbin/configurehood | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/packages/fff/fff-hoods/Makefile b/src/packages/fff/fff-hoods/Makefile index 37c4e68c..6bd460d3 100644 --- a/src/packages/fff/fff-hoods/Makefile +++ b/src/packages/fff/fff-hoods/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fff-hoods -PKG_RELEASE:=18 +PKG_RELEASE:=19 include $(INCLUDE_DIR)/package.mk diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood index e25db2ee..67c47f12 100755 --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood @@ -191,8 +191,15 @@ if [ -s "$hoodfiletmp" ]; then if [ -n "$prefix" ] ; then # remove escape character prefix=$(echo "$prefix" | sed -e 's,\\,,') - # create proper prefix - prefix=$(echo "$prefix" | sed -e 's,/,:/,') + + # In earlier firmware versions the prefix had to be written + # in an incorrect syntax (missing a trailing colon). + # To make hoodfiles with this old incorrect syntax work with + # newer firmware versions like this one, we have to fix the + # incorrect syntax here. Both the old, incorrect and + # the correct syntax work with this fix. + prefix="$(echo "$prefix" | sed -e 's,\([^:]\):/,\1::/,')" + mac=$(cat "/sys/class/net/br-client/address") addr=$(owipcalc "$prefix" add "::$(ipMacSuffix "$mac")") addr_eui=$(owipcalc "$prefix" add "::$(ipEUISuffix "$mac")")