[OpenWrt-Devel] [PATCH] base-files: config_generate: split macaddr with multiple ifaces

Adrian Schmutzler freifunk at adrianschmutzler.de
Tue Nov 12 18:57:09 EST 2019


From: Sungbo Eo <mans0n at gorani.run>

netifd does not handle network. at device[x].name properly if it
contains multiple ifaces separated by spaces. Due to this, board.d
lan_mac setup does not work if multiple ifaces are set to LAN by
ucidef_set_interface_lan.

To fix this, create a device node for each member iface when
running config_generate. Those are named based on the member
ifname:

  ucidef_set_interface_lan "eth0 eth1.1"
  ucidef_set_interface_macaddr "lan" "yy:yy:yy:yy:yy:01"

will return

  config device 'eth0_dev'
        option name 'eth0'
        option macaddr 'yy:yy:yy:yy:yy:01'

  config device 'eth1_1_dev'
        option name 'eth1.1'
        option macaddr 'yy:yy:yy:yy:yy:01'

The updated node names are only used for cases where more than
one member iface is specified. The typical single-ifname case
won't be altered (lan_dev, wan_dev).

Signed-off-by: Sungbo Eo <mans0n at gorani.run>
[extended description, changed commit title]
Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>

---

I plan to also backport this to at least 19.07 and 18.06, as it's
essentially a fix.

Note that it actually would be easier to use the new naming scheme
consistently also for single-member lan/wan. I have not done that
here as it would mean a (cosmetic) change affecting many users,
while the changes shown here would limit the new node names to those
users actually having multiple members in lan.



More information about the openwrt-devel mailing list