Custom MAC adress GUI Bug?

Discuss the technical details of Gargoyle and ongoing development

Moderator: Moderators

User avatar
CBx86
Posts: 157
Joined: Sun Jan 05, 2014 5:43 pm
Location: Brazil

Re: Custom MAC adress GUI Bug?

Post 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>'

RomanHK
Posts: 794
Joined: Sat May 04, 2013 4:18 pm
Location: Czech Republik

Re: Custom MAC adress GUI Bug?

Post 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 :( .
Turris Omnia with OpenWrt 21.02 - Tested
Linksys WRT3200ACM with Gargoyle 1.13.x
TL-WR1043ND v2 with Gargoyle 1.10.0

http://gargoyle.romanhk.cz custom builds by gargoyle users

Lantis
Moderator
Posts: 6735
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Custom MAC adress GUI Bug?

Post 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.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

User avatar
CBx86
Posts: 157
Joined: Sun Jan 05, 2014 5:43 pm
Location: Brazil

Re: Custom MAC adress GUI Bug?

Post 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

RomanHK
Posts: 794
Joined: Sat May 04, 2013 4:18 pm
Location: Czech Republik

Re: Custom MAC adress GUI Bug?

Post 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
Turris Omnia with OpenWrt 21.02 - Tested
Linksys WRT3200ACM with Gargoyle 1.13.x
TL-WR1043ND v2 with Gargoyle 1.10.0

http://gargoyle.romanhk.cz custom builds by gargoyle users

User avatar
CBx86
Posts: 157
Joined: Sun Jan 05, 2014 5:43 pm
Location: Brazil

Re: Custom MAC adress GUI Bug?

Post by CBx86 »


Lantis
Moderator
Posts: 6735
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Custom MAC adress GUI Bug?

Post 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.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

User avatar
CBx86
Posts: 157
Joined: Sun Jan 05, 2014 5:43 pm
Location: Brazil

Re: Custom MAC adress GUI Bug?

Post by CBx86 »

Nicee!!

When available I will apply and give the feedback.

Many Thanks! :D

Post Reply