Page 2 of 2

Re: Custom MAC adress GUI Bug?

Posted: Tue Dec 03, 2019 4:35 pm
by CBx86
RomanHK wrote:
CBx86 wrote:The wan mac address change every boot, if leave as default. (That's why I went to look whats going on)

This is very strange :shock: - it seems to me a bug in the u-boot environment (probably the MAC address is missing and u-boot generates a new MAC). This should not work like this.

Yes, by default the MAC address is not given anywhere (LAN or WAN), it should be read from the hardware - MAC address = Physical address.


This all is default:

config device 'lan_dev'
option name 'eth0.1'
option macaddr '<removed>'

Re: Custom MAC adress GUI Bug?

Posted: Tue Dec 03, 2019 4:52 pm
by RomanHK
CBx86 wrote:This all is default:

Hmmm, if by default these options are "config device 'lan_dev'" and config device 'wan_dev', then I won't help you - I've never met this before :( .

Re: Custom MAC adress GUI Bug?

Posted: Tue Dec 03, 2019 6:34 pm
by Lantis
There's lots of tangents going on here, lets just stick to the problem, which has been identified and I can now look at a fix.

Issue 1:
Your device not having the

Code: Select all

option macaddr 'xxxxxxx'

section under wan_dev on firstboot. This is a problem which shouldn't be happening according to the OpenWrt code i've read in relation to your device. It should be populated at the same time as it creates the wan_dev section. This is why you're getting random MAC every time you boot.
So something is wrong at your device level or in the OpenWrt code, but this isn't something i can/will fix.

Issue 2:
When i wrote the code in March to handle this scenario, i made an assumption (based on the same code) that the macaddr option would ALWAYS be populated. As it turns out, maybe that isn't such a safe assumption.
https://github.com/ericpaulbishop/gargo ... c.js#L1563
A change needs to occur in that line. I'm not in front of a computer so i can't test, but it probably needs to change to:

Code: Select all

wanMacLoc = uciOriginal.get("network","wan_dev") != "" ? "wan_dev" : wanMacLoc;

BUT i can't test this right now.


So, I'm not touching Issue 1 (that's yours/OpenWrt's problem). I'll test and fix Issue 2, although I do feel like I'm covering a boundary case type condition rather than fixing a real bug per se.

Re: Custom MAC adress GUI Bug?

Posted: Tue Dec 03, 2019 8:45 pm
by CBx86
basic as you ask, Lantis:
https://pastebin.com/B4REtPyg

If i set the macaddr, all works fine. (months)

Im already watching this bug/error for some months. And yesterday, made the 'firstboot' to test without my configs.

I will keep on touch next upgrade. :D

Re: Custom MAC adress GUI Bug?

Posted: Wed Dec 04, 2019 4:53 am
by RomanHK
CBx86 wrote:basic as you ask, Lantis:
https://pastebin.com/B4REtPyg
@Lantis did not mean basic.sh but basic.js ;) . You can find it here:

Code: Select all

/www/js/basic.js

Re: Custom MAC adress GUI Bug?

Posted: Wed Dec 04, 2019 1:42 pm
by CBx86

Re: Custom MAC adress GUI Bug?

Posted: Sun Dec 08, 2019 4:20 am
by Lantis
My assumption from before was correct, you can fix this bug with a single line change.
FROM:

Code: Select all

wanMacLoc = uciOriginal.get("network","wan_dev","macaddr") != "" ? "wan_dev" : wanMacLoc;

TO:

Code: Select all

wanMacLoc = uciOriginal.get("network","wan_dev") != "" ? "wan_dev" : wanMacLoc;


I've updated this in the 1.12 branch code and the 1.13 development branch.

Re: Custom MAC adress GUI Bug?

Posted: Mon Dec 09, 2019 7:48 pm
by CBx86
Nicee!!

When available I will apply and give the feedback.

Many Thanks! :D