]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
iptuntap: use TUNDEV macro
authorDenis Kirjanov <kirjanov@gmail.com>
Tue, 20 Feb 2024 13:45:44 +0000 (08:45 -0500)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 26 Feb 2024 20:25:27 +0000 (12:25 -0800)
the code already has a path to the tan/tap device

Signed-off-by: Denis Kirjanov <dkirjanov@suse.de>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/iptuntap.c

index dbb07580f68e7117dfc3e6d331cc5e367d2574b6..b7018a6ff1ef2d0dcf671423942f4a8f2b384822 100644 (file)
@@ -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)