* [PATCH iproute2] iptuntap: use TUNDEV macro
@ 2024-02-20 13:45 Denis Kirjanov
2024-02-26 20:30 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Denis Kirjanov @ 2024-02-20 13:45 UTC (permalink / raw)
To: stephen; +Cc: netdev, Denis Kirjanov
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-02-26 20:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-20 13:45 [PATCH iproute2] iptuntap: use TUNDEV macro Denis Kirjanov
2024-02-26 20:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox