From: Yan Lu <973788536@qq.com>
To: maxime.coquelin@redhat.com, chenbox@nvidia.com
Cc: dev@dpdk.org, luyan <luyan@cmss.chinamobile.com>
Subject: [PATCH v2] net/tap: fix add qdisc failed when create tap
Date: Wed, 21 May 2025 09:33:13 +0800 [thread overview]
Message-ID: <tencent_A3665C1C6ABD9B1869524D2269D4A39C4105@qq.com> (raw)
In-Reply-To: <tencent_C80031E4649A04EFE84C39ACCC8938FEBA06@qq.com>
From: luyan <luyan@cmss.chinamobile.com>
The errno variable was assigned a positive value in the previous handling,
but here it is compared against -EEXIST,
When the tap already exists, this would falsely report an error.
Fixes: 6fc6de7e0eaf ("net/tap: update netlink error code management")
Signed-off-by: Yan Lu <luyan@cmss.chinamobile.com>
---
.mailmap | 1 +
drivers/net/tap/tap_tcmsgs.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/.mailmap b/.mailmap
index d8439b79ce..32fd2b8180 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1737,6 +1737,7 @@ Yanglong Wu <yanglong.wu@intel.com>
Yang Ming <ming.1.yang@nokia-sbell.com>
Yang Zhang <zy107165@alibaba-inc.com>
Yanjie Xu <yanjie.xu@intel.com>
+Yan Lu <luyan@cmss.chinamobile.com>
Yan Xia <yanx.xia@intel.com>
Yao-Po Wang <blue119@gmail.com>
Yao Zhao <yao.zhao@windriver.com>
diff --git a/drivers/net/tap/tap_tcmsgs.c b/drivers/net/tap/tap_tcmsgs.c
index 1755b57519..caca9445c8 100644
--- a/drivers/net/tap/tap_tcmsgs.c
+++ b/drivers/net/tap/tap_tcmsgs.c
@@ -261,7 +261,7 @@ qdisc_create_multiq(int nlsk_fd, unsigned int ifindex)
int err = 0;
err = qdisc_add_multiq(nlsk_fd, ifindex);
- if (err < 0 && errno != -EEXIST) {
+ if (err < 0 && errno != EEXIST) {
TAP_LOG(ERR, "Could not add multiq qdisc (%d): %s",
errno, strerror(errno));
return -1;
@@ -287,7 +287,7 @@ qdisc_create_ingress(int nlsk_fd, unsigned int ifindex)
int err = 0;
err = qdisc_add_ingress(nlsk_fd, ifindex);
- if (err < 0 && errno != -EEXIST) {
+ if (err < 0 && errno != EEXIST) {
TAP_LOG(ERR, "Could not add ingress qdisc (%d): %s",
errno, strerror(errno));
return -1;
--
2.45.2.windows.1
prev parent reply other threads:[~2025-05-21 7:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-12 8:22 [PATCH] " luyan
2025-05-20 15:55 ` Stephen Hemminger
2025-05-21 1:33 ` Yan Lu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_A3665C1C6ABD9B1869524D2269D4A39C4105@qq.com \
--to=973788536@qq.com \
--cc=chenbox@nvidia.com \
--cc=dev@dpdk.org \
--cc=luyan@cmss.chinamobile.com \
--cc=maxime.coquelin@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).