From: Denis Kirjanov <kirjanov@gmail.com>
To: stephen@networkplumber.org
Cc: netdev@vger.kernel.org, Denis Kirjanov <dkirjanov@suse.de>
Subject: [PATCH iproute2] iptuntap: use TUNDEV macro
Date: Tue, 20 Feb 2024 08:45:44 -0500 [thread overview]
Message-ID: <20240220134544.31119-1-dkirjanov@suse.de> (raw)
the code already has a path to the tan/tap device
Signed-off-by: Denis Kirjanov <dkirjanov@suse.de>
---
ip/iptuntap.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/ip/iptuntap.c b/ip/iptuntap.c
index dbb07580..b7018a6f 100644
--- a/ip/iptuntap.c
+++ b/ip/iptuntap.c
@@ -271,8 +271,7 @@ static void show_processes(const char *name)
fd_path = globbuf.gl_pathv;
while (*fd_path) {
- const char *dev_net_tun = "/dev/net/tun";
- const size_t linkbuf_len = strlen(dev_net_tun) + 2;
+ const size_t linkbuf_len = strlen(TUNDEV) + 2;
char linkbuf[linkbuf_len], *fdinfo;
int pid, fd;
FILE *f;
@@ -289,7 +288,7 @@ static void show_processes(const char *name)
goto next;
}
linkbuf[err] = '\0';
- if (strcmp(dev_net_tun, linkbuf))
+ if (strcmp(TUNDEV, linkbuf))
goto next;
if (asprintf(&fdinfo, "/proc/%d/fdinfo/%d", pid, fd) < 0)
--
2.30.2
next reply other threads:[~2024-02-20 13:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-20 13:45 Denis Kirjanov [this message]
2024-02-26 20:30 ` [PATCH iproute2] iptuntap: use TUNDEV macro patchwork-bot+netdevbpf
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=20240220134544.31119-1-dkirjanov@suse.de \
--to=kirjanov@gmail.com \
--cc=dkirjanov@suse.de \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/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).