ramips: Further improvements and fixes of MAC address setup#2319
ramips: Further improvements and fixes of MAC address setup#2319adschm wants to merge 1 commit intoopenwrt:masterfrom
Conversation
|
Despite what's addressed in the patches, I left some devices untouched which show strange setup: Three addresses are used (strange thing no. 1: why are lan AND wan different from ðernet). Multiple examples can be found for both cases. |
fd80236 to
b20acb3
Compare
|
Rebased. |
|
@dangowrt Can you check that? If yes, I would also be interested in which of the two addresses should be "lan" and which "wan" then ... |
|
unfortunately I'm not around that piece of hardware any longer :(
|
|
@pepe2k Can you check that? If yes, I would also be interested in which of the two addresses should be "lan" and which "wan" then ... |
|
@pepe2k Same question for u7628-01-xxx devices. |
|
For later reference: Discussion about newifi devices can be found here: #2075 (comment) |
|
Rebased. |
|
@981213 @blocktrron (Latest Update: Rebase and account for recently added devices) |
|
@zorun As you happen to own a ZBT WE3526, can you check whether you have a MAC address in <&factory 0xe006> and whether it matches your wan (eth0.2) MAC address? If you could provide a hexdump of your factory partition, this would be even better ... |
zorun
left a comment
There was a problem hiding this comment.
What happens when a device does not match any case? I.e. wan_mac / lan_mac is not defined?
zorun
left a comment
There was a problem hiding this comment.
This patch is really hard to review because you bundle several changes together... It's hard to check what is an actual change and what is just cosmetic or reordering, and whether any device was forgotten/lost in the change.
So, here it is:
The data at 0xe000 is Here are the MAC addresses I spotted in the factory partition:
So, either the label is wrong, or the current OpenWrt location is wrong. Here is the full hexdump if you find it useful: https://paste.swordarmor.fr/Z3Xg |
If set up at all, wan will be some ethY.2 and lan will be some ethX.1, where in most cases ethX and ethY will be eth0. So, ethX.1 will inherit the MAC address from ethX and ethY.2 will inherit the MAC address from ethY. If you set lan_mac or wan_mac, you overwrite this inherent MAC address. At the moment (without the patchset), if there is no specific definition for a device in 02_network, the default case will just set eth0 + 1 for it. This might be based on a frequent case, but I think it has several drawbacks, so my first patch here changes the default case to be what one would expect: no change to the MAC addresses if you do not set one. The other patches then fix and enhance stuff. Note that some of those changes are only possible after the default case has been removed.
I have thought about that, but I doubt it will be easier with more patches after all. However, I think about giving more details in the commit message for the big patches ... |
Well, that's what I wanted to know. So, the wan address can actually be read from 0xe006 instead of calculating it.
0x0004 and 0x8004 are used for Wifi when reading caldata from 0x0000 and 0x8000, so everything looks correct there to me. Or are you referring to something else? Thank you very much for the detailed information. |
|
Added we1326. |
|
Sent the following two patches to the list, as they are simple fixes and independent of the other changes here:
|
|
Hi! I'm a bit skeptical about this: ramips: remove default case for MAC address assignment
Those developers who are aware of this problem will add correct definition, and those who don't care will just add their device into the largest case anyway. In the end we just bloat 02_network a bit and still have to explicitly ask PR/patch authors to check mac address assignments when they use wan_mac = lan_mac + 1 BTW I'd be happy to merge the rest of this PR if you could move this commit down to the last one :) |
|
@981213 Thanks for the response.
Well, that's part of what I want to achieve, since I have the feeling that almost nobody really cares about the MAC assignment. In this situation, I prefer that the event leading to another MAC address occupied requires more work than the event where nothing is changed. But despite that, note that especially patch 2 here is based on having the default case removed: So I'm still deeply convinced that having the default case swapped is the proper solution here.
Since this won't hurt too much, I will try to do that during the day. This will then introduce the "do nothing" case which will be removed again in the final patch. Maybe by that it will also become a little more obvious what my desire is in this context. |
26e11b6 to
5021f4c
Compare
|
@981213 I have changed patch order as requested (including the necessary adjustments). |
981213
left a comment
There was a problem hiding this comment.
Partially merged into my staging tree at: https://git.openwrt.org/?p=openwrt/staging/981213.git
Just one more question before pushing:
5021f4c to
dc3648e
Compare
|
Thanks for merge. |
|
@981213 I've backported the most important fixes and sent them to the list... |
fdd3629 to
577cf8f
Compare
577cf8f to
51ab367
Compare
|
Rebased. |
51ab367 to
4c8f640
Compare
|
Change for youhua,wr1200js has been sent to list as separate patch. |
5aa96a2 to
8e94499
Compare
|
Rebased and adjusted due to unielec rename. |
So far, MAC address assignment in ramips has contained a default case, which defined wan_mac = eth0 + 1 for _every_ device not having an explicit case there. This is not desirable, as many device supporters will just not care or know about this definition, so another MAC address will be introduced by accident. In some cases the wan_mac is assigned although it is not needed, in other cases even addresses not dedicated to the device will be used (e.g. wan_mac actually is eth0 - 1, but during support nobody cared, so eth0 + 1 is used now, which might actually belong to another device ...). Thus, in this PR the former default case is converted to an explicit case. This one comprises all devices not being accounted for by other cases, reduced by those not having wan at all. The big number of entries for this node might be another indication that many of them wouldn't actually be there if there hadn't been default wan_mac setup. In exchange, the current "do nothing" case can be removed, as it will be the new default case. The devices being put in the newly created explicit case were determined as follows: 1. Create a list of all devices based on the DTS files. 2. Remove all devices already having an explicit entry setting their address. 3. Remove all devices that only have lan set up in the first part of 02_network: mt7620: - alfa-network,tube-e4g - asus,rp-n53 - buffalo,wmr-300 - comfast,cf-wr800n - edimax,ew-7476rpc - edimax,ew-7478ac - elecom,wrh-300cr - hnet,c108 - kimax,u25awf-h1 - kimax,u35wf - kingston,mlw221 - kingston,mlwg2 - microduino,microwrt - netgear,ex2700 - netgear,ex3700 - netgear,wn3000rp-v3 - planex,cs-qr10 - planex,mzk-ex300np - planex,mzk-ex750np - ravpower,wd03 - sercomm,na930 - yukai,bocco - zbtlink,zbt-cpe102 - zbtlink,zbt-we1026-5g-16m - zte,q7 mt7621: - gnubee,gb-pc1 - gnubee,gb-pc2 - linksys,re6500 - mikrotik,rbm11g - netgear,ex6150 - thunder,timecloud - tplink,re350-v1 - tplink,re650-v1 mt76x8: - alfa-network,awusfree1 - d-team,pbr-d1 - glinet,vixmini - vocore,vocore2-lite - tama,w06 - tplink,tl-mr3020-v3 - tplink,tl-wa801nd-v5 - tplink,tl-wr802n-v4 - tplink,tl-wr902ac-v3 - vocore,vocore2 - widora,neo-16m - widora,neo-32m rt288x: - buffalo,wli-tx4-ag300n - dlink,dap-1522-a1 rt305x: - allnet,all0256n-4m - allnet,all0256n-8m - allnet,all5002 - allnet,all5003 - alphanetworks,asl26555-16m - alphanetworks,asl26555-8m - asus,wl-330n - aximcom,mr-102n - dlink,dcs-930 - easyacc,wizard-8800 - hame,mpr-a2 - hootoo,ht-tm02 - huawei,d105 - intenso,memory2move - planex,mzk-dp150n - rt305x dlink,dcs-930l-b1 - sparklan,wcr-150gn - tenda,3g150b - tenda,3g300m - tenda,w150m - trendnet,tew-638apb-v2 - unbranded,a5-v11 - vocore,vocore-16m - vocore,vocore-8m - wansview,ncs601w - zorlik,zl5900v2 rt3883: - loewe,wmdr-143n - omnima,hpm 4. Put the remaining devices in the new case. Signed-off-by: Adrian Schmutzler <[email protected]>
|
@981213 I personally still think that the wan MAC assignment patch here would be an improvement. Since you have been skeptical about it and justified your view, I want to give you the chance to veto on merging this patch before I push it. |
|
I will merge this today. |
Based on recent device support discussion and fixes on ramips MAC address assignment, this patchset removes the misleading wan_mac default cases and fixes/tidies up several things after that.
Please refer to the individual commit description for further details.