8 Star 0 Fork 11

src-anolis-os/lldpad

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
open-lldp-v1.0.1-30-support-DSCP-selectors.patch 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
小龙 提交于 2022-11-10 14:28 . update to lldpad-1.0.1-19.git036e314.el8
From c8e438d610bc8af109c19479ee0f568b271d4030 Mon Sep 17 00:00:00 2001
From: Petr Machata <petrm@mellanox.com>
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 <petrm@mellanox.com>
---
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-anolis-os/lldpad.git
git@gitee.com:src-anolis-os/lldpad.git
src-anolis-os
lldpad
lldpad
a8

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385