summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2004-03-13 02:31:40 +0000
committerbrooks <brooks@FreeBSD.org>2004-03-13 02:31:40 +0000
commitcb7aea29b8d913b12052d75a14a11b0ac819476c (patch)
tree181743a213c5e0bcd98374dcad08b06ccd7bdcd5
parent51a1098e943ef2673d4866a8d6a7d42df445d335 (diff)
downloadFreeBSD-src-cb7aea29b8d913b12052d75a14a11b0ac819476c.zip
FreeBSD-src-cb7aea29b8d913b12052d75a14a11b0ac819476c.tar.gz
Remove if_withname. It came in with the KAME import, but never got
used. Should someone need its functionality, it's a really expensive implementation of: ifnet_byindex(sdl->sdl_index) Reviewed by: bde, ume
-rw-r--r--sys/net/if.c26
-rw-r--r--sys/net/if_var.h1
2 files changed, 0 insertions, 27 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 1d412f9..43a8461 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1247,32 +1247,6 @@ ifunit(const char *name)
}
/*
- * Map interface name in a sockaddr_dl to
- * interface structure pointer.
- */
-struct ifnet *
-if_withname(struct sockaddr *sa)
-{
- char ifname[IFNAMSIZ+1];
- struct sockaddr_dl *sdl = (struct sockaddr_dl *)sa;
-
- if ( (sa->sa_family != AF_LINK) || (sdl->sdl_nlen == 0) ||
- (sdl->sdl_nlen > IFNAMSIZ) )
- return NULL;
-
- /*
- * ifunit wants a NUL-terminated string. It may not be NUL-terminated
- * in the sockaddr, and we don't want to change the caller's sockaddr
- * (there might not be room to add the trailing NUL anyway), so we make
- * a local copy that we know we can NUL-terminate safely.
- */
-
- bcopy(sdl->sdl_data, ifname, sdl->sdl_nlen);
- ifname[sdl->sdl_nlen] = '\0';
- return ifunit(ifname);
-}
-
-/*
* Hardware specific interface ioctls.
*/
static int
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 5ddd72b..b3d672a 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -477,7 +477,6 @@ void if_up(struct ifnet *);
int ifioctl(struct socket *, u_long, caddr_t, struct thread *);
int ifpromisc(struct ifnet *, int);
struct ifnet *ifunit(const char *);
-struct ifnet *if_withname(struct sockaddr *);
int if_poll_recv_slow(struct ifnet *ifp, int *quotap);
void if_poll_xmit_slow(struct ifnet *ifp, int *quotap);
OpenPOWER on IntegriCloud