]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsfd: load the information of the network namespace behind a tun device
authorMasatake YAMATO <yamato@redhat.com>
Wed, 4 Feb 2026 20:50:24 +0000 (05:50 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Tue, 24 Feb 2026 18:23:29 +0000 (03:23 +0900)
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
lsfd-cmd/cdev.c
lsfd-cmd/lsfd.h
lsfd-cmd/sock.h

index b9252e3bcfb5a7664c0531ce1a59762f8200a6ea..a1e12e031458c83e672da5309025400c5a239ec4 100644 (file)
@@ -494,8 +494,10 @@ static void cdev_tun_inspect_target_fd(struct cdev *cdev, int fd)
        if (nsfd < 0)
                return;
 
-       if (fstat(nsfd, &sb) == 0)
+       if (fstat(nsfd, &sb) == 0) {
                tundata->devnetns = sb.st_ino;
+               load_fdsk_xinfo(tundata->devnetns, nsfd);
+       }
 
        close(nsfd);
 }
index d1e382efcd5f2286680a21e60769b05c12e08032..3a7e186890c0fea4cf76ee3dfe3537b41a665d02 100644 (file)
@@ -327,6 +327,8 @@ void add_nodev(unsigned long minor, const char *filesystem);
 void load_sock_xinfo(struct path_cxt *pc, const char *name, ino_t netns);
 bool is_nsfs_dev(dev_t dev);
 
+void load_fdsk_xinfo(ino_t netns_ino, int netns_fd);
+
 /*
  * POSIX Mqueue
  */
index ce58623406465a073c9e09d7232060d3089618c2..fdfcafb5379fce7576f4c32b7df659f819b0379a 100644 (file)
@@ -82,6 +82,5 @@ void initialize_sock_xinfos(void);
 void finalize_sock_xinfos(void);
 
 struct sock_xinfo *get_sock_xinfo(ino_t inode);
-void load_fdsk_xinfo(ino_t netns_ino, int netns_fd);
 
 #endif /* UTIL_LINUX_LSFD_SOCK_H */