lldpd: freeze execution of lldpd during reload
authorAlexandru Ardelean <ardeleanalex@gmail.com>
Tue, 5 Jan 2016 07:40:22 +0000 (09:40 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 31 Oct 2016 11:51:15 +0000 (12:51 +0100)
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@gmail.com>
package/network/services/lldpd/files/lldpd.init

index 8fe0a47cdc02cc4a7b1ddb123fe165bd3bd57cbc..4e9efcae0de0e445baf6f43966f90675484d3ea7 100644 (file)
@@ -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
 }