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
This commit is contained in:
Brooks Davis 2004-03-13 02:31:40 +00:00
parent ce5d505cc6
commit 196f7f54d2
2 changed files with 0 additions and 27 deletions

View File

@ -1246,32 +1246,6 @@ ifunit(const char *name)
return (ifp);
}
/*
* 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.
*/

View File

@ -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);