Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156704217
D38901.id118297.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D38901.id118297.diff
View Options
diff --git a/sys/compat/linsysfs/linsysfs.c b/sys/compat/linsysfs/linsysfs.c
--- a/sys/compat/linsysfs/linsysfs.c
+++ b/sys/compat/linsysfs/linsysfs.c
@@ -273,54 +273,27 @@
static void
linsysfs_listnics(struct pfs_node *dir)
{
+ char ifname[LINUX_IFNAMSIZ];
struct pfs_node *nic;
- struct pfs_node *lo;
+ int idx = 1;
- nic = pfs_create_dir(dir, "eth0", NULL, NULL, NULL, 0);
-
- pfs_create_file(nic, "address", &linsysfs_ifnet_addr,
- NULL, NULL, NULL, PFS_RD);
-
- pfs_create_file(nic, "addr_len", &linsysfs_ifnet_addrlen,
- NULL, NULL, NULL, PFS_RD);
-
- pfs_create_file(nic, "flags", &linsysfs_ifnet_flags,
- NULL, NULL, NULL, PFS_RD);
-
- pfs_create_file(nic, "ifindex", &linsysfs_ifnet_ifindex,
- NULL, NULL, NULL, PFS_RD);
-
- pfs_create_file(nic, "mtu", &linsysfs_ifnet_mtu,
- NULL, NULL, NULL, PFS_RD);
-
- pfs_create_file(nic, "tx_queue_len", &linsysfs_ifnet_tx_queue_len,
- NULL, NULL, NULL, PFS_RD);
-
- pfs_create_file(nic, "type", &linsysfs_ifnet_type,
- NULL, NULL, NULL, PFS_RD);
-
- lo = pfs_create_dir(dir, "lo", NULL, NULL, NULL, 0);
-
- pfs_create_file(lo, "address", &linsysfs_ifnet_addr,
- NULL, NULL, NULL, PFS_RD);
-
- pfs_create_file(lo, "addr_len", &linsysfs_ifnet_addrlen,
- NULL, NULL, NULL, PFS_RD);
-
- pfs_create_file(lo, "flags", &linsysfs_ifnet_flags,
- NULL, NULL, NULL, PFS_RD);
-
- pfs_create_file(lo, "ifindex", &linsysfs_ifnet_ifindex,
- NULL, NULL, NULL, PFS_RD);
-
- pfs_create_file(lo, "mtu", &linsysfs_ifnet_mtu,
- NULL, NULL, NULL, PFS_RD);
-
- pfs_create_file(lo, "tx_queue_len", &linsysfs_ifnet_tx_queue_len,
- NULL, NULL, NULL, PFS_RD);
-
- pfs_create_file(lo, "type", &linsysfs_ifnet_type,
- NULL, NULL, NULL, PFS_RD);
+ while (ifname_bsd_to_linux_idx(idx++, ifname, sizeof(ifname)) > 0) {
+ nic = pfs_create_dir(dir, ifname, NULL, NULL, NULL, 0);
+ pfs_create_file(nic, "address", &linsysfs_ifnet_addr,
+ NULL, NULL, NULL, PFS_RD);
+ pfs_create_file(nic, "addr_len", &linsysfs_ifnet_addrlen,
+ NULL, NULL, NULL, PFS_RD);
+ pfs_create_file(nic, "flags", &linsysfs_ifnet_flags,
+ NULL, NULL, NULL, PFS_RD);
+ pfs_create_file(nic, "ifindex", &linsysfs_ifnet_ifindex,
+ NULL, NULL, NULL, PFS_RD);
+ pfs_create_file(nic, "mtu", &linsysfs_ifnet_mtu,
+ NULL, NULL, NULL, PFS_RD);
+ pfs_create_file(nic, "tx_queue_len", &linsysfs_ifnet_tx_queue_len,
+ NULL, NULL, NULL, PFS_RD);
+ pfs_create_file(nic, "type", &linsysfs_ifnet_type,
+ NULL, NULL, NULL, PFS_RD);
+ }
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, May 16, 7:20 PM (21 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33147324
Default Alt Text
D38901.id118297.diff (2 KB)
Attached To
Mode
D38901: linsysfs(4): Make listnics use new if_foreach_sleep method
Attached
Detach File
Event Timeline
Log In to Comment