]> git.ipfire.org Git - thirdparty/lldpd.git/blobdiff - src/daemon/lldpd.c
lldp: when receiving a shutdown LLDPU, don't clear chassis information
[thirdparty/lldpd.git] / src / daemon / lldpd.c
index 1d92dd3cc5ffcffe3ed7a9c35438b21e9a37e60c..dd4487ac5e0dc949aa3fccb14bd939e2401b9c19 100644 (file)
@@ -662,7 +662,14 @@ lldpd_decode(struct lldpd *cfg, char *frame, int s,
                free(oport);
        }
        if (ochassis) {
-               lldpd_move_chassis(ochassis, chassis);
+               if (port->p_ttl == 0) {
+                       /* Shutdown LLDPDU is special. We do not want to replace
+                        * the chassis. Free the new chassis (which is mostly empty) */
+                       log_debug("decode", "received a shutdown LLDPDU");
+                       lldpd_chassis_cleanup(chassis, 1);
+               } else {
+                       lldpd_move_chassis(ochassis, chassis);
+               }
                chassis = ochassis;
        } else {
                /* Chassis not known, add it */