X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/7b1edb791d9ca667b95988cb5638c4c88416cd17..cf03f5cdc65293b4cb5eba3ed23fed26dad903c9:/bsd/net/if_ethersubr.c diff --git a/bsd/net/if_ethersubr.c b/bsd/net/if_ethersubr.c index 7547d9608..7e6c57d76 100644 --- a/bsd/net/if_ethersubr.c +++ b/bsd/net/if_ethersubr.c @@ -3,19 +3,22 @@ * * @APPLE_LICENSE_HEADER_START@ * - * The contents of this file constitute Original Code as defined in and - * are subject to the Apple Public Source License Version 1.1 (the - * "License"). You may not use this file except in compliance with the - * License. Please obtain a copy of the License at - * http://www.apple.com/publicsource and read it before using this file. + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. * - * This Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. * * @APPLE_LICENSE_HEADER_END@ */ @@ -52,15 +55,9 @@ * SUCH DAMAGE. * * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/net/if_ethersubr.c,v 1.70.2.17 2001/08/01 00:47:49 fenner Exp $ */ -#if NOTFB31 -#include "opt_atalk.h" -#include "opt_inet.h" -#include "opt_ipx.h" -#include "opt_bdg.h" -#endif - #include #include #include @@ -77,7 +74,7 @@ #include #include -#if INET +#if INET || INET6 #include #include #include @@ -90,26 +87,6 @@ #include #endif -#if NS -#include -#include -ushort ns_nettype; -int ether_outputdebug = 0; -int ether_inputdebug = 0; -#endif - -#if ISO -#include -#include -#include -#include -#endif - -/*#if LLC -#include -#include -#endif*/ - #include #if LLC && CCITT @@ -136,17 +113,18 @@ extern u_char etherbroadcastaddr[]; */ +/* + IONetworkingFamily should call dlil_if_attach + ether_ifattach becomes obsolete, but remains for + temporary compatibility with third parties extensions +*/ void ether_ifattach(ifp) register struct ifnet *ifp; { - register struct ifaddr *ifa; - register struct sockaddr_dl *sdl; boolean_t funnel_state; funnel_state = thread_funnel_set(network_flock, TRUE); - printf("ether_ifattach called for %s\n", ifp->if_name); - ether_family_init(); ifp->if_name = "en"; ifp->if_family = APPLE_IF_FAM_ETHERNET; @@ -159,19 +137,6 @@ ether_ifattach(ifp) ifp->if_baudrate = 10000000; dlil_if_attach(ifp); - ifa = ifnet_addrs[ifp->if_index - 1]; - if (ifa == 0) { - printf("ether_ifattach: no lladdr!\n"); - (void) thread_funnel_set(network_flock, funnel_state); - return; - } - sdl = (struct sockaddr_dl *)ifa->ifa_addr; - sdl->sdl_type = IFT_ETHER; - sdl->sdl_alen = ifp->if_addrlen; - bcopy((IFP2AC(ifp))->ac_enaddr, LLADDR(sdl), ifp->if_addrlen); -#ifdef INET6 - in6_ifattach_getifid(ifp); -#endif (void) thread_funnel_set(network_flock, funnel_state); }