提交 22a2708d 编写于 作者: K Kumar Kartikeya Dwivedi 提交者: Zheng Zengkai

libbpf: Set NLM_F_EXCL when creating qdisc

mainline inclusion
from mainline-5.14-rc1
commit bbf29d3a
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5EUVD
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bbf29d3a2e49e482d5267311798aec42f00e88f3

-------------------------------------------------

This got lost during the refactoring across versions. We always use
NLM_F_EXCL when creating some TC object, so reflect what the function
says and set the flag.

Fixes: 715c5ce4 ("libbpf: Add low level TC-BPF management API")
Signed-off-by: NKumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210612023502.1283837-3-memxor@gmail.com
(cherry picked from commit bbf29d3a)
Signed-off-by: NWang Yufen <wangyufen@huawei.com>
上级 26545540
...@@ -457,7 +457,7 @@ static int tc_qdisc_modify(struct bpf_tc_hook *hook, int cmd, int flags) ...@@ -457,7 +457,7 @@ static int tc_qdisc_modify(struct bpf_tc_hook *hook, int cmd, int flags)
static int tc_qdisc_create_excl(struct bpf_tc_hook *hook) static int tc_qdisc_create_excl(struct bpf_tc_hook *hook)
{ {
return tc_qdisc_modify(hook, RTM_NEWQDISC, NLM_F_CREATE); return tc_qdisc_modify(hook, RTM_NEWQDISC, NLM_F_CREATE | NLM_F_EXCL);
} }
static int tc_qdisc_delete(struct bpf_tc_hook *hook) static int tc_qdisc_delete(struct bpf_tc_hook *hook)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册