|
|
c954eb |
From c8e438d610bc8af109c19479ee0f568b271d4030 Mon Sep 17 00:00:00 2001
|
|
|
c954eb |
From: Petr Machata <petrm@mellanox.com>
|
|
|
c954eb |
Date: Mon, 9 Jul 2018 21:43:41 +0300
|
|
|
c954eb |
Subject: [PATCH] lldpad: Support DSCP selectors in APP TLV's
|
|
|
c954eb |
|
|
|
c954eb |
The P802.1Qcd/D2.1 standard draft introduces a new APP TLV: DSCP, with
|
|
|
c954eb |
selector value of 5. Don't reject APP TLV's with selector 5, and
|
|
|
c954eb |
sanitize the PID value to not be out of bounds for DSCP.
|
|
|
c954eb |
|
|
|
c954eb |
Signed-off-by: Petr Machata <petrm@mellanox.com>
|
|
|
c954eb |
---
|
|
|
c954eb |
lldp_8021qaz_cmds.c | 7 ++++++-
|
|
|
c954eb |
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
|
c954eb |
|
|
|
c954eb |
diff --git a/lldp_8021qaz_cmds.c b/lldp_8021qaz_cmds.c
|
|
|
c954eb |
index 8cb225e..e017e2a 100644
|
|
|
c954eb |
--- a/lldp_8021qaz_cmds.c
|
|
|
c954eb |
+++ b/lldp_8021qaz_cmds.c
|
|
|
c954eb |
@@ -1290,7 +1290,7 @@ static int _set_arg_app(struct cmd *cmd, char *args, char *arg_value,
|
|
|
c954eb |
obuf_len - strlen(obuf) - 2);
|
|
|
c954eb |
goto err;
|
|
|
c954eb |
}
|
|
|
c954eb |
- if (sel < 1 || sel > 4) {
|
|
|
c954eb |
+ if (sel < 1 || sel > 5) {
|
|
|
c954eb |
strncat(obuf, ": selector out of range",
|
|
|
c954eb |
obuf_len - strlen(obuf) - 2);
|
|
|
c954eb |
goto err;
|
|
|
c954eb |
@@ -1305,6 +1305,11 @@ static int _set_arg_app(struct cmd *cmd, char *args, char *arg_value,
|
|
|
c954eb |
obuf_len - strlen(obuf) - 2);
|
|
|
c954eb |
goto err;
|
|
|
c954eb |
}
|
|
|
c954eb |
+ if (sel == 5 && pid > 63) {
|
|
|
c954eb |
+ strncat(obuf, ": DSCP > 63",
|
|
|
c954eb |
+ obuf_len - strlen(obuf) - 2);
|
|
|
c954eb |
+ goto err;
|
|
|
c954eb |
+ }
|
|
|
c954eb |
|
|
|
c954eb |
free(parse);
|
|
|
c954eb |
|
|
|
c954eb |
--
|
|
|
c954eb |
2.21.0
|
|
|
c954eb |
|