openwisp / openwisp-config

OpenWRT configuration agent for OpenWISP Controller
https://openwisp.io/docs/stable/openwrt-config-agent/
GNU General Public License v3.0
374 stars 59 forks source link

[change] Tweak UCI autoname script to avoid conflicts with bridge devices #199

Closed nemesifier closed 6 months ago

nemesifier commented 10 months ago

Overriding the default br-lan device created automatically by OpenWrt via OpenWISP is not possible because it is called "device1", while the OpenWISP netjsonconfig library generates something like "devicelan" (the name is calculated as `device`).

This leads to a situation in which two bridges devices are defined, one which is pre-existing another one added by OpenWISP, leading to inconsistent results.

To prevent this issue we could change the openwisp-uci-autoname.lua script so that it treats network.device objects in a special way: