]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
client: display current MAU type even when autoneg is disabled
authorVincent Bernat <vincent@bernat.im>
Mon, 26 Dec 2016 09:16:37 +0000 (10:16 +0100)
committerVincent Bernat <vincent@bernat.im>
Mon, 26 Dec 2016 09:17:24 +0000 (10:17 +0100)
NEWS
src/client/display.c
tests/integration/test_lldpcli.py

diff --git a/NEWS b/NEWS
index 161566be27886af0564da60095fddcc8b5747922..f1e02d87a40f6b12b1c0c5e9eb81fcdb8065fff6 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ lldpd (0.9.6)
       using json-c). Use `--enable-json0` to enable this option.
     + Support for newer ethtool interface on Linux
       (ETHTOOL_LINKSETTINGS) and additional speed settings.
+    + Current MAU type is displayed even when autoneg is off.
   * Fix:
     + Correctly parse LLDP-MED civic address when the length of the
       TLV exceeds the length of the address.
index 77938c0beceb960217f3bc24bed174418b7b2c5d..fad64962db0b1d532f5eec4557f9cc5e7e6f6860 100644 (file)
@@ -360,14 +360,15 @@ display_port(struct writer *w, lldpctl_atom_t *port, int details)
                tag_datatag(w, "aggregation", "Port is aggregated. PortAggregID",
                    lldpctl_atom_get_str(port, lldpctl_k_port_dot3_aggregid));
 
-               long int autoneg_support, autoneg_enabled, autoneg_advertised;
+               long int autoneg_support, autoneg_enabled, autoneg_advertised, mautype;
                autoneg_support = lldpctl_atom_get_int(port,
                    lldpctl_k_port_dot3_autoneg_support);
                autoneg_enabled = lldpctl_atom_get_int(port,
                    lldpctl_k_port_dot3_autoneg_enabled);
                autoneg_advertised = lldpctl_atom_get_int(port,
                    lldpctl_k_port_dot3_autoneg_advertised);
-               if (autoneg_support > 0 || autoneg_enabled > 0) {
+               mautype = lldpctl_atom_get_int(port, lldpctl_k_port_dot3_mautype);
+               if (autoneg_support > 0 || autoneg_enabled > 0 || mautype > 0) {
                        tag_start(w, "auto-negotiation", "PMD autoneg");
                        tag_attr (w, "supported", "supported",
                            (autoneg_support > 0)?"yes":"no");
index e224e448b10f5b9dd35725669cd8945c9fad7806..d8de2cbc743191d93dea778f0d64f7c31d2fae43 100644 (file)
@@ -38,6 +38,8 @@ Interface:    eth0, via: LLDP, RID: 1, Time: 0 day, 00:00:{seconds}
   Port:
     PortID:       mac 00:00:00:00:00:02
     PortDescr:    eth1
+    PMD autoneg:  supported: no, enabled: no
+      MAU oper type: 10GigBaseCX4 - X copper over 8 pair 100-Ohm balanced cable
 -------------------------------------------------------------------------------
 """
         out = result.stdout.decode('ascii')
@@ -96,7 +98,12 @@ def test_json_output(lldpd1, lldpd, lldpcli, namespaces, uname):
                         "type": "mac",
                         "value": "00:00:00:00:00:02"
                     },
-                    "descr": "eth1"
+                    "descr": "eth1",
+                    "auto-negotiation": {
+                        "enabled": False,
+                        "supported": False,
+                        "current": "10GigBaseCX4 - X copper over 8 pair 100-Ohm balanced cable"
+                    }
                 }
             }}
         }}
@@ -137,6 +144,9 @@ def test_xml_output(lldpd1, lldpd, lldpcli, namespaces, uname):
   <port label="Port">
    <id label="PortID" type="mac">00:00:00:00:00:02</id>
    <descr label="PortDescr">eth1</descr>
+   <auto-negotiation enabled="no" label="PMD autoneg" supported="no">
+    <current label="MAU oper type">10GigBaseCX4 - X copper over 8 pair 100-Ohm balanced cable</current>
+   </auto-negotiation>
   </port>
  </interface>
 </lldp>