lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240220134544.31119-1-dkirjanov@suse.de>
Date: Tue, 20 Feb 2024 08:45:44 -0500
From: Denis Kirjanov <kirjanov@...il.com>
To: stephen@...workplumber.org
Cc: netdev@...r.kernel.org,
	Denis Kirjanov <dkirjanov@...e.de>
Subject: [PATCH iproute2] iptuntap: use TUNDEV macro

the code already has a path to the tan/tap device

Signed-off-by: Denis Kirjanov <dkirjanov@...e.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