[From nobody Thu Jun 25 05:54:53 2020
Received: from mail-40136.protonmail.ch ([185.70.40.136])
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
 id 1gGfCN-0002MR-Sr
 for openwrt-devel@lists.openwrt.org; Sun, 28 Oct 2018 07:09:26 +0000
Date: Sun, 28 Oct 2018 07:09:05 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=default; t=1540710549;
 bh=m0dOE5H81RdegmaSw/floMlrrSpcW0B56atqgzd4Xas=;
 h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:
 Feedback-ID:From;
 b=sl+klQws3++dcDeXMriSkxhtcZ7SEmdWxFMZVpuP9Q04TRvN310vf1MrNrm+Ue/e0
 Y5peJ/Ho43Sh3tUjsnn8majSChSPhfpV2UByr9oTSVJZQK+evuR7WdTlgjR2PRTV+9
 loDOP+CGxBLibwZVF3YdHvjVBRDLu1D19qpWoAqs=
To: Weedy &lt;weedy2887@gmail.com&gt;
From: matt merhar &lt;mattmerhar@protonmail.com&gt;
Cc: OpenWrt Development List &lt;openwrt-devel@lists.openwrt.org&gt;
Reply-To: matt merhar &lt;mattmerhar@protonmail.com&gt;
Subject: Re: Mac address randomization on rsPro ath79
Message-ID: &lt;DEBx6UKe1u6oq63dyhpIAQZIEXi8cJgbXBX1XvJnoK11ycrA38mqGYXVUHPRmavbEZ5rZmcTC0jxS0IjxUBeZ6Qn6KykSLEBZAY-9Uv44_Q=@protonmail.com&gt;
In-Reply-To: &lt;CAFE24U3HhVFnvA8dkOZhPKpsGavBCkweuEw9xhrJVraZosPRKA@mail.gmail.com&gt;
References: &lt;CAFE24U2-juQXecBj65fGyR9SOO3Lg-WT9McZX9r9NQPXBMZxgg@mail.gmail.com&gt;
 &lt;FmVkxk1G93YImmk8qfK-W1pUFZN61FTLj8NAC35uswrfslLWJsRXFnPBUn98DyH1dLFLVPEVvTTE-TSAoq-7GEu-nqxeXZGoX-sbHorKcjw=@protonmail.com&gt;
 &lt;CAFE24U3HhVFnvA8dkOZhPKpsGavBCkweuEw9xhrJVraZosPRKA@mail.gmail.com&gt;
Feedback-ID: yivutcve8dMSbVfKv8JbBw-3E3JxNO_lPS2ieqGb5fpIov2Te2x1eJqyyZha-eUDPK3mepH6MMDGplNRqPZtZQ==:Ext:ProtonMail
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Status: No, score=-1.1 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED,
 DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM autolearn=ham autolearn_force=no
 version=3.4.0
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.protonmail.ch
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
X-CRM114-CacheID: sfid-20181028_000924_409927_FBF711CE 
X-CRM114-Status: GOOD (  17.81  )
X-Spam-Score: -0.8 (/)
X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary:
 Content analysis details:   (-0.8 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at http://www.dnswl.org/, low
 trust [185.70.40.136 listed in list.dnswl.org]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
 (mattmerhar[at]protonmail.com)
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature,
 not necessarily valid
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
 domain

=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me=
ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90
On Sunday, October 28, 2018 12:40 AM, Weedy &lt;weedy2887@gmail.com&gt; wrote:

&gt; On Sat, 27 Oct 2018 at 22:46, matt merhar mattmerhar@protonmail.com wrote=
:
&gt;
&gt; &gt; Hi,
&gt;
&gt; Hello, I replied to you on IRC but like 2 days later :V
&gt;

Yeah, I figured it would be better to get the reply on the ML anyhow, as it=
 might help others.

&gt; &gt; Due to the switch to using devicetree in ath79, it became necessary to
&gt; &gt; populate the MAC addresses via userland during first boot. This is done
&gt; &gt; using target/linux/ath79/base-files/etc/board.d/02_network,
&gt; &gt; specifically:
&gt; &gt;
&gt; &gt;         ubnt,routerstation|\\
&gt; &gt;         ubnt,routerstation-pro)
&gt; &gt;                 wan_mac=3D$(fconfig -s -r -d $(find_mtd_part &quot;RedBoot c=
onfig&quot;) -n ar7100_esa)
&gt; &gt;                 lan_mac=3D$(macaddr_add &quot;$wan_mac&quot; 1)
&gt; &gt;
&gt; &gt;
&gt; &gt; This said, I can think of a few potential reasons for your
&gt; &gt; /etc/config/network to lack the 'macaddr' option for lan/wan interfaces=
:
&gt; &gt; 1.) Rather than modify the UCI network config generated at first boot,
&gt; &gt; the config was instead overwritten with those from an ar71xx install
&gt; &gt; (uploading via scp, .tar.gz via LuCI, cat &gt;, etc.)
&gt;
&gt; I use $topdir/flies/

