[LEDE-DEV] [PATCH 2/5] br2684ctl: set the MAC address configured for the atm bridge using

Mathias Kresin dev at kresin.me
Sat Jul 2 08:00:37 PDT 2016


If an ESI is set, it will be used as MAC address for the nas0
interface.

According to the ESI man page, changes to the ESI are not automatically
propagated throughout the system and therefore esi should be used
early during system.

Setting the ESI before creating the nas interface should be early enough
for all following services.

Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 package/network/utils/linux-atm/Makefile        | 1 +
 package/network/utils/linux-atm/files/br2684ctl | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/package/network/utils/linux-atm/Makefile b/package/network/utils/linux-atm/Makefile
index 62d71ea..52f789c 100644
--- a/package/network/utils/linux-atm/Makefile
+++ b/package/network/utils/linux-atm/Makefile
@@ -77,6 +77,7 @@ endef
 
 define Package/br2684ctl
   $(call Package/linux-atm/Default)
+  DEPENDS+=+atm-esi
   TITLE:=ATM Ethernet bridging configuration utility
 endef
 
diff --git a/package/network/utils/linux-atm/files/br2684ctl b/package/network/utils/linux-atm/files/br2684ctl
index 0fa86bd..2563455 100755
--- a/package/network/utils/linux-atm/files/br2684ctl
+++ b/package/network/utils/linux-atm/files/br2684ctl
@@ -44,6 +44,9 @@ start_daemon() {
 	local sendsize
 	config_get sendsize "$cfg" sendsize
 
+	local mac
+	config_get mac "$cfg" mac
+
 	found=
 	for device in /sys/class/atm/*; do
 		[ -d "$device" ] || break
@@ -56,6 +59,8 @@ start_daemon() {
 
 	local circuit="$atmdev.$vpi.$vci"
 
+	[ -n "$mac" ] && /usr/sbin/esi "${mac//:/}" $unit
+
 	procd_open_instance
 	procd_set_param command \
 		/usr/sbin/br2684ctl_wrap "nas$unit" \
-- 
1.9.1




More information about the Lede-dev mailing list