diff --git a/SOURCES/open-lldp-v1.0.1-28-fix-oid-display.patch b/SOURCES/open-lldp-v1.0.1-28-fix-oid-display.patch new file mode 100644 index 0000000..257afa1 --- /dev/null +++ b/SOURCES/open-lldp-v1.0.1-28-fix-oid-display.patch @@ -0,0 +1,51 @@ +From cf3f54d1883e5bc23e4c4006a63e1dde88684013 Mon Sep 17 00:00:00 2001 +From: Aaron Conole +Date: Thu, 21 Jun 2018 13:28:48 -0400 +Subject: [PATCH] basman_clif: print the OID properly + +When invoking the lldp tool to view the management information, the display +for the OID is printed as the actual binary bits, rather than the +OID dotted-notation form. + +This change will display the OID as expected. + +Signed-off-by: Aaron Conole +--- + lldp_basman_clif.c | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) + +diff --git a/lldp_basman_clif.c b/lldp_basman_clif.c +index 7dba9d2..abd152d 100644 +--- a/lldp_basman_clif.c ++++ b/lldp_basman_clif.c +@@ -272,8 +272,15 @@ void print_mng_addr(u16 len, char *info) + memset(buf, 0, sizeof(buf)); + if (hexstr2bin(info+offset, (u8 *)&buf, oidlen)) + printf("\tOID: Error parsing OID\n"); +- else +- printf("\tOID: %s\n", buf); ++ else { ++ printf("\tOID: 0."); ++ for (i = 0; i < oidlen; ++i) { ++ printf("%d", buf[i]); ++ if (i != (oidlen - 1)) ++ printf("."); ++ } ++ printf("\n"); ++ } + } else if (oidlen > 128) { + printf("\tOID: Invalid length = %d\n", oidlen); + } +@@ -310,3 +317,10 @@ u32 basman_lookup_tlv_name(char *tlvid_str) + } + return INVALID_TLVID; + } ++ ++/* Local Variables: */ ++/* c-indent-level: 8 */ ++/* c-basic-offset: 8 */ ++/* tab-width: 8 */ ++/* indent-tabs-mode: t */ ++/* End: */ +-- +2.14.3 diff --git a/SOURCES/open-lldp-v1.0.1-29-memleak-on-received-TLVs.patch b/SOURCES/open-lldp-v1.0.1-29-memleak-on-received-TLVs.patch new file mode 100644 index 0000000..0d8d7c2 --- /dev/null +++ b/SOURCES/open-lldp-v1.0.1-29-memleak-on-received-TLVs.patch @@ -0,0 +1,109 @@ +From 9b0389837d7532909a8070d5a08f0175c367c12e Mon Sep 17 00:00:00 2001 +From: Chris Leech +Date: Wed, 23 May 2018 16:37:51 -0700 +Subject: [PATCH] memleak on received TLVs from modules + +Most of the TLV modules that have an rchange handler for received TLVs +seem to get the return values wrong, returning 0 or TLV_OK without +freeing or storing the unpacked TLV to be freed later. That leaks the +allocation, as rxProcessFrame believes the module has claimed ownership. + +In a test setup, it's probably easiest to see by enabling some TLV type +on one side of a connection only. Or, any unexpected TLV that doesn't +get handled will be erroneously leaked by the EVB modules. +--- + lldp_8021qaz.c | 4 ++-- + lldp_evb.c | 8 +++++--- + lldp_evb22.c | 8 +++++--- + 3 files changed, 12 insertions(+), 8 deletions(-) + +diff --git a/lldp_8021qaz.c b/lldp_8021qaz.c +index 094676d..198ebcf 100644 +--- a/lldp_8021qaz.c ++++ b/lldp_8021qaz.c +@@ -1924,7 +1924,7 @@ int ieee8021qaz_rchange(struct port *port, struct lldp_agent *agent, + struct ieee8021qaz_unpkd_tlvs *rx; + + if (agent->type != NEAREST_BRIDGE) +- return 0; ++ return SUBTYPE_INVALID; + + qaz_tlvs = ieee8021qaz_data(port->ifname); + if (!qaz_tlvs) +@@ -2005,7 +2005,7 @@ int ieee8021qaz_rchange(struct port *port, struct lldp_agent *agent, + } + } + +- return TLV_OK; ++ return SUBTYPE_INVALID; + } + + static void ieee8021qaz_free_rx(struct ieee8021qaz_unpkd_tlvs *rx) +diff --git a/lldp_evb.c b/lldp_evb.c +index 4b3752e..07f5ffb 100644 +--- a/lldp_evb.c ++++ b/lldp_evb.c +@@ -210,7 +210,8 @@ static int evb_rchange(struct port *port, struct lldp_agent *agent, + u8 oui_subtype[OUI_SUB_SIZE] = LLDP_OUI_SUBTYPE; + + if (agent->type != NEAREST_CUSTOMER_BRIDGE) +- return 0; ++ return SUBTYPE_INVALID; ++ + ed = evb_data(port->ifname, agent->type); + + if (!ed) +@@ -229,7 +230,7 @@ static int evb_rchange(struct port *port, struct lldp_agent *agent, + if (!ed->txmit) { + LLDPAD_WARN("%s:%s agent %d EVB Config disabled\n", + __func__, ed->ifname, agent->type); +- return TLV_OK; ++ return SUBTYPE_INVALID; + } + + LLDPAD_DBG("%s:%s agent %d received tlv:\n", __func__, +@@ -246,7 +247,8 @@ static int evb_rchange(struct port *port, struct lldp_agent *agent, + evb_print_tlvinfo(ed->ifname, &ed->tie); + vdp_update(port->ifname, ed->tie.ccap); + } +- return TLV_OK; ++ ++ return SUBTYPE_INVALID; + } + + /* +diff --git a/lldp_evb22.c b/lldp_evb22.c +index 85c6abc..64b04e0 100644 +--- a/lldp_evb22.c ++++ b/lldp_evb22.c +@@ -305,7 +305,8 @@ static int evb22_rchange(struct port *port, struct lldp_agent *agent, + u8 oui_subtype[OUI_SUB_SIZE] = LLDP_MOD_EVB22_OUI; + + if (agent->type != NEAREST_CUSTOMER_BRIDGE) +- return 0; ++ return SUBTYPE_INVALID; ++ + ed = evb22_data(port->ifname, agent->type); + + if (!ed) +@@ -324,7 +325,7 @@ static int evb22_rchange(struct port *port, struct lldp_agent *agent, + if (!ed->txmit) { + LLDPAD_WARN("%s:%s agent %d EVB Config disabled\n", + __func__, ed->ifname, agent->type); +- return TLV_OK; ++ return SUBTYPE_INVALID; + } + + LLDPAD_DBG("%s:%s agent %d received tlv:\n", __func__, +@@ -341,7 +342,8 @@ static int evb22_rchange(struct port *port, struct lldp_agent *agent, + evb22_print_tlvinfo(ed->ifname, &ed->out); + /* TODO vdp_update(port->ifname, ed->tie.ccap); */ + } +- return TLV_OK; ++ ++ return SUBTYPE_INVALID; + } + + /* +-- +2.19.1 diff --git a/SOURCES/open-lldp-v1.0.1-30-support-DSCP-selectors.patch b/SOURCES/open-lldp-v1.0.1-30-support-DSCP-selectors.patch new file mode 100644 index 0000000..e7540d9 --- /dev/null +++ b/SOURCES/open-lldp-v1.0.1-30-support-DSCP-selectors.patch @@ -0,0 +1,42 @@ +From c8e438d610bc8af109c19479ee0f568b271d4030 Mon Sep 17 00:00:00 2001 +From: Petr Machata +Date: Mon, 9 Jul 2018 21:43:41 +0300 +Subject: [PATCH] lldpad: Support DSCP selectors in APP TLV's + +The P802.1Qcd/D2.1 standard draft introduces a new APP TLV: DSCP, with +selector value of 5. Don't reject APP TLV's with selector 5, and +sanitize the PID value to not be out of bounds for DSCP. + +Signed-off-by: Petr Machata +--- + lldp_8021qaz_cmds.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/lldp_8021qaz_cmds.c b/lldp_8021qaz_cmds.c +index 8cb225e..e017e2a 100644 +--- a/lldp_8021qaz_cmds.c ++++ b/lldp_8021qaz_cmds.c +@@ -1290,7 +1290,7 @@ static int _set_arg_app(struct cmd *cmd, char *args, char *arg_value, + obuf_len - strlen(obuf) - 2); + goto err; + } +- if (sel < 1 || sel > 4) { ++ if (sel < 1 || sel > 5) { + strncat(obuf, ": selector out of range", + obuf_len - strlen(obuf) - 2); + goto err; +@@ -1305,6 +1305,11 @@ static int _set_arg_app(struct cmd *cmd, char *args, char *arg_value, + obuf_len - strlen(obuf) - 2); + goto err; + } ++ if (sel == 5 && pid > 63) { ++ strncat(obuf, ": DSCP > 63", ++ obuf_len - strlen(obuf) - 2); ++ goto err; ++ } + + free(parse); + +-- +2.21.0 + diff --git a/SPECS/lldpad.spec b/SPECS/lldpad.spec index 42e830d..d50e1d4 100644 --- a/SPECS/lldpad.spec +++ b/SPECS/lldpad.spec @@ -7,7 +7,7 @@ Name: lldpad Version: 1.0.1 -Release: 9.git%{checkout}%{?dist} +Release: 13.git%{checkout}%{?dist} Summary: Intel LLDP Agent Group: System Environment/Daemons License: GPLv2 @@ -40,6 +40,9 @@ Patch24: open-lldp-v1.0.1-24-switch-from-sysv-to-posix-shared-memory-apis.patch Patch25: open-lldp-v1.0.1-25-l2_linux_packet-correctly-process-return-value-of-ge.patch Patch26: open-lldp-v1.0.1-26-lldpad-system-capability-incorrect-advertised-as-sta.patch Patch27: open-lldp-v1.0.1-27-fix-build-warnings.patch +Patch28: open-lldp-v1.0.1-28-fix-oid-display.patch +Patch29: open-lldp-v1.0.1-29-memleak-on-received-TLVs.patch +Patch30: open-lldp-v1.0.1-30-support-DSCP-selectors.patch BuildRequires: automake autoconf libtool BuildRequires: flex >= 2.5.33 @@ -113,6 +116,18 @@ rm -f %{buildroot}%{_libdir}/liblldp_clif.la %{_libdir}/liblldp_clif.so %changelog +* Tue Aug 13 2019 Aaron Conole - 1.0.1-13.git036e314 +- After gating yml updates + +* Fri Jul 05 2019 Aaron Conole - 1.0.1-12.git036e314 +- Add support for DSCP selectors in APP TLVs (#1704660) + +* Fri Jul 05 2019 Aaron Conole - 1.0.1-11.git036e314 +- Fix memleak on TLV reception (#1727326) + +* Fri Jul 05 2019 Aaron Conole - 1.0.1-10.git036e314 +- Fix the OID display (#1614933) + * Thu Feb 08 2018 Fedora Release Engineering - 1.0.1-9.git036e314 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild