diff mbox series

[2/5] base-files: ucidef netdev altname, label and alias

Message ID mailman.133957.1728987197.1280.openwrt-devel@lists.openwrt.org
State New
Headers show
Series None | expand

Commit Message

Evan Jobling Oct. 15, 2024, 10:13 a.m. UTC
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
In addition to path, conduit and gro options.

Allow for setting options for more network device
configuration in preinit.

Adding in preparation for more configuration in
preinit.

A second label pass is required, in case of
conflicts with the path variable and the
network interface doesn't have a .ethernet handle.
For example DSA devices where their label conflicts
with the desired port name.

An altname pass (requiring ip-full) could mitigate
issues when migrating configurations if one wishes
to rename devices in preinit.

A device specific example:

For example in the Firebox M300
default interface names are eth0-eth7
with eth3-eth7 being ports on a dsa switch.
eth3 and eth4 start out as being the conduit
interfaces.

The old names for the devices would be
sweth3 through sweth7. One could set
the altname property to keep existing
configurations working. Or the alias
to keep the names coming up in ip-link
whilst not being able to up/down
the interface with that handle.

Signed-off-by: Evan Jobling <evan.jobling@mslsc.com.au>
---
 .../base-files/files/lib/functions/uci-defaults.sh   | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh
index 8355099c35..7997e49d83 100644
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -122,6 +122,18 @@  ucidef_set_network_device_path() {
 	_ucidef_set_network_device_common $1 path $2
 }
 
+ucidef_set_network_device_label() {
+	_ucidef_set_network_device_common $1 label $2
+}
+
+ucidef_set_network_device_altname() {
+	_ucidef_set_network_device_common $1 altname $2
+}
+
+ucidef_set_network_device_alias() {
+	_ucidef_set_network_device_common $1 alias $2
+}
+
 ucidef_set_network_device_gro() {
 	_ucidef_set_network_device_common $1 gro $2
 }