]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
display: fix display of various Dot3 advertised links
authorVincent Bernat <bernat@luffy.cx>
Thu, 20 Sep 2012 14:37:22 +0000 (16:37 +0200)
committerVincent Bernat <bernat@luffy.cx>
Thu, 20 Sep 2012 14:37:22 +0000 (16:37 +0200)
src/display.c

index 97f26332dbba68321cdbbcc9651ddaad3ad36847..9398f7790c9df2e2f9e09b9619e84b9419d21916 100644 (file)
@@ -889,8 +889,10 @@ display_autoneg(struct writer * w, struct lldpd_port *port, int bithd, int bitfd
 
        tag_start(w, "advertised", "Adv");
        tag_attr(w, "type", "", desc);
-       tag_attr(w, "hd", "HD", (port->p_macphy.autoneg_advertised & bithd)?"yes":"no");
-       tag_attr(w, "fd", "FD", (port->p_macphy.autoneg_advertised)?"yes":"no");
+       if (bitfd != bithd) {
+               tag_attr(w, "hd", "HD", (port->p_macphy.autoneg_advertised & bithd)?"yes":"no");
+               tag_attr(w, "fd", "FD", (port->p_macphy.autoneg_advertised & bitfd)?"yes":"no");
+       }
        tag_end (w);
 }
 #endif
@@ -958,13 +960,16 @@ display_port(struct writer * w, struct lldpd_port *port)
                            "10Base-T");
                        display_autoneg(w, port, LLDP_DOT3_LINK_AUTONEG_100BASE_TX,
                            LLDP_DOT3_LINK_AUTONEG_100BASE_TXFD,
-                           "100Base-T");
+                           "100Base-TX");
                        display_autoneg(w, port, LLDP_DOT3_LINK_AUTONEG_100BASE_T2,
                            LLDP_DOT3_LINK_AUTONEG_100BASE_T2FD,
                            "100Base-T2");
+                       display_autoneg(w, port, LLDP_DOT3_LINK_AUTONEG_100BASE_T4,
+                           LLDP_DOT3_LINK_AUTONEG_100BASE_T4,
+                           "100Base-T4");
                        display_autoneg(w, port, LLDP_DOT3_LINK_AUTONEG_1000BASE_X,
                            LLDP_DOT3_LINK_AUTONEG_1000BASE_XFD,
-                           "100Base-X");
+                           "1000Base-X");
                        display_autoneg(w, port, LLDP_DOT3_LINK_AUTONEG_1000BASE_T,
                            LLDP_DOT3_LINK_AUTONEG_1000BASE_TFD,
                            "1000Base-T");