[OpenWrt-Devel] [PATCH] lantiq: Synchronize access to the DSL command pipe

Martin Blumenstingl martin.blumenstingl at googlemail.com
Tue Oct 13 11:58:45 EDT 2015


Whenever two processes were executing different commands at the same
time then one of the commands sometimes got the response of the other
command.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
---
 target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
index 7809d01..ce6aa50 100755
--- a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
+++ b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
@@ -12,8 +12,10 @@ fi
 #
 dsl_cmd() {
 	killall -0 ${XDSL_CTRL} && (
+		lock /var/lock/dsl_pipe
 		echo "$@" > /tmp/pipe/dsl_cpe0_cmd
 		cat /tmp/pipe/dsl_cpe0_ack
+		lock -u /var/lock/dsl_pipe
 	)
 }
 dsl_val() {
-- 
2.6.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list