From 9c1bec86cb578b1ed5d2b23a8f5f7b36a030f819 Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Aug 16 2018 14:14:34 +0000 Subject: Support DSCP APP selectors (BZ 1618377) Signed-off-by: Petr Machata --- diff --git a/lldpad.spec b/lldpad.spec index b63181c..18053e4 100644 --- a/lldpad.spec +++ b/lldpad.spec @@ -7,7 +7,7 @@ Name: lldpad Version: 1.0.1 -Release: 11.git%{checkout}%{?dist} +Release: 12.git%{checkout}%{?dist} Summary: Intel LLDP Agent Group: System Environment/Daemons License: GPLv2 @@ -41,6 +41,10 @@ Patch25: open-lldp-v1.0.1-25-l2_linux_packet-correctly-process-return-value-of-g 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 +# https://bugzilla.redhat.com/show_bug.cgi?id=1618377 +# https://github.com/intel/openlldp/pull/9 +Patch28: open-lldp-v1.0.1-28-support-DSCP-selectors.patch + BuildRequires: automake autoconf libtool BuildRequires: flex >= 2.5.33 BuildRequires: kernel-headers >= 2.6.32 @@ -113,6 +117,9 @@ rm -f %{buildroot}%{_libdir}/liblldp_clif.la %{_libdir}/liblldp_clif.so %changelog +* Thu Aug 16 2018 Petr Machata - 1.0.1-12.git036e314 +- Add open-lldp-v1.0.1-28-support-DSCP-selectors.patch (BZ 1618377) + * Tue Jul 24 2018 Adam Williamson - 1.0.1-11.git036e314 - Rebuild for new libconfig diff --git a/open-lldp-v1.0.1-28-support-DSCP-selectors.patch b/open-lldp-v1.0.1-28-support-DSCP-selectors.patch new file mode 100644 index 0000000..b0e83b5 --- /dev/null +++ b/open-lldp-v1.0.1-28-support-DSCP-selectors.patch @@ -0,0 +1,39 @@ +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); +