This is probably causing the issue. If you're building a pre-made
$topdir/files/etc/config/network into the image, I don't believe it will
overwrite that existing /etc/config/network file on first boot. If you
want to continue doing things this way then you'll need to add the
'macaddr' options to your $topdir config, or alternatively try using the
patch I provided. I suppose you could also add something like an init
script to update the config file (e.g. with &quot;uci set&quot;) on boot instead.

If you check /etc/board.json it should still contain the autogenerated
config similar to:

...
=09&quot;network&quot;: {
=09=09&quot;wan&quot;: {
=09=09=09&quot;ifname&quot;: &quot;eth0&quot;,
=09=09=09&quot;protocol&quot;: &quot;dhcp&quot;,
=09=09=09&quot;macaddr&quot;: &quot;00:15:6d:aa:bb:cc&quot;
=09=09},
=09=09&quot;lan&quot;: {
=09=09=09&quot;ifname&quot;: &quot;eth1.1&quot;,
=09=09=09&quot;protocol&quot;: &quot;static&quot;,
=09=09=09&quot;macaddr&quot;: &quot;00:15:6d:aa:bb:cd&quot;
=09=09}
=09},
...

...as long as you're not pre-populating that file in $topdir/files as
well. If the MACs there are correct then things are working as intended.

&gt;
&gt; &gt; 2.) Using sysupgrade -F and preserving the old config while migrating
&gt; &gt; from ar71xx -&gt; ath79
&gt; &gt; 2.) Building your own image and deselecting the 'fconfig' utility which
&gt; &gt; is necessary to read the base MAC address from the RedBoot config
&gt; &gt; partition
&gt;
&gt; Now this is interesting because I use defconfig. I don't mind adding
&gt; fconfig to my scripts, but then why isn't defconfig picking that up?
&gt;
&gt; buildImage () {
&gt; make V=3D99 defconfig &amp;&amp; \
&gt; nice -n 7 make V=3D1 -j4 || exit 1
&gt; }
&gt; cat configs/rsPRO-home-repeater.config &gt; .config
&gt;
&gt;     buildImage
&gt;     scp bin/targets/ath79/generic/openwrt-ath79-generic-ubnt_routerstatio=
n-pro-squashfs-sysupgrade.bin
&gt;
&gt;
&gt; root@repeater.lan:/tmp/
&gt;
&gt; $ cat configs/rsPRO-home-repeater.config
&gt; CONFIG_TARGET_ath79=3Dy
&gt; CONFIG_TARGET_ath79_generic=3Dy
&gt; CONFIG_TARGET_ath79_generic_DEVICE_ubnt_routerstation-pro=3Dy
&gt; CONFIG_PACKAGE_wpad=3Dy
&gt; CONFIG_PACKAGE_wpad-mini=3Dn
&gt; CONFIG_ATH_USER_REGD=3Dy
&gt; CONFIG_PACKAGE_ATH_DFS=3Dy
&gt; CONFIG_PACKAGE_ATH_DYNACK=3Dy
&gt; CONFIG_PACKAGE_kmod-ath9k=3Dy
&gt; CONFIG_ATH9K_SUPPORT_PCOEM=3Dy
&gt; CONFIG_ATH9K_UBNTHSR=3Dn

I tested this (to the point of running &quot;make defconfig&quot; anyways) and the
following *are* properly selected in .config using the contents of your
configs/rsPRO-home-repeater.config:

CONFIG_DEFAULT_fconfig=3Dy
CONFIG_PACKAGE_fconfig=3Dy

It lives at /usr/sbin/fconfig on the router.




]