[PATCH netifd] interface: rename "ifname" attribute to "device"

Rafał Miłecki zajec5 at gmail.com
Mon May 17 08:47:27 PDT 2021

On 17.05.2021 17:32, Paul Oranje wrote:
> Op 17 mei 2021, om 16:49 heeft Rafał Miłecki <zajec5 at gmail.com> het volgende geschreven:
>> From: Rafał Miłecki <rafal at milecki.pl>
>> Interfaces need to be assigned to devices. For that purpose a "device"
>> option should be more accurate than "ifname" one.
>> For backward compatibility add a temporary config translation.
>> Config example:
>> config device
>> 	option name 'lan'
>> 	option type 'bridge'
>> 	list ports 'lan1'
>> 	list ports 'lan2'
>> config interface 'home'
>> 	option device 'lan'
>> 	option proto 'static'
> A bit off-topic: the disparency between config section names and an option named name is not always clear.

What do you mean by "not always"? I think it should be consistent:
"interface" UCI section should always use "device" for referencing
"device" UCI section (by its "name").

As for "name" option in the "device" UCI section I thought we could make
it section name instead, but it can't be done due to UCI limitations for
section names:

[2021-05-14] [16:59:17 CEST] <rmilecki> jow: nbd: quick question - could we have  "config device <foo>" and drop "option name <foo>" ? i see two advantages:
[2021-05-14] [16:59:21 CEST] <rmilecki> 1. it would not allow duplicated names
[2021-05-14] [16:59:21 CEST] <rmilecki> 2. referencing devices from "config interface" would be more natural
[2021-05-14] [17:06:32 CEST] <nbd>      rmilecki: uci section names have restrictions on what characters are allowed
[2021-05-14] [17:09:40 CEST] <rmilecki> nbd: right, thanks
[2021-05-14] [17:10:15 CEST] <zorun>    ah yes, the babeld uci integration used to do this (interface name in section name), but we had to drop it

More information about the openwrt-devel mailing list