From: itojun Date: Wed, 22 Mar 2000 11:28:42 +0000 (+0000) Subject: remove if_withname(), which was imported during KAME merge by mistake. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=e04bff525c8337cf6e69de251cbb548740f12830;p=openbsd remove if_withname(), which was imported during KAME merge by mistake. --- diff --git a/sys/net/if.c b/sys/net/if.c index f1e8c498d04..49fafcc6d7d 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.29 2000/03/21 23:31:26 mickey Exp $ */ +/* $OpenBSD: if.c,v 1.30 2000/03/22 11:28:42 itojun Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -632,35 +632,6 @@ ifunit(name) return (NULL); } - -/* - * Map interface name in a sockaddr_dl to - * interface structure pointer. - */ -struct ifnet * -if_withname(sa) - 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 null-terminated name. It may not be null-terminated - * in the sockaddr. We don't want to change the caller's sockaddr, - * and there might not be room to put the trailing null anyway, so we - * make a local copy that we know we can null terminate safely. - */ - - bcopy(sdl->sdl_data, ifname, sdl->sdl_nlen); - ifname[sdl->sdl_nlen] = '\0'; - return ifunit(ifname); -} - - /* * Interface ioctls. */ diff --git a/sys/net/if.h b/sys/net/if.h index 9aac27e49e8..f9ec5377e43 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if.h,v 1.16 2000/03/21 23:31:26 mickey Exp $ */ +/* $OpenBSD: if.h,v 1.17 2000/03/22 11:28:42 itojun Exp $ */ /* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */ /* @@ -413,7 +413,6 @@ void ifinit __P((void)); int ifioctl __P((struct socket *, u_long, caddr_t, struct proc *)); int ifpromisc __P((struct ifnet *, int)); struct ifnet *ifunit __P((char *)); -struct ifnet *if_withname __P((struct sockaddr *)); struct ifaddr *ifa_ifwithaddr __P((struct sockaddr *)); struct ifaddr *ifa_ifwithaf __P((int));