Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net remove if_withname, which was merged in by mistake d...



details:   https://anonhg.NetBSD.org/src/rev/3f46bd2c498f
branches:  trunk
changeset: 483984:3f46bd2c498f
user:      itojun <itojun%NetBSD.org@localhost>
date:      Wed Mar 22 11:34:15 2000 +0000

description:
remove if_withname, which was merged in by mistake during KAME merge.

diffstat:

 sys/net/if.c |  31 +------------------------------
 sys/net/if.h |   3 +--
 2 files changed, 2 insertions(+), 32 deletions(-)

diffs (62 lines):

diff -r 4f9a9581f730 -r 3f46bd2c498f sys/net/if.c
--- a/sys/net/if.c      Wed Mar 22 11:24:59 2000 +0000
+++ b/sys/net/if.c      Wed Mar 22 11:34:15 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.57 2000/03/06 20:49:00 thorpej Exp $  */
+/*     $NetBSD: if.c,v 1.58 2000/03/22 11:34:15 itojun Exp $   */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -834,35 +834,6 @@
        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 -r 4f9a9581f730 -r 3f46bd2c498f sys/net/if.h
--- a/sys/net/if.h      Wed Mar 22 11:24:59 2000 +0000
+++ b/sys/net/if.h      Wed Mar 22 11:34:15 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.h,v 1.46 2000/03/06 20:49:00 thorpej Exp $  */
+/*     $NetBSD: if.h,v 1.47 2000/03/22 11:34:15 itojun Exp $   */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -570,7 +570,6 @@
 int    ifioctl __P((struct socket *, u_long, caddr_t, struct proc *));
 int    ifpromisc __P((struct ifnet *, int));
 struct ifnet *ifunit __P((const char *));
-struct  ifnet *if_withname __P((struct sockaddr *));
 
 struct ifaddr *ifa_ifwithaddr __P((struct sockaddr *));
 struct ifaddr *ifa_ifwithaf __P((int));



Home | Main Index | Thread Index | Old Index