diff options
| author | dyoung <dyoung@NetBSD.org> | 2007-08-26 22:45:55 +0000 |
|---|---|---|
| committer | dyoung <dyoung@NetBSD.org> | 2007-08-26 22:45:55 +0000 |
| commit | 71e77a61b4d5bacea330af7dfd691c6d12988b95 (patch) | |
| tree | 3122d844b6aa118b7274f28b7e4388c08ac0ac3e /sys/dev/ic | |
| parent | f004b71d982577c719d4342c2e0d053881dd7dc6 (diff) | |
Constify: LLADDR -> CLLADDR. I'm aiming here to make it easier to
identify sockaddr_dl abuse that remains in the kernel, especially
the potential for overwriting memory past the end of a sockaddr_dl
with, e.g., memcpy(LLADDR(), ...).
Diffstat (limited to 'sys/dev/ic')
| -rw-r--r-- | sys/dev/ic/awi.c | 8 | ||||
| -rw-r--r-- | sys/dev/ic/dp8390.c | 6 | ||||
| -rw-r--r-- | sys/dev/ic/dp83932.c | 6 | ||||
| -rw-r--r-- | sys/dev/ic/elinkxl.c | 6 | ||||
| -rw-r--r-- | sys/dev/ic/gem.c | 6 | ||||
| -rw-r--r-- | sys/dev/ic/i82557.c | 6 | ||||
| -rw-r--r-- | sys/dev/ic/i82596.c | 6 | ||||
| -rw-r--r-- | sys/dev/ic/rt2560.c | 6 | ||||
| -rw-r--r-- | sys/dev/ic/rt2661.c | 6 | ||||
| -rw-r--r-- | sys/dev/ic/rtl81x9.c | 6 | ||||
| -rw-r--r-- | sys/dev/ic/seeq8005.c | 8 | ||||
| -rw-r--r-- | sys/dev/ic/tulip.c | 10 |
12 files changed, 40 insertions, 40 deletions
diff --git a/sys/dev/ic/awi.c b/sys/dev/ic/awi.c index 6558264270f..e47befdc2ff 100644 --- a/sys/dev/ic/awi.c +++ b/sys/dev/ic/awi.c @@ -1,4 +1,4 @@ -/* $NetBSD: awi.c,v 1.74 2007/03/04 06:01:51 christos Exp $ */ +/* $NetBSD: awi.c,v 1.75 2007/08/26 22:45:55 dyoung Exp $ */ /*- * Copyright (c) 1999,2000,2001 The NetBSD Foundation, Inc. @@ -86,7 +86,7 @@ #include <sys/cdefs.h> #ifdef __NetBSD__ -__KERNEL_RCSID(0, "$NetBSD: awi.c,v 1.74 2007/03/04 06:01:51 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awi.c,v 1.75 2007/08/26 22:45:55 dyoung Exp $"); #endif #ifdef __FreeBSD__ __FBSDID("$FreeBSD: src/sys/dev/awi/awi.c,v 1.30 2004/01/15 13:30:06 onoe Exp $"); @@ -590,7 +590,7 @@ awi_init(struct ifnet *ifp) return ENODEV; } #if 0 - IEEE80211_ADDR_COPY(ic->ic_myaddr, LLADDR(ifp->if_sadl)); + IEEE80211_ADDR_COPY(ic->ic_myaddr, CLLADDR(ifp->if_sadl)); #endif memset(&sc->sc_mib_mac.aDesired_ESS_ID, 0, AWI_ESS_ID_SIZE); sc->sc_mib_mac.aDesired_ESS_ID[0] = IEEE80211_ELEMID_SSID; @@ -1135,7 +1135,7 @@ awi_mode_init(struct awi_softc *sc) if (n == AWI_GROUP_ADDR_SIZE) goto set_mib; IEEE80211_ADDR_COPY(sc->sc_mib_addr.aGroup_Addresses[n], - LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); + CLLADDR(satocsdl(ifma->ifma_addr))); n++; } #else diff --git a/sys/dev/ic/dp8390.c b/sys/dev/ic/dp8390.c index 855b5cbc7bd..78294e6d28c 100644 --- a/sys/dev/ic/dp8390.c +++ b/sys/dev/ic/dp8390.c @@ -1,4 +1,4 @@ -/* $NetBSD: dp8390.c,v 1.63 2007/03/04 06:01:54 christos Exp $ */ +/* $NetBSD: dp8390.c,v 1.64 2007/08/26 22:45:55 dyoung Exp $ */ /* * Device driver for National Semiconductor DS8390/WD83C690 based ethernet @@ -14,7 +14,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.63 2007/03/04 06:01:54 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.64 2007/08/26 22:45:55 dyoung Exp $"); #include "opt_ipkdb.h" #include "opt_inet.h" @@ -350,7 +350,7 @@ dp8390_init(sc) /* Copy out our station address. */ for (i = 0; i < ETHER_ADDR_LEN; ++i) NIC_PUT(regt, regh, ED_P1_PAR0 + i, - LLADDR(ifp->if_sadl)[i]); + CLLADDR(ifp->if_sadl)[i]); /* Set multicast filter on chip. */ dp8390_getmcaf(&sc->sc_ec, mcaf); diff --git a/sys/dev/ic/dp83932.c b/sys/dev/ic/dp83932.c index f6b13469814..b3754652c47 100644 --- a/sys/dev/ic/dp83932.c +++ b/sys/dev/ic/dp83932.c @@ -1,4 +1,4 @@ -/* $NetBSD: dp83932.c,v 1.17 2007/06/08 17:08:46 tsutsui Exp $ */ +/* $NetBSD: dp83932.c,v 1.18 2007/08/26 22:45:55 dyoung Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.17 2007/06/08 17:08:46 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.18 2007/08/26 22:45:55 dyoung Exp $"); #include "bpfilter.h" @@ -1194,7 +1194,7 @@ sonic_set_filter(struct sonic_softc *sc) } /* Put our station address in the first CAM slot. */ - sonic_set_camentry(sc, entry, LLADDR(ifp->if_sadl)); + sonic_set_camentry(sc, entry, CLLADDR(ifp->if_sadl)); camvalid |= (1U << entry); entry++; diff --git a/sys/dev/ic/elinkxl.c b/sys/dev/ic/elinkxl.c index 55705612245..0c1268c630c 100644 --- a/sys/dev/ic/elinkxl.c +++ b/sys/dev/ic/elinkxl.c @@ -1,4 +1,4 @@ -/* $NetBSD: elinkxl.c,v 1.97 2007/07/09 21:00:35 ad Exp $ */ +/* $NetBSD: elinkxl.c,v 1.98 2007/08/26 22:45:55 dyoung Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.97 2007/07/09 21:00:35 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.98 2007/08/26 22:45:55 dyoung Exp $"); #include "bpfilter.h" #include "rnd.h" @@ -677,7 +677,7 @@ ex_init(ifp) */ for (i = 0; i < ETHER_ADDR_LEN; i++) { bus_space_write_1(iot, ioh, ELINK_W2_ADDR_0 + i, - LLADDR(ifp->if_sadl)[i]); + CLLADDR(ifp->if_sadl)[i]); bus_space_write_1(iot, ioh, ELINK_W2_RECVMASK_0 + i, 0); } diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c index a1522933b12..dbd21dd405e 100644 --- a/sys/dev/ic/gem.c +++ b/sys/dev/ic/gem.c @@ -1,4 +1,4 @@ -/* $NetBSD: gem.c,v 1.57 2007/07/09 21:00:35 ad Exp $ */ +/* $NetBSD: gem.c,v 1.58 2007/08/26 22:45:56 dyoung Exp $ */ /* * @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.57 2007/07/09 21:00:35 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.58 2007/08/26 22:45:56 dyoung Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -929,7 +929,7 @@ gem_init_regs(struct gem_softc *sc) struct ifnet *ifp = &sc->sc_ethercom.ec_if; bus_space_tag_t t = sc->sc_bustag; bus_space_handle_t h = sc->sc_h1; - const u_char *laddr = LLADDR(ifp->if_sadl); + const u_char *laddr = CLLADDR(ifp->if_sadl); u_int32_t v; /* These regs are not cleared on reset */ diff --git a/sys/dev/ic/i82557.c b/sys/dev/ic/i82557.c index 9e0a24c8c3a..bdd19fa69d5 100644 --- a/sys/dev/ic/i82557.c +++ b/sys/dev/ic/i82557.c @@ -1,4 +1,4 @@ -/* $NetBSD: i82557.c,v 1.102 2007/07/09 21:00:36 ad Exp $ */ +/* $NetBSD: i82557.c,v 1.103 2007/08/26 22:45:56 dyoung Exp $ */ /*- * Copyright (c) 1997, 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc. @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.102 2007/07/09 21:00:36 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.103 2007/08/26 22:45:56 dyoung Exp $"); #include "bpfilter.h" #include "rnd.h" @@ -1840,7 +1840,7 @@ fxp_init(struct ifnet *ifp) cb_ias->cb_command = htole16(FXP_CB_COMMAND_IAS | FXP_CB_COMMAND_EL); /* BIG_ENDIAN: no need to swap to store 0xffffffff */ cb_ias->link_addr = 0xffffffff; - memcpy(cb_ias->macaddr, LLADDR(ifp->if_sadl), ETHER_ADDR_LEN); + memcpy(cb_ias->macaddr, CLLADDR(ifp->if_sadl), ETHER_ADDR_LEN); FXP_CDIASSYNC(sc, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); diff --git a/sys/dev/ic/i82596.c b/sys/dev/ic/i82596.c index a831cceec7a..36b1db1cdbf 100644 --- a/sys/dev/ic/i82596.c +++ b/sys/dev/ic/i82596.c @@ -1,4 +1,4 @@ -/* $NetBSD: i82596.c,v 1.16 2007/04/17 14:12:06 skrll Exp $ */ +/* $NetBSD: i82596.c,v 1.17 2007/08/26 22:45:56 dyoung Exp $ */ /* * Copyright (c) 2003 Jochen Kunz. @@ -43,7 +43,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.16 2007/04/17 14:12:06 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.17 2007/08/26 22:45:56 dyoung Exp $"); /* autoconfig and device stuff */ #include <sys/param.h> @@ -420,7 +420,7 @@ iee_cb_setup(struct iee_softc *sc, uint32_t cmd) case IEE_CB_CMD_NOP: /* NOP CMD */ break; case IEE_CB_CMD_IAS: /* Individual Address Setup */ - memcpy(__UNVOLATILE(cb->cb_ind_addr), LLADDR(ifp->if_sadl), + memcpy(__UNVOLATILE(cb->cb_ind_addr), CLLADDR(ifp->if_sadl), ETHER_ADDR_LEN); break; case IEE_CB_CMD_CONF: /* Configure */ diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c index 514562961aa..c755c4559bf 100644 --- a/sys/dev/ic/rt2560.c +++ b/sys/dev/ic/rt2560.c @@ -1,4 +1,4 @@ -/* $NetBSD: rt2560.c,v 1.9 2007/07/09 21:00:38 ad Exp $ */ +/* $NetBSD: rt2560.c,v 1.10 2007/08/26 22:45:56 dyoung Exp $ */ /* $OpenBSD: rt2560.c,v 1.15 2006/04/20 20:31:12 miod Exp $ */ /* $FreeBSD: rt2560.c,v 1.3 2006/03/21 21:15:43 damien Exp $*/ @@ -24,7 +24,7 @@ * http://www.ralinktech.com/ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rt2560.c,v 1.9 2007/07/09 21:00:38 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rt2560.c,v 1.10 2007/08/26 22:45:56 dyoung Exp $"); #include "bpfilter.h" @@ -2857,7 +2857,7 @@ rt2560_init(struct ifnet *ifp) for (i = 0; i < N(rt2560_def_mac); i++) RAL_WRITE(sc, rt2560_def_mac[i].reg, rt2560_def_mac[i].val); - IEEE80211_ADDR_COPY(ic->ic_myaddr, LLADDR(ifp->if_sadl)); + IEEE80211_ADDR_COPY(ic->ic_myaddr, CLLADDR(ifp->if_sadl)); rt2560_set_macaddr(sc, ic->ic_myaddr); /* set basic rate set (will be updated later) */ diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c index 0d580277b21..810189f348b 100644 --- a/sys/dev/ic/rt2661.c +++ b/sys/dev/ic/rt2661.c @@ -1,4 +1,4 @@ -/* $NetBSD: rt2661.c,v 1.15 2007/07/09 21:00:38 ad Exp $ */ +/* $NetBSD: rt2661.c,v 1.16 2007/08/26 22:45:56 dyoung Exp $ */ /* $OpenBSD: rt2661.c,v 1.17 2006/05/01 08:41:11 damien Exp $ */ /* $FreeBSD: rt2560.c,v 1.5 2006/06/02 19:59:31 csjp Exp $ */ @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rt2661.c,v 1.15 2007/07/09 21:00:38 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rt2661.c,v 1.16 2007/08/26 22:45:56 dyoung Exp $"); #include "bpfilter.h" @@ -2745,7 +2745,7 @@ rt2661_init(struct ifnet *ifp) for (i = 0; i < N(rt2661_def_mac); i++) RAL_WRITE(sc, rt2661_def_mac[i].reg, rt2661_def_mac[i].val); - IEEE80211_ADDR_COPY(ic->ic_myaddr, LLADDR(ifp->if_sadl)); + IEEE80211_ADDR_COPY(ic->ic_myaddr, CLLADDR(ifp->if_sadl)); rt2661_set_macaddr(sc, ic->ic_myaddr); /* set host ready */ diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c index 9c0b9c2a7e7..42e09138c3d 100644 --- a/sys/dev/ic/rtl81x9.c +++ b/sys/dev/ic/rtl81x9.c @@ -1,4 +1,4 @@ -/* $NetBSD: rtl81x9.c,v 1.75 2007/07/09 21:00:38 ad Exp $ */ +/* $NetBSD: rtl81x9.c,v 1.76 2007/08/26 22:45:56 dyoung Exp $ */ /* * Copyright (c) 1997, 1998 @@ -86,7 +86,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.75 2007/07/09 21:00:38 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.76 2007/08/26 22:45:56 dyoung Exp $"); #include "bpfilter.h" #include "rnd.h" @@ -1420,7 +1420,7 @@ rtk_init(struct ifnet *ifp) /* Init our MAC address */ for (i = 0; i < ETHER_ADDR_LEN; i++) { - CSR_WRITE_1(sc, RTK_IDR0 + i, LLADDR(ifp->if_sadl)[i]); + CSR_WRITE_1(sc, RTK_IDR0 + i, CLLADDR(ifp->if_sadl)[i]); } /* Init the RX buffer pointer register. */ diff --git a/sys/dev/ic/seeq8005.c b/sys/dev/ic/seeq8005.c index 9b91efda952..8edb53097fd 100644 --- a/sys/dev/ic/seeq8005.c +++ b/sys/dev/ic/seeq8005.c @@ -1,4 +1,4 @@ -/* $NetBSD: seeq8005.c,v 1.40 2007/03/05 17:47:49 he Exp $ */ +/* $NetBSD: seeq8005.c,v 1.41 2007/08/26 22:45:56 dyoung Exp $ */ /* * Copyright (c) 2000, 2001 Ben Harris @@ -61,7 +61,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: seeq8005.c,v 1.40 2007/03/05 17:47:49 he Exp $"); +__KERNEL_RCSID(0, "$NetBSD: seeq8005.c,v 1.41 2007/08/26 22:45:56 dyoung Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -724,7 +724,7 @@ ea_select_buffer(struct seeq8005_softc *sc, int bufcode) /* Must be called at splnet */ static void -ea_set_address(struct seeq8005_softc *sc, int which, u_int8_t const *ea) +ea_set_address(struct seeq8005_softc *sc, int which, const u_int8_t *ea) { int i; @@ -777,7 +777,7 @@ ea_init(struct ifnet *ifp) } /* Write the station address - the receiver must be off */ - ea_set_address(sc, 0, (u_int8_t *)LLADDR(ifp->if_sadl)); + ea_set_address(sc, 0, (const u_int8_t *)CLLADDR(ifp->if_sadl)); /* Split board memory into Rx and Tx. */ ea_select_buffer(sc, SEEQ_BUFCODE_TX_EAP); diff --git a/sys/dev/ic/tulip.c b/sys/dev/ic/tulip.c index a0b29ab9731..25d28c7c761 100644 --- a/sys/dev/ic/tulip.c +++ b/sys/dev/ic/tulip.c @@ -1,4 +1,4 @@ -/* $NetBSD: tulip.c,v 1.150 2007/07/09 21:00:40 ad Exp $ */ +/* $NetBSD: tulip.c,v 1.151 2007/08/26 22:45:56 dyoung Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.150 2007/07/09 21:00:40 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.151 2007/08/26 22:45:56 dyoung Exp $"); #include "bpfilter.h" @@ -1427,7 +1427,7 @@ tlp_rxintr(struct tulip_softc *sc) if (sc->sc_filtmode == TDCTL_Tx_FT_HASHONLY && (ifp->if_flags & IFF_PROMISC) == 0 && ETHER_IS_MULTICAST(eh->ether_dhost) == 0 && - memcmp(LLADDR(ifp->if_sadl), eh->ether_dhost, + memcmp(CLLADDR(ifp->if_sadl), eh->ether_dhost, ETHER_ADDR_LEN) != 0) { m_freem(m); continue; @@ -1913,7 +1913,7 @@ tlp_init(struct ifnet *ifp) for (i = 0; i < ETHER_ADDR_LEN; i++) { bus_space_write_1(sc->sc_st, sc->sc_sh, - cpa + i, LLADDR(ifp->if_sadl)[i]); + cpa + i, CLLADDR(ifp->if_sadl)[i]); } break; } @@ -2643,7 +2643,7 @@ tlp_filter_setup(struct tulip_softc *sc) DPRINTF(sc, ("%s: tlp_filter_setup: sc_flags 0x%08x\n", sc->sc_dev.dv_xname, sc->sc_flags)); - memcpy(enaddr, LLADDR(ifp->if_sadl), ETHER_ADDR_LEN); + memcpy(enaddr, CLLADDR(ifp->if_sadl), ETHER_ADDR_LEN); /* * If there are transmissions pending, wait until they have |
