]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lldpd: ensure retransmit is triggered when a port goes up
authorVincent Bernat <vincent@bernat.im>
Sat, 22 Aug 2015 21:27:14 +0000 (23:27 +0200)
committerVincent Bernat <vincent@bernat.im>
Sat, 22 Aug 2015 21:27:14 +0000 (23:27 +0200)
src/daemon/lldpd.c
src/lldpd-structs.h

index c4f8c6fece07f2e83d91c86702dfd916a562014b..935b9c0ac126f65c3d0e26e125c91d6a2020e5cf 100644 (file)
@@ -356,6 +356,8 @@ lldpd_reset_timer(struct lldpd *cfg)
                 * change. To do this, we zero out fields that are not
                 * significant, marshal the port, then restore. */
                struct lldpd_port *port = &hardware->h_lport;
+               /* Take the current flags into account to detect a change. */
+               port->_p_hardware_flags = hardware->h_flags;
                u_int8_t *output = NULL;
                ssize_t output_len;
                char save[LLDPD_PORT_START_MARKER];
index a96801ab32c6778d1e533ef4b90a4c886c7d21ea..27779b40e2b162224456f45bb1dfcc67d5af3e8e 100644 (file)
@@ -246,6 +246,7 @@ struct lldpd_port {
        /* Important: all fields that should be ignored to check if a port has
         * been changed should be before this mark. */
 #define LLDPD_PORT_START_MARKER (offsetof(struct lldpd_port, p_id_subtype))
+       int                      _p_hardware_flags; /* This is a copy of hardware flags. Do not use it! */
        u_int8_t                 p_id_subtype;
        char                    *p_id;
        int                      p_id_len;