diff options
author | Cy Schubert <cy@FreeBSD.org> | 2020-12-03 05:56:42 +0000 |
---|---|---|
committer | Cy Schubert <cy@FreeBSD.org> | 2020-12-03 05:56:42 +0000 |
commit | 9a584be27a15ef0c7bfea70b734f43f55643c2f9 (patch) | |
tree | 4bc5e0db1edd968515b2072b031381de0974fb49 | |
parent | 60372f58be909dc2d50927225b98dafcf8d687ef (diff) | |
download | src-test-9a584be27a15ef0c7bfea70b734f43f55643c2f9.tar.gz src-test-9a584be27a15ef0c7bfea70b734f43f55643c2f9.zip |
MFC r366286:
ipfilter getifname ifdef cleanup.
Notes
Notes:
svn path=/stable/11/; revision=368295
-rw-r--r-- | contrib/ipfilter/lib/getifname.c | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/contrib/ipfilter/lib/getifname.c b/contrib/ipfilter/lib/getifname.c index 44b4f8b538992..518950acd1a21 100644 --- a/contrib/ipfilter/lib/getifname.c +++ b/contrib/ipfilter/lib/getifname.c @@ -19,11 +19,9 @@ char *getifname(ptr) struct ifnet *ptr; { -#if SOLARIS || defined(__hpux) -# if SOLARIS +#if SOLARIS # include <sys/mutex.h> # include <sys/condvar.h> -# endif # include "../pfil/qif.h" char *ifname; qif_t qif; @@ -42,13 +40,6 @@ char *getifname(ptr) } return ifname; #else -# if defined(NetBSD) && (NetBSD >= 199905) && (NetBSD < 1991011) || \ - defined(__OpenBSD__) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 501113)) -#else - char buf[LIFNAMSIZ]; - int len; -# endif struct ifnet netif; if ((void *)ptr == (void *)-1) @@ -58,24 +49,6 @@ char *getifname(ptr) if (kmemcpy((char *)&netif, (u_long)ptr, sizeof(netif)) == -1) return "X"; -# if defined(NetBSD) && (NetBSD >= 199905) && (NetBSD < 1991011) || \ - defined(__OpenBSD__) || defined(linux) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 501113)) return strdup(netif.if_xname); -# else - if (kstrncpy(buf, (u_long)netif.if_name, sizeof(buf)) == -1) - return "X"; - if (netif.if_unit < 10) - len = 2; - else if (netif.if_unit < 1000) - len = 3; - else if (netif.if_unit < 10000) - len = 4; - else - len = 5; - buf[sizeof(buf) - len] = '\0'; - sprintf(buf + strlen(buf), "%d", netif.if_unit % 10000); - return strdup(buf); -# endif #endif } |