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:
parent
ce5d505cc6
commit
196f7f54d2
26
sys/net/if.c
26
sys/net/if.c
@ -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.
|
||||
*/
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user