diff options
| author | Brooks Davis <brooks@FreeBSD.org> | 2003-10-31 18:32:15 +0000 |
|---|---|---|
| committer | Brooks Davis <brooks@FreeBSD.org> | 2003-10-31 18:32:15 +0000 |
| commit | 9bf40ede4a299f315bc4b0ae5329631b8c7dc271 (patch) | |
| tree | 4d9e6671d486576767506230a4240131526fea49 /sys/compat/linux | |
| parent | dc6279b887bf4473d77b898631f74466b5f7a094 (diff) | |
Notes
Diffstat (limited to 'sys/compat/linux')
| -rw-r--r-- | sys/compat/linux/linux_ioctl.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 3bb0a6d1a9d9..bc6f0d855d93 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -1881,8 +1881,7 @@ linux_ifname(struct ifnet *ifp, char *buffer, size_t buflen) /* Short-circuit non ethernet interfaces */ if (!IFP_IS_ETH(ifp)) - return (snprintf(buffer, buflen, "%s%d", ifp->if_name, - ifp->if_unit)); + return (strlcpy(buffer, ifp->if_xname, buflen)); /* Determine the (relative) unit number for ethernet interfaces */ ethno = 0; @@ -1932,15 +1931,14 @@ ifname_linux_to_bsd(const char *lxname, char *bsdname) * we never have an interface named "eth", so don't make * the test optional based on is_eth. */ - if (ifp->if_unit == unit && ifp->if_name[len] == '\0' && - strncmp(ifp->if_name, lxname, len) == 0) + if (strncmp(ifp->if_xname, lxname, LINUX_IFNAMSIZ) == 0) break; if (is_eth && IFP_IS_ETH(ifp) && unit == index++) break; } IFNET_RUNLOCK(); if (ifp != NULL) - snprintf(bsdname, IFNAMSIZ, "%s%d", ifp->if_name, ifp->if_unit); + strlcpy(bsdname, ifp->if_xname, IFNAMSIZ); return (ifp); } @@ -1988,8 +1986,7 @@ linux_ifconf(struct thread *td, struct ifconf *uifc) snprintf(ifr.ifr_name, LINUX_IFNAMSIZ, "eth%d", ethno++); else - snprintf(ifr.ifr_name, LINUX_IFNAMSIZ, "%s%d", - ifp->if_name, ifp->if_unit); + strlcpy(ifr.ifr_name, ifp->if_xname, LINUX_IFNAMSIZ); /* Walk the address list */ TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { |
