aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linprocfs/linprocfs.c
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2022-01-08 15:41:53 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2022-03-28 08:49:23 +0000
commitc7655e1f3671a9ce7d963cb577b4548173469053 (patch)
tree794bc0576b3692e88d02d7bc14f95947aad61ea7 /sys/compat/linprocfs/linprocfs.c
parent0b6161db7eff92a37bc6d410ff9c9d5c3ac6f443 (diff)
linux: add sysctl to pass untranslated interface names
Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D33792 (cherry picked from commit 1f70a85b4cbc3ad19cec4a390e8754e54815be85)
Diffstat (limited to 'sys/compat/linprocfs/linprocfs.c')
-rw-r--r--sys/compat/linprocfs/linprocfs.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index a363644da744..27acd7d651a7 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -1414,11 +1414,6 @@ linprocfs_doprocmem(PFS_FILL_ARGS)
return (error);
}
-/*
- * Criteria for interface name translation
- */
-#define IFP_IS_ETH(ifp) (ifp->if_type == IFT_ETHER)
-
static int
linux_ifname(struct ifnet *ifp, char *buffer, size_t buflen)
{
@@ -1428,7 +1423,7 @@ linux_ifname(struct ifnet *ifp, char *buffer, size_t buflen)
IFNET_RLOCK_ASSERT();
/* Short-circuit non ethernet interfaces */
- if (!IFP_IS_ETH(ifp))
+ if (linux_use_real_ifname(ifp))
return (strlcpy(buffer, ifp->if_xname, buflen));
/* Determine the (relative) unit number for ethernet interfaces */
@@ -1436,7 +1431,7 @@ linux_ifname(struct ifnet *ifp, char *buffer, size_t buflen)
CK_STAILQ_FOREACH(ifscan, &V_ifnet, if_link) {
if (ifscan == ifp)
return (snprintf(buffer, buflen, "eth%d", ethno));
- if (IFP_IS_ETH(ifscan))
+ if (!linux_use_real_ifname(ifscan))
ethno++;
}