diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2002-06-30 13:04:37 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2002-06-30 13:04:37 +0000 |
commit | 4239d6781953c558ebf4fa2010ff23f4630ad217 (patch) | |
tree | d710661406931ea40c38847efa1b70a1495afa74 /sys/net/if_atmsubr.c | |
parent | fd0bfbacd2b21eb3bf2543307b763fe112b060aa (diff) |
allocate sockaddr_dl for ifnet in if_alloc_sadl(), as we don't always know
the size of sockaddr_dl on if_attach() - for instance, see ether_ifattach().
from netbsd. fgs ok
Diffstat (limited to 'sys/net/if_atmsubr.c')
-rw-r--r-- | sys/net/if_atmsubr.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/sys/net/if_atmsubr.c b/sys/net/if_atmsubr.c index 6252e1d84c2..ae0a151bd19 100644 --- a/sys/net/if_atmsubr.c +++ b/sys/net/if_atmsubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_atmsubr.c,v 1.18 2001/12/18 23:07:49 deraadt Exp $ */ +/* $OpenBSD: if_atmsubr.c,v 1.19 2002/06/30 13:04:35 itojun Exp $ */ /* * @@ -386,20 +386,8 @@ atm_ifattach(ifp) ifp->if_mtu = ATMMTU; ifp->if_output = atm_output; -#if defined(__NetBSD__) || defined(__OpenBSD__) - TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) { -#elif defined(__FreeBSD__) || defined(__bsdi__) - for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) { -#endif - - if ((sdl = (struct sockaddr_dl *)ifa->ifa_addr) && - sdl->sdl_family == AF_LINK) { - sdl->sdl_type = IFT_ATM; - sdl->sdl_alen = ifp->if_addrlen; + if_alloc_sadl(ifp); #ifdef notyet /* if using ATMARP, store hardware address using the next line */ - bcopy(ifp->hw_addr, LLADDR(sdl), ifp->if_addrlen); + bcopy(ifp->hw_addr, LLADDR(ifp->if_sadl), ifp->if_addrlen); #endif - break; - } - } } |