[PATCH 2/2] fff-network: Replace ETH0MAC by replacement based on ROUTERMAC

Tim Niemeyer tim at tn-x.org
So Dez 31 16:07:17 CET 2017


Hi Adrian

Am Freitag, den 22.12.2017, 18:03 +0100 schrieb Adrian Schmutzler:
> 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>
> 
> ---
> 
> This replaces the patches
> - fff-network: Evaluate ETH0MAC based on ROUTERMAC
> - fff-network: Move ETH0MAC to network.*
> 
> In contrast to the former, we now use the newly introduced
> function and can start the MAC replacement immediately (without
> the ETH0MAC being set).
> ---
>  .../fff/fff-network/files/usr/sbin/configurenetwork        | 14 +---
> ----------
>  1 file changed, 1 insertion(+), 13 deletions(-)
> 
> diff --git a/src/packages/fff/fff-
> network/files/usr/sbin/configurenetwork b/src/packages/fff/fff-
> network/files/usr/sbin/configurenetwork
> index 7f34d6f..272da13 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"
> +        fixMac "$(macFlipLocalBit "$ROUTERMAC")" "eth0" "eth0" "1"
Wenn ich das richtig verstanden habe ist da ein kleiner Fehler drin. Es
soll beim interface (also das UCI Ding) nicht eth0 sondern ethmesh
sein.

Hier brauch man entsprechend meiner Anmerkung aus 1/2 nur noch:
----
if [ -z "$ETHMESHMAC" ]; then
    ETHMESHMAC="$(macFlipLocalBit "$ROUTERMAC")"
fi
----
machen.

>      fi
>      uci commit network
>  fi
> @@ -165,18 +165,6 @@ if [ -n "$ROUTERMAC" ]; then
>      fixMac "$ROUTERMAC" "br-mesh" "mesh"
>  fi
>  
> -if [[ -n "$ETH0MAC" ]]; then
> -        echo "Fixing MAC on eth0"
> -        sleep 10
> -        NEW_MACADDR=$(cat "/sys/class/net/${ETH0MAC}/address")
> -        uci set network.eth0.macaddr=$NEW_MACADDR
Ich weiß, hier hast du das her, aber ich glaube das ist auch falsch,
denn zuvor wurde ja extra das network.ethmesh.ifname gesetzt.

> -        uci commit network
> -        ifconfig eth0 down
> -        ifconfig eth0 hw ether $NEW_MACADDR
> -        ifconfig eth0 up
> -        /etc/init.d/network restart
> -fi
> -
>  if uci get network.mesh.ip6addr
>  then
>      echo "IPv6 for mesh is set already"
> -- 
> 2.7.4
> 
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname   : signature.asc
Dateityp    : application/pgp-signature
Dateigröße  : 488 bytes
Beschreibung: This is a digitally signed message part
URL         : <http://lists.freifunk.net/pipermail/franken-dev-freifunk.net/attachments/20171231/4b60d0a0/attachment.sig>


Mehr Informationen über die Mailingliste franken-dev