diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2002-07-10 20:21:17 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2002-07-10 20:21:17 +0000 |
commit | af55ea6d8d0faa8e558acc4948995dcc65aec1f5 (patch) | |
tree | 2dddfd14a5f29348ea6b719c4a3cdd3b41fe283d /sys | |
parent | a9d36a15300d00a032a09acbf3e23685223599ab (diff) |
use ifp->if_sadl whether possible.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/an.c | 13 | ||||
-rw-r--r-- | sys/dev/ic/if_wi.c | 12 |
2 files changed, 8 insertions, 17 deletions
diff --git a/sys/dev/ic/an.c b/sys/dev/ic/an.c index 34fc7765e51..2bcbf49b525 100644 --- a/sys/dev/ic/an.c +++ b/sys/dev/ic/an.c @@ -1,4 +1,4 @@ -/* $OpenBSD: an.c,v 1.24 2002/06/09 03:14:18 todd Exp $ */ +/* $OpenBSD: an.c,v 1.25 2002/07/10 20:21:15 fgsch Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -879,26 +879,21 @@ an_setdef(sc, areq) struct an_softc *sc; struct an_req *areq; { - struct sockaddr_dl *sdl; - struct ifaddr *ifa; struct ifnet *ifp; struct an_ltv_genconfig *cfg; struct an_ltv_ssidlist *ssid; struct an_ltv_aplist *ap; struct an_ltv_gen *sp; - extern struct ifaddr **ifnet_addrs; ifp = &sc->sc_arpcom.ac_if; switch (areq->an_type) { case AN_RID_GENCONFIG: cfg = (struct an_ltv_genconfig *)areq; - - ifa = ifnet_addrs[ifp->if_index]; - sdl = (struct sockaddr_dl *)ifa->ifa_addr; - bcopy((char *)&cfg->an_macaddr, (char *)&sc->sc_arpcom.ac_enaddr, + bcopy((char *)&cfg->an_macaddr, + (char *)&sc->sc_arpcom.ac_enaddr, ETHER_ADDR_LEN); + bcopy((char *)&cfg->an_macaddr, LLADDR(ifp->if_sadl), ETHER_ADDR_LEN); - bcopy((char *)&cfg->an_macaddr, LLADDR(sdl), ETHER_ADDR_LEN); bcopy((char *)cfg, (char *)&sc->an_config, sizeof(struct an_ltv_genconfig)); diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c index 2fa9c39a225..fecdd77aff2 100644 --- a/sys/dev/ic/if_wi.c +++ b/sys/dev/ic/if_wi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi.c,v 1.73 2002/06/24 17:59:09 fgsch Exp $ */ +/* $OpenBSD: if_wi.c,v 1.74 2002/07/10 20:21:16 fgsch Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -124,7 +124,7 @@ u_int32_t widebug = WIDEBUG; #if !defined(lint) && !defined(__OpenBSD__) static const char rcsid[] = - "$OpenBSD: if_wi.c,v 1.73 2002/06/24 17:59:09 fgsch Exp $"; + "$OpenBSD: if_wi.c,v 1.74 2002/07/10 20:21:16 fgsch Exp $"; #endif /* lint */ #ifdef foo @@ -1315,19 +1315,15 @@ wi_setdef(sc, wreq) struct wi_softc *sc; struct wi_req *wreq; { - struct sockaddr_dl *sdl; - struct ifaddr *ifa; struct ifnet *ifp; - extern struct ifaddr **ifnet_addrs; int error = 0; ifp = &sc->sc_arpcom.ac_if; switch(wreq->wi_type) { case WI_RID_MAC_NODE: - ifa = ifnet_addrs[ifp->if_index]; - sdl = (struct sockaddr_dl *)ifa->ifa_addr; - bcopy((char *)&wreq->wi_val, LLADDR(sdl), ETHER_ADDR_LEN); + bcopy((char *)&wreq->wi_val, LLADDR(ifp->if_sadl), + ETHER_ADDR_LEN); bcopy((char *)&wreq->wi_val, (char *)&sc->sc_arpcom.ac_enaddr, ETHER_ADDR_LEN); break; |