[source] lldpd: freeze execution of lldpd during reload

LEDE Commits lede-commits at lists.infradead.org
Mon Oct 31 04:51:29 PDT 2016


jow pushed a commit to source.git, branch master:
https://git.lede-project.org/b7fadb12b76a471d66dfd3266ad0af2177914057

commit b7fadb12b76a471d66dfd3266ad0af2177914057
Author: Alexandru Ardelean <ardeleanalex at gmail.com>
AuthorDate: Tue Jan 5 09:40:22 2016 +0200

    lldpd: freeze execution of lldpd during reload
    
    During reload, we could send invalid information to the other
    side and confuse it.
    
    That's why, during reload we'll pause execution, do the reconfig
    and resume + update when reload is done.
    
    Signed-off-by: Alexandru Ardelean <ardeleanalex at gmail.com>
---
 package/network/services/lldpd/files/lldpd.init | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init
index 8fe0a47..4e9efca 100644
--- a/package/network/services/lldpd/files/lldpd.init
+++ b/package/network/services/lldpd/files/lldpd.init
@@ -99,6 +99,7 @@ service_running() {
 reload_service() {
 	running || return 1
 	$LLDPCLI -u $LLDPSOCKET &> /dev/null <<-EOF
+		pause
 		unconfigure lldp custom-tlv
 		unconfigure system interface pattern
 		unconfigure system description
@@ -108,7 +109,10 @@ reload_service() {
 	write_lldpd_conf
 	$LLDPCLI -u $LLDPSOCKET -c $LLDPD_CONF -c $LLDPD_CONFS_DIR &> /dev/null
 	# Broadcast update over the wire
-	$LLDPCLI -u $LLDPSOCKET update &> /dev/null
+	$LLDPCLI -u $LLDPSOCKET &> /dev/null <<-EOF
+		resume
+		update
+	EOF
 	return 0
 }
 



More information about the lede-commits mailing list