[PATCH] fff-network: Evaluate ETH0MAC based on ROUTERMAC

Adrian Schmutzler mail at adrianschmutzler.de
Mo Nov 20 11:30:26 CET 2017


Tested-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>

> -----Original Message-----
> From: franken-dev [mailto:franken-dev-bounces at freifunk.net] On Behalf
> Of Adrian Schmutzler
> Sent: Dienstag, 14. November 2017 11:41
> To: franken-dev at freifunk.net
> Subject: [PATCH] fff-network: Evaluate ETH0MAC based on ROUTERMAC
> 
> All ONE_PORT devices except mr3020 use phy0 (w2mesh) for the
> ROUTERMAC. Thus, instead of evaluating w2ap's MAC address, we can just
> use the flipped ROUTERMAC for ETH0MAC.
> 
> This should also work for the mr3020, which uses eth0.
> 
> Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
> 
> ---
> 
> UNTESTED.
> 
> This is an alternative to the other ETH0MAC, without having to store
another
> MAC in the network.* files.
> ---
>  src/packages/fff/fff-network/files/usr/sbin/configurenetwork | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/packages/fff/fff-network/files/usr/sbin/configurenetwork
> b/src/packages/fff/fff-network/files/usr/sbin/configurenetwork
> index 89dd239..8df7655 100755
> --- a/src/packages/fff/fff-network/files/usr/sbin/configurenetwork
> +++ b/src/packages/fff/fff-network/files/usr/sbin/configurenetwork
> @@ -150,7 +150,7 @@ if [ "$ONE_PORT" = "YES" ] && ( ! uci -q get
> network.$SWITCHDEV.ifname || [ "$FO
>          uci set network.mesh.ifname="bat0"
>          uci set network.wan.ifname="eth1" #eth1 because it is default in
config
> file
>          uci set network.ethmesh.ifname="$SWITCHDEV"
> -        ETH0MAC="w2ap"
> +        ETH0MAC=1
>      fi
>      uci commit
>  fi
> @@ -196,7 +196,7 @@ fi
>  if [[ -n "$ETH0MAC" ]]; then
>          echo "Fixing MAC on eth0"
>          sleep 10
> -        NEW_MACADDR=$(cat "/sys/class/net/${ETH0MAC}/address")
> +        NEW_MACADDR=$(macFlipLocalBit "$ROUTERMAC")
>          uci set network.eth0.macaddr=$NEW_MACADDR
>          uci commit
>          ifconfig eth0 down
> --
> 2.7.4
> 
> --
> franken-dev mailing list
> franken-dev at freifunk.net
> http://lists.freifunk.net/mailman/listinfo/franken-dev-freifunk.net



Mehr Informationen über die Mailingliste franken-dev