From: luyan <973788536@qq.com>
To: maxime.coquelin@redhat.com, chenbox@nvidia.com
Cc: dev@dpdk.org, luyan <luyan@cmss.chinamobile.com>
Subject: [PATCH] net/tap: fix add qdisc failed when create tap
Date: Mon, 12 May 2025 16:22:04 +0800 [thread overview]
Message-ID: <tencent_C80031E4649A04EFE84C39ACCC8938FEBA06@qq.com> (raw)
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.
Signed-off-by: luyan <luyan@cmss.chinamobile.com>
---
drivers/net/tap/tap_tcmsgs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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
reply other threads:[~2025-05-12 16:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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_C80031E4649A04EFE84C39ACCC8938FEBA06@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).