From: Vincent Bernat Date: Mon, 26 Dec 2016 09:16:37 +0000 (+0100) Subject: client: display current MAU type even when autoneg is disabled X-Git-Tag: 0.9.6~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=72cf4bba2775e81d297be613bb266d76230953c2;p=thirdparty%2Flldpd.git client: display current MAU type even when autoneg is disabled --- diff --git a/NEWS b/NEWS index 161566be..f1e02d87 100644 --- 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. diff --git a/src/client/display.c b/src/client/display.c index 77938c0b..fad64962 100644 --- a/src/client/display.c +++ b/src/client/display.c @@ -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"); diff --git a/tests/integration/test_lldpcli.py b/tests/integration/test_lldpcli.py index e224e448..d8de2cbc 100644 --- a/tests/integration/test_lldpcli.py +++ b/tests/integration/test_lldpcli.py @@ -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): 00:00:00:00:00:02 eth1 + + 10GigBaseCX4 - X copper over 8 pair 100-Ohm balanced cable +