From 5c7fed39bd376c774afa6b5ea3c41fd50de48416 Mon Sep 17 00:00:00 2001 From: dlg Date: Thu, 25 Feb 2021 02:48:19 +0000 Subject: [PATCH] we don't have to cast to caddr_t when calling m_copydata anymore. the first cut of this diff was made with coccinelle using this spatch: @rule@ type caddr_t; expression m, off, len, cp; @@ -m_copydata(m, off, len, (caddr_t)cp) +m_copydata(m, off, len, cp) i had fix it's opinionated idea of formatting by hand though, so i'm not sure it was worth it. ok deraadt@ bluhm@ --- sys/arch/armv7/sunxi/sxie.c | 4 ++-- sys/arch/octeon/dev/octcrypto.c | 10 ++++------ sys/dev/ic/acx.c | 8 ++++---- sys/dev/ic/an.c | 6 +++--- sys/dev/ic/if_wi.c | 11 +++++------ sys/dev/pci/if_bwfm_pci.c | 4 ++-- sys/dev/pci/if_mcx.c | 6 +++--- sys/dev/pci/safe.c | 4 ++-- sys/dev/pci/ubsec.c | 4 ++-- sys/dev/usb/if_athn_usb.c | 6 +++--- sys/dev/usb/if_otus.c | 4 ++-- sys/dev/usb/if_rsu.c | 4 ++-- sys/dev/usb/if_uath.c | 8 ++++---- sys/dev/usb/if_urtw.c | 6 +++--- sys/net/bridgectl.c | 4 ++-- sys/net/if_bridge.c | 25 ++++++++++--------------- sys/net/if_pfsync.c | 4 ++-- sys/net/if_pppx.c | 4 ++-- sys/net/if_switch.c | 8 ++++---- sys/net/if_vlan.c | 4 ++-- sys/net/if_vxlan.c | 4 ++-- sys/net/pipex.c | 20 ++++++++++---------- sys/net/rtsock.c | 4 ++-- sys/net/switchofp.c | 10 +++++----- sys/netinet/ip_ah.c | 20 +++++++++----------- sys/netinet/ip_esp.c | 8 ++++---- sys/netinet/ip_icmp.c | 4 ++-- sys/netinet/tcp_subr.c | 4 ++-- sys/netinet6/ip6_input.c | 18 +++++++++--------- 29 files changed, 108 insertions(+), 118 deletions(-) diff --git a/sys/arch/armv7/sunxi/sxie.c b/sys/arch/armv7/sunxi/sxie.c index a8850cba930..145545d3031 100644 --- a/sys/arch/armv7/sunxi/sxie.c +++ b/sys/arch/armv7/sunxi/sxie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sxie.c,v 1.29 2020/07/10 13:26:36 patrick Exp $ */ +/* $OpenBSD: sxie.c,v 1.30 2021/02/25 02:48:19 dlg Exp $ */ /* * Copyright (c) 2012-2013 Patrick Wildt * Copyright (c) 2013 Artturi Alm @@ -524,7 +524,7 @@ sxie_start(struct ifnet *ifp) SXIWRITE4(sc, SXIE_TXPKTLEN0 + (fifo * 4), m->m_pkthdr.len); /* copy the actual packet to fifo XXX through 'align buffer' */ - m_copydata(m, 0, m->m_pkthdr.len, (caddr_t)td); + m_copydata(m, 0, m->m_pkthdr.len, td); bus_space_write_multi_4(sc->sc_iot, sc->sc_ioh, SXIE_TXIO0, (uint32_t *)td, SXIE_ROUNDUP(m->m_pkthdr.len, 4) >> 2); diff --git a/sys/arch/octeon/dev/octcrypto.c b/sys/arch/octeon/dev/octcrypto.c index 35f7e77aa47..b77f151c319 100644 --- a/sys/arch/octeon/dev/octcrypto.c +++ b/sys/arch/octeon/dev/octcrypto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: octcrypto.c,v 1.3 2019/03/10 14:20:44 visa Exp $ */ +/* $OpenBSD: octcrypto.c,v 1.4 2021/02/25 02:48:19 dlg Exp $ */ /* * Copyright (c) 2018 Visa Hankala @@ -739,7 +739,7 @@ octcrypto_authenc_gmac(struct cryptop *crp, struct cryptodesc *crde, } else { if (crp->crp_flags & CRYPTO_F_IMBUF) m_copydata((struct mbuf *)crp->crp_buf, - crde->crd_inject, ivlen, (uint8_t *)iv); + crde->crd_inject, ivlen, iv); else cuio_copydata((struct uio *)crp->crp_buf, crde->crd_inject, ivlen, (uint8_t *)iv); @@ -1035,10 +1035,8 @@ octcrypto_authenc_hmac(struct cryptop *crp, struct cryptodesc *crde, memcpy(iv, crde->crd_iv, ivlen); } else { if (crp->crp_flags & CRYPTO_F_IMBUF) - m_copydata( - (struct mbuf *)crp->crp_buf, - crde->crd_inject, ivlen, - (uint8_t *)iv); + m_copydata((struct mbuf *)crp->crp_buf, + crde->crd_inject, ivlen, iv); else cuio_copydata( (struct uio *)crp->crp_buf, diff --git a/sys/dev/ic/acx.c b/sys/dev/ic/acx.c index b26fce44c8f..01a306fcb2f 100644 --- a/sys/dev/ic/acx.c +++ b/sys/dev/ic/acx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acx.c,v 1.124 2020/07/10 13:26:37 patrick Exp $ */ +/* $OpenBSD: acx.c,v 1.125 2021/02/25 02:48:19 dlg Exp $ */ /* * Copyright (c) 2006 Jonathan Gray @@ -2373,7 +2373,7 @@ acx_set_probe_resp_tmplt(struct acx_softc *sc, struct ieee80211_node *ni) IEEE80211_ADDR_COPY(wh->i_addr3, ni->ni_bssid); *(u_int16_t *)wh->i_seq = 0; - m_copydata(m, 0, m->m_pkthdr.len, (caddr_t)&resp.data); + m_copydata(m, 0, m->m_pkthdr.len, &resp.data); len = m->m_pkthdr.len + sizeof(resp.size); m_freem(m); @@ -2427,7 +2427,7 @@ acx_set_beacon_tmplt(struct acx_softc *sc, struct ieee80211_node *ni) return (1); } - m_copydata(m, 0, off, (caddr_t)&beacon.data); + m_copydata(m, 0, off, &beacon.data); len = off + sizeof(beacon.size); if (acx_set_tmplt(sc, ACXCMD_TMPLT_BEACON, &beacon, len) != 0) { @@ -2442,7 +2442,7 @@ acx_set_beacon_tmplt(struct acx_softc *sc, struct ieee80211_node *ni) return (0); } - m_copydata(m, off, len, (caddr_t)&tim.data); + m_copydata(m, off, len, &tim.data); len += sizeof(beacon.size); m_freem(m); diff --git a/sys/dev/ic/an.c b/sys/dev/ic/an.c index 97bc598dc66..6208492c94c 100644 --- a/sys/dev/ic/an.c +++ b/sys/dev/ic/an.c @@ -1,4 +1,4 @@ -/* $OpenBSD: an.c,v 1.77 2020/12/08 04:37:27 cheloha Exp $ */ +/* $OpenBSD: an.c,v 1.78 2021/02/25 02:48:20 dlg Exp $ */ /* $NetBSD: an.c,v 1.34 2005/06/20 02:49:18 atatat Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -781,7 +781,7 @@ an_mwrite_bap(struct an_softc *sc, int id, int off, struct mbuf *m, int totlen) len = min(m->m_len, totlen); if ((mtod(m, u_long) & 0x1) || (len & 0x1)) { - m_copydata(m, 0, totlen, (caddr_t)&sc->sc_buf.sc_txbuf); + m_copydata(m, 0, totlen, &sc->sc_buf.sc_txbuf); cnt = (totlen + 1) / 2; an_swap16((u_int16_t *)&sc->sc_buf.sc_txbuf, cnt); CSR_WRITE_MULTI_STREAM_2(sc, AN_DATA0, @@ -1126,7 +1126,7 @@ an_start(struct ifnet *ifp) if (ic->ic_flags & IEEE80211_F_WEPON) wh->i_fc[1] |= IEEE80211_FC1_WEP; m_copydata(m, 0, sizeof(struct ieee80211_frame), - (caddr_t)&frmhdr.an_whdr); + &frmhdr.an_whdr); an_swap16((u_int16_t *)&frmhdr.an_whdr, sizeof(struct ieee80211_frame)/2); /* insert payload length in front of llc/snap */ diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c index 6895e28c175..bd3fe1b86ed 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.174 2020/07/10 13:26:37 patrick Exp $ */ +/* $OpenBSD: if_wi.c,v 1.175 2021/02/25 02:48:20 dlg Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -768,7 +768,7 @@ wi_rxeof(struct wi_softc *sc) break; case WI_CRYPTO_SOFTWARE_WEP: m_copydata(m, 0, m->m_pkthdr.len, - (caddr_t)sc->wi_rxbuf); + sc->wi_rxbuf); len = m->m_pkthdr.len - sizeof(struct ether_header); if (wi_do_hostdecrypt(sc, sc->wi_rxbuf + @@ -2400,7 +2400,7 @@ nextpkt: m_copydata(m0, sizeof(struct ether_header), m0->m_pkthdr.len - sizeof(struct ether_header), - (caddr_t)&sc->wi_txbuf[12]); + &sc->wi_txbuf[12]); wi_do_hostencrypt(sc, (caddr_t)&sc->wi_txbuf, tx_frame.wi_dat_len); @@ -2418,7 +2418,7 @@ nextpkt: } else { m_copydata(m0, sizeof(struct ether_header), m0->m_pkthdr.len - sizeof(struct ether_header), - (caddr_t)&sc->wi_txbuf); + &sc->wi_txbuf); tx_frame.wi_dat_len = htole16(tx_frame.wi_dat_len); wi_write_data(sc, id, 0, (caddr_t)&tx_frame, @@ -2438,8 +2438,7 @@ nextpkt: ": host encrypt not implemented for 802.3\n", WI_PRT_ARG(sc)); } else { - m_copydata(m0, 0, m0->m_pkthdr.len, - (caddr_t)&sc->wi_txbuf); + m_copydata(m0, 0, m0->m_pkthdr.len, &sc->wi_txbuf); wi_write_data(sc, id, 0, (caddr_t)&tx_frame, sizeof(struct wi_frame)); diff --git a/sys/dev/pci/if_bwfm_pci.c b/sys/dev/pci/if_bwfm_pci.c index 7fc2ec380e9..4198390e687 100644 --- a/sys/dev/pci/if_bwfm_pci.c +++ b/sys/dev/pci/if_bwfm_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bwfm_pci.c,v 1.39 2021/01/31 11:07:51 patrick Exp $ */ +/* $OpenBSD: if_bwfm_pci.c,v 1.40 2021/02/25 02:48:20 dlg Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2017 Patrick Wildt @@ -2017,7 +2017,7 @@ bwfm_pci_msgbuf_query_dcmd(struct bwfm_softc *bwfm, int ifidx, *len = min(ctl->retlen, m->m_len); *len = min(*len, buflen); if (buf) - m_copydata(ctl->m, 0, *len, (caddr_t)buf); + m_copydata(ctl->m, 0, *len, buf); m_freem(ctl->m); if (ctl->status < 0) { diff --git a/sys/dev/pci/if_mcx.c b/sys/dev/pci/if_mcx.c index 75bccc03c79..38437e54897 100644 --- a/sys/dev/pci/if_mcx.c +++ b/sys/dev/pci/if_mcx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mcx.c,v 1.99 2021/02/15 03:42:00 dlg Exp $ */ +/* $OpenBSD: if_mcx.c,v 1.100 2021/02/25 02:48:20 dlg Exp $ */ /* * Copyright (c) 2017 David Gwynne @@ -7754,7 +7754,7 @@ mcx_start(struct ifqueue *ifq) &sqe->sqe_inline_headers; /* slightly cheaper vlan_inject() */ - m_copydata(m, 0, ETHER_HDR_LEN, (caddr_t)evh); + m_copydata(m, 0, ETHER_HDR_LEN, evh); evh->evl_proto = evh->evl_encap_proto; evh->evl_encap_proto = htons(ETHERTYPE_VLAN); evh->evl_tag = htons(m->m_pkthdr.ether_vtag); @@ -7764,7 +7764,7 @@ mcx_start(struct ifqueue *ifq) #endif { m_copydata(m, 0, MCX_SQ_INLINE_SIZE, - (caddr_t)sqe->sqe_inline_headers); + sqe->sqe_inline_headers); m_adj(m, MCX_SQ_INLINE_SIZE); } diff --git a/sys/dev/pci/safe.c b/sys/dev/pci/safe.c index a0a595f7899..639d44f6455 100644 --- a/sys/dev/pci/safe.c +++ b/sys/dev/pci/safe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: safe.c,v 1.44 2020/05/29 04:42:25 deraadt Exp $ */ +/* $OpenBSD: safe.c,v 1.45 2021/02/25 02:48:20 dlg Exp $ */ /*- * Copyright (c) 2003 Sam Leffler, Errno Consulting @@ -467,7 +467,7 @@ safe_process(struct cryptop *crp) bcopy(enccrd->crd_iv, iv, ivsize); else if (crp->crp_flags & CRYPTO_F_IMBUF) m_copydata(re->re_src_m, enccrd->crd_inject, - ivsize, (caddr_t)iv); + ivsize, iv); else if (crp->crp_flags & CRYPTO_F_IOV) cuio_copydata(re->re_src_io, enccrd->crd_inject, ivsize, (caddr_t)iv); diff --git a/sys/dev/pci/ubsec.c b/sys/dev/pci/ubsec.c index a9020f7e615..aedc05eec2e 100644 --- a/sys/dev/pci/ubsec.c +++ b/sys/dev/pci/ubsec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ubsec.c,v 1.166 2020/05/29 04:42:25 deraadt Exp $ */ +/* $OpenBSD: ubsec.c,v 1.167 2021/02/25 02:48:20 dlg Exp $ */ /* * Copyright (c) 2000 Jason L. Wright (jason@thought.net) @@ -927,7 +927,7 @@ ubsec_process(struct cryptop *crp) bcopy(enccrd->crd_iv, key.ses_iv, ivlen); else if (crp->crp_flags & CRYPTO_F_IMBUF) m_copydata(q->q_src_m, enccrd->crd_inject, - ivlen, (caddr_t)key.ses_iv); + ivlen, key.ses_iv); else if (crp->crp_flags & CRYPTO_F_IOV) cuio_copydata(q->q_src_io, enccrd->crd_inject, ivlen, diff --git a/sys/dev/usb/if_athn_usb.c b/sys/dev/usb/if_athn_usb.c index 281c53c7ff9..771baafcdac 100644 --- a/sys/dev/usb/if_athn_usb.c +++ b/sys/dev/usb/if_athn_usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_athn_usb.c,v 1.59 2020/11/30 16:09:33 krw Exp $ */ +/* $OpenBSD: if_athn_usb.c,v 1.60 2021/02/25 02:48:20 dlg Exp $ */ /*- * Copyright (c) 2011 Damien Bergamini @@ -1766,7 +1766,7 @@ athn_usb_swba(struct athn_usb_softc *usc) memset(bcn, 0, sizeof(*bcn)); bcn->vif_idx = 0; - m_copydata(m, 0, m->m_pkthdr.len, (caddr_t)&bcn[1]); + m_copydata(m, 0, m->m_pkthdr.len, &bcn[1]); usbd_setup_xfer(data->xfer, usc->tx_data_pipe, data, data->buf, sizeof(*hdr) + sizeof(*htc) + sizeof(*bcn) + m->m_pkthdr.len, @@ -2377,7 +2377,7 @@ athn_usb_tx(struct athn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) frm = (uint8_t *)&txm[1]; } /* Copy payload. */ - m_copydata(m, 0, m->m_pkthdr.len, (caddr_t)frm); + m_copydata(m, 0, m->m_pkthdr.len, frm); frm += m->m_pkthdr.len; m_freem(m); diff --git a/sys/dev/usb/if_otus.c b/sys/dev/usb/if_otus.c index 9aa771ecad9..bb220831ffc 100644 --- a/sys/dev/usb/if_otus.c +++ b/sys/dev/usb/if_otus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_otus.c,v 1.68 2020/11/30 16:09:33 krw Exp $ */ +/* $OpenBSD: if_otus.c,v 1.69 2021/02/25 02:48:20 dlg Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini @@ -1380,7 +1380,7 @@ otus_tx(struct otus_softc *sc, struct mbuf *m, struct ieee80211_node *ni) #endif xferlen = sizeof (*head) + m->m_pkthdr.len; - m_copydata(m, 0, m->m_pkthdr.len, (caddr_t)&head[1]); + m_copydata(m, 0, m->m_pkthdr.len, &head[1]); m_freem(m); DPRINTFN(5, ("tx queued=%d len=%d mac=0x%04x phy=0x%08x rate=%d\n", diff --git a/sys/dev/usb/if_rsu.c b/sys/dev/usb/if_rsu.c index a2d7b48749a..929d8f161d5 100644 --- a/sys/dev/usb/if_rsu.c +++ b/sys/dev/usb/if_rsu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rsu.c,v 1.48 2020/11/30 16:09:33 krw Exp $ */ +/* $OpenBSD: if_rsu.c,v 1.49 2021/02/25 02:48:20 dlg Exp $ */ /*- * Copyright (c) 2010 Damien Bergamini @@ -1609,7 +1609,7 @@ rsu_tx(struct rsu_softc *sc, struct mbuf *m, struct ieee80211_node *ni) #endif xferlen = sizeof(*txd) + m->m_pkthdr.len; - m_copydata(m, 0, m->m_pkthdr.len, (caddr_t)&txd[1]); + m_copydata(m, 0, m->m_pkthdr.len, &txd[1]); m_freem(m); data->pipe = pipe; diff --git a/sys/dev/usb/if_uath.c b/sys/dev/usb/if_uath.c index e75546ba901..ae8ccb49c76 100644 --- a/sys/dev/usb/if_uath.c +++ b/sys/dev/usb/if_uath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_uath.c,v 1.86 2020/12/12 11:48:54 jan Exp $ */ +/* $OpenBSD: if_uath.c,v 1.87 2021/02/25 02:48:20 dlg Exp $ */ /*- * Copyright (c) 2006 @@ -1398,14 +1398,14 @@ uath_tx_data(struct uath_softc *sc, struct mbuf *m0, struct ieee80211_node *ni) *frm++ = (iv >> 16) & 0xff; *frm++ = ic->ic_wep_txkey << 6; - m_copydata(m0, sizeof (struct ieee80211_frame), - m0->m_pkthdr.len - sizeof (struct ieee80211_frame), frm); + m_copydata(m0, sizeof(struct ieee80211_frame), + m0->m_pkthdr.len - sizeof(struct ieee80211_frame), frm); paylen += IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN; xferlen += IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN; totlen = xferlen + IEEE80211_WEP_CRCLEN; } else { - m_copydata(m0, 0, m0->m_pkthdr.len, (uint8_t *)(desc + 1)); + m_copydata(m0, 0, m0->m_pkthdr.len, desc + 1); totlen = xferlen; } diff --git a/sys/dev/usb/if_urtw.c b/sys/dev/usb/if_urtw.c index 4e9bfb114bc..996f9122b8f 100644 --- a/sys/dev/usb/if_urtw.c +++ b/sys/dev/usb/if_urtw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_urtw.c,v 1.69 2020/07/10 13:22:21 patrick Exp $ */ +/* $OpenBSD: if_urtw.c,v 1.70 2021/02/25 02:48:20 dlg Exp $ */ /*- * Copyright (c) 2009 Martynas Venckus @@ -2649,10 +2649,10 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_node *ni, struct mbuf *m0, data->buf[8] = 3; /* CW minimum */ data->buf[8] |= (7 << 4); /* CW maximum */ data->buf[9] |= 11; /* retry limitation */ - m_copydata(m0, 0, m0->m_pkthdr.len, (uint8_t *)&data->buf[12]); + m_copydata(m0, 0, m0->m_pkthdr.len, &data->buf[12]); } else { data->buf[21] |= 11; /* retry limitation */ - m_copydata(m0, 0, m0->m_pkthdr.len, (uint8_t *)&data->buf[32]); + m_copydata(m0, 0, m0->m_pkthdr.len, &data->buf[32]); } data->ni = ni; diff --git a/sys/net/bridgectl.c b/sys/net/bridgectl.c index 5114da231ba..99a36692440 100644 --- a/sys/net/bridgectl.c +++ b/sys/net/bridgectl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bridgectl.c,v 1.24 2021/02/24 06:44:54 dlg Exp $ */ +/* $OpenBSD: bridgectl.c,v 1.25 2021/02/25 02:48:21 dlg Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -669,7 +669,7 @@ bridge_arpfilter(struct brl_node *n, struct ether_header *eh, struct mbuf *m) return (0); if (m->m_pkthdr.len < ETHER_HDR_LEN + sizeof(ea)) return (0); /* log error? */ - m_copydata(m, ETHER_HDR_LEN, sizeof(ea), (caddr_t)&ea); + m_copydata(m, ETHER_HDR_LEN, sizeof(ea), &ea); if (ntohs(ea.arp_hrd) != ARPHRD_ETHER || ntohs(ea.arp_pro) != ETHERTYPE_IP || diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 991f753fca8..bb91143b35d 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.351 2021/02/23 11:44:53 dlg Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.352 2021/02/25 02:48:21 dlg Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -958,7 +958,7 @@ bridgeintr_frame(struct ifnet *brifp, struct ifnet *src_if, struct mbuf *m) bif = bridge_getbif(src_if); KASSERT(bif != NULL); - m_copydata(m, 0, ETHER_HDR_LEN, (caddr_t)&eh); + m_copydata(m, 0, ETHER_HDR_LEN, &eh); dst = (struct ether_addr *)&eh.ether_dhost[0]; src = (struct ether_addr *)&eh.ether_shost[0]; @@ -1457,8 +1457,7 @@ bridge_blocknonip(struct ether_header *eh, struct mbuf *m) (ETHER_HDR_LEN + LLC_SNAPFRAMELEN)) return (1); - m_copydata(m, ETHER_HDR_LEN, LLC_SNAPFRAMELEN, - (caddr_t)&llc); + m_copydata(m, ETHER_HDR_LEN, LLC_SNAPFRAMELEN, &llc); etype = ntohs(llc.llc_snap.ether_type); if (llc.llc_dsap == LLC_SNAP_LSAP && @@ -1512,8 +1511,7 @@ bridge_ipsec(struct ifnet *ifp, struct ether_header *eh, int hassnap, dst.sa.sa_family = AF_INET; dst.sin.sin_len = sizeof(struct sockaddr_in); m_copydata(m, offsetof(struct ip, ip_dst), - sizeof(struct in_addr), - (caddr_t)&dst.sin.sin_addr); + sizeof(struct in_addr), &dst.sin.sin_addr); break; #ifdef INET6 @@ -1535,8 +1533,7 @@ bridge_ipsec(struct ifnet *ifp, struct ether_header *eh, int hassnap, dst.sa.sa_family = AF_INET6; dst.sin6.sin6_len = sizeof(struct sockaddr_in6); m_copydata(m, offsetof(struct ip6_hdr, ip6_dst), - sizeof(struct in6_addr), - (caddr_t)&dst.sin6.sin6_addr); + sizeof(struct in6_addr), &dst.sin6.sin6_addr); break; #endif /* INET6 */ @@ -1546,15 +1543,15 @@ bridge_ipsec(struct ifnet *ifp, struct ether_header *eh, int hassnap, switch (proto) { case IPPROTO_ESP: - m_copydata(m, hlen, sizeof(u_int32_t), (caddr_t)&spi); + m_copydata(m, hlen, sizeof(u_int32_t), &spi); break; case IPPROTO_AH: m_copydata(m, hlen + sizeof(u_int32_t), - sizeof(u_int32_t), (caddr_t)&spi); + sizeof(u_int32_t), &spi); break; case IPPROTO_IPCOMP: m_copydata(m, hlen + sizeof(u_int16_t), - sizeof(u_int16_t), (caddr_t)&cpi); + sizeof(u_int16_t), &cpi); spi = htonl(ntohs(cpi)); break; } @@ -1654,8 +1651,7 @@ bridge_ip(struct ifnet *brifp, int dir, struct ifnet *ifp, ETHER_HDR_LEN)) return (m); - m_copydata(m, ETHER_HDR_LEN, - LLC_SNAPFRAMELEN, (caddr_t)&llc); + m_copydata(m, ETHER_HDR_LEN, LLC_SNAPFRAMELEN, &llc); if (llc.llc_dsap != LLC_SNAP_LSAP || llc.llc_ssap != LLC_SNAP_LSAP || @@ -1885,8 +1881,7 @@ bridge_fragment(struct ifnet *brifp, struct ifnet *ifp, struct ether_header *eh, ETHER_HDR_LEN)) goto dropit; - m_copydata(m, ETHER_HDR_LEN, - LLC_SNAPFRAMELEN, (caddr_t)&llc); + m_copydata(m, ETHER_HDR_LEN, LLC_SNAPFRAMELEN, &llc); if (llc.llc_dsap != LLC_SNAP_LSAP || llc.llc_ssap != LLC_SNAP_LSAP || diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c index b6c48a38339..f6088c8bee5 100644 --- a/sys/net/if_pfsync.c +++ b/sys/net/if_pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pfsync.c,v 1.286 2021/02/19 06:14:07 dlg Exp $ */ +/* $OpenBSD: if_pfsync.c,v 1.287 2021/02/25 02:48:21 dlg Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -792,7 +792,7 @@ pfsync_input(struct mbuf **mp, int *offp, int proto, int af) offset += sizeof(*ph); while (offset <= len - sizeof(subh)) { - m_copydata(m, offset, sizeof(subh), (caddr_t)&subh); + m_copydata(m, offset, sizeof(subh), &subh); offset += sizeof(subh); mlen = subh.len << 2; diff --git a/sys/net/if_pppx.c b/sys/net/if_pppx.c index 2c8caa94760..4ddaa76122e 100644 --- a/sys/net/if_pppx.c +++ b/sys/net/if_pppx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pppx.c,v 1.109 2021/02/10 13:38:46 mvs Exp $ */ +/* $OpenBSD: if_pppx.c,v 1.110 2021/02/25 02:48:21 dlg Exp $ */ /* * Copyright (c) 2010 Claudio Jeker @@ -1441,7 +1441,7 @@ pppac_qstart(struct ifqueue *ifq) case AF_INET: if (m->m_pkthdr.len < sizeof(struct ip)) goto bad; - m_copydata(m, 0, sizeof(struct ip), (caddr_t)&ip); + m_copydata(m, 0, sizeof(struct ip), &ip); if (IN_MULTICAST(ip.ip_dst.s_addr)) { /* pass a copy to pipex */ m0 = m_copym(m, 0, M_COPYALL, M_NOWAIT); diff --git a/sys/net/if_switch.c b/sys/net/if_switch.c index 447e164e5b0..c70761f8fd5 100644 --- a/sys/net/if_switch.c +++ b/sys/net/if_switch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_switch.c,v 1.41 2021/02/23 15:13:58 mvs Exp $ */ +/* $OpenBSD: if_switch.c,v 1.42 2021/02/25 02:48:21 dlg Exp $ */ /* * Copyright (c) 2016 Kazuya GODA @@ -692,7 +692,7 @@ switch_port_ingress(struct switch_softc *sc, struct ifnet *src_if, sc->sc_if.if_ipackets++; sc->sc_if.if_ibytes += m->m_pkthdr.len; - m_copydata(m, 0, ETHER_HDR_LEN, (caddr_t)&eh); + m_copydata(m, 0, ETHER_HDR_LEN, &eh); #if 0 /* It's the "#if 0" because it doesn't test switch(4) with pf(4) * or with ipsec(4). @@ -722,7 +722,7 @@ switch_port_egress(struct switch_softc *sc, struct switch_fwdp_queue *fwdp_q, bpf_mtap(sc->sc_if.if_bpf, m, BPF_DIRECTION_OUT); #endif - m_copydata(m, 0, ETHER_HDR_LEN, (caddr_t)&eh); + m_copydata(m, 0, ETHER_HDR_LEN, &eh); TAILQ_FOREACH(swpo, fwdp_q, swpo_fwdp_next) { if ((dst_if = if_get(swpo->swpo_ifindex)) == NULL) @@ -1549,7 +1549,7 @@ ofp_split_mbuf(struct mbuf *m, struct mbuf **mtail) return (-1); m_copydata(m, offsetof(struct ofp_header, oh_length), sizeof(ohlen), - (caddr_t)&ohlen); + &ohlen); ohlen = ntohs(ohlen); /* We got an invalid packet header, skip it. */ diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index b0bf72d2cb6..40a5fa2a938 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vlan.c,v 1.205 2021/01/21 13:17:13 mvs Exp $ */ +/* $OpenBSD: if_vlan.c,v 1.206 2021/02/25 02:48:21 dlg Exp $ */ /* * Copyright 1998 Massachusetts Institute of Technology @@ -340,7 +340,7 @@ vlan_inject(struct mbuf *m, uint16_t type, uint16_t tag) { struct ether_vlan_header evh; - m_copydata(m, 0, ETHER_HDR_LEN, (caddr_t)&evh); + m_copydata(m, 0, ETHER_HDR_LEN, &evh); evh.evl_proto = evh.evl_encap_proto; evh.evl_encap_proto = htons(type); evh.evl_tag = htons(tag); diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index 1652460c2dd..8d7fae6888b 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vxlan.c,v 1.81 2020/08/21 22:59:27 kn Exp $ */ +/* $OpenBSD: if_vxlan.c,v 1.82 2021/02/25 02:48:21 dlg Exp $ */ /* * Copyright (c) 2013 Reyk Floeter @@ -637,7 +637,7 @@ vxlan_lookup(struct mbuf *m, struct udphdr *uh, int iphlen, skip = iphlen + sizeof(*uh); if (m->m_pkthdr.len - skip < sizeof(v)) return (0); - m_copydata(m, skip, sizeof(v), (caddr_t)&v); + m_copydata(m, skip, sizeof(v), &v); skip += sizeof(v); if (v.vxlan_flags & htonl(VXLAN_RESERVED1) || diff --git a/sys/net/pipex.c b/sys/net/pipex.c index 4420ad570ee..978d184494f 100644 --- a/sys/net/pipex.c +++ b/sys/net/pipex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pipex.c,v 1.130 2021/01/19 19:37:42 mvs Exp $ */ +/* $OpenBSD: pipex.c,v 1.131 2021/02/25 02:48:21 dlg Exp $ */ /*- * Copyright (c) 2009 Internet Initiative Japan Inc. @@ -991,7 +991,7 @@ pipex_common_input(struct pipex_session *session, struct mbuf *m0, int hlen, case PPP_CCP: code = 0; KASSERT(m0->m_pkthdr.len >= hlen + ppphlen + 1); - m_copydata(m0, hlen + ppphlen, 1, (caddr_t)&code); + m_copydata(m0, hlen + ppphlen, 1, &code); if (code != CCP_RESETREQ && code != CCP_RESETACK) goto not_ours; break; @@ -1096,7 +1096,7 @@ pipex_pppoe_lookup_session(struct mbuf *m0) return (NULL); m_copydata(m0, sizeof(struct ether_header), - sizeof(struct pipex_pppoe_header), (caddr_t)&pppoe); + sizeof(struct pipex_pppoe_header), &pppoe); pppoe.session_id = ntohs(pppoe.session_id); session = pipex_lookup_by_session_id(PIPEX_PROTO_PPPOE, pppoe.session_id); @@ -1123,7 +1123,7 @@ pipex_pppoe_input(struct mbuf *m0, struct pipex_session *session) sizeof(pppoe))); m_copydata(m0, sizeof(struct ether_header), - sizeof(struct pipex_pppoe_header), (caddr_t)&pppoe); + sizeof(struct pipex_pppoe_header), &pppoe); hlen = sizeof(struct ether_header) + sizeof(struct pipex_pppoe_header); if ((m0 = pipex_common_input(session, m0, hlen, ntohs(pppoe.length))) @@ -1287,7 +1287,7 @@ pipex_pptp_lookup_session(struct mbuf *m0) } /* get ip header info */ - m_copydata(m0, 0, sizeof(struct ip), (caddr_t)&ip); + m_copydata(m0, 0, sizeof(struct ip), &ip); hlen = ip.ip_hl << 2; /* @@ -1296,7 +1296,7 @@ pipex_pptp_lookup_session(struct mbuf *m0) */ /* get gre flags */ - m_copydata(m0, hlen, sizeof(gre), (caddr_t)&gre); + m_copydata(m0, hlen, sizeof(gre), &gre); flags = ntohs(gre.flags); /* gre version must be '1' */ @@ -1521,7 +1521,7 @@ pipex_pptp_userland_lookup_session(struct mbuf *m0, struct sockaddr *sa) } /* get flags */ - m_copydata(m0, 0, sizeof(struct pipex_gre_header), (caddr_t)&gre); + m_copydata(m0, 0, sizeof(struct pipex_gre_header), &gre); flags = ntohs(gre.flags); /* gre version must be '1' */ @@ -1571,7 +1571,7 @@ pipex_pptp_userland_output(struct mbuf *m0, struct pipex_session *session) uint32_t val32; len = sizeof(struct pipex_gre_header); - m_copydata(m0, 0, len, (caddr_t)&gre0); + m_copydata(m0, 0, len, &gre0); gre = &gre0; flags = ntohs(gre->flags); if ((flags & PIPEX_GRE_SFLAG) != 0) @@ -1801,7 +1801,7 @@ pipex_l2tp_input(struct mbuf *m0, int off0, struct pipex_session *session, l2tp_session->ipsecflowinfo = ipsecflowinfo; nsp = nrp = NULL; - m_copydata(m0, off0, sizeof(flags), (caddr_t)&flags); + m_copydata(m0, off0, sizeof(flags), &flags); flags = ntohs(flags) & PIPEX_L2TP_FLAG_MASK; KASSERT((flags & PIPEX_L2TP_FLAG_TYPE) == 0); @@ -1953,7 +1953,7 @@ pipex_l2tp_userland_lookup_session(struct mbuf *m0, struct sockaddr *sa) } /* get flags */ - m_copydata(m0, 0, sizeof(l2tp), (caddr_t)&l2tp); + m_copydata(m0, 0, sizeof(l2tp), &l2tp); flags = ntohs(l2tp.flagsver); /* l2tp version must be '2' */ diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index f5f86e9f0e2..f7bb66b6c97 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsock.c,v 1.305 2021/02/15 19:01:30 mvs Exp $ */ +/* $OpenBSD: rtsock.c,v 1.306 2021/02/25 02:48:21 dlg Exp $ */ /* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */ /* @@ -724,7 +724,7 @@ route_output(struct mbuf *m, struct socket *so, struct sockaddr *dstaddr, goto fail; } rtm = malloc(len, M_RTABLE, M_WAITOK); - m_copydata(m, 0, len, (caddr_t)rtm); + m_copydata(m, 0, len, rtm); break; default: error = EPROTONOSUPPORT; diff --git a/sys/net/switchofp.c b/sys/net/switchofp.c index 50afffca9e4..4b9e6a114fa 100644 --- a/sys/net/switchofp.c +++ b/sys/net/switchofp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: switchofp.c,v 1.78 2021/01/19 19:39:14 mvs Exp $ */ +/* $OpenBSD: switchofp.c,v 1.79 2021/02/25 02:48:21 dlg Exp $ */ /* * Copyright (c) 2016 Kazuya GODA @@ -3261,7 +3261,7 @@ swofp_action_pop_vlan(struct switch_softc *sc, struct mbuf *m, return (NULL); } - m_copydata(m, 0, ETHER_HDR_LEN, (caddr_t)&eh); + m_copydata(m, 0, ETHER_HDR_LEN, &eh); eh.ether_type = evl->evl_proto; m_adj(m, sizeof(*evl)); @@ -3346,7 +3346,7 @@ swofp_action_push_vlan(struct switch_softc *sc, struct mbuf *m, swfcl->swfcl_vlan->vlan_vid = htons(1); } - m_copydata(m, 0, ETHER_HDR_LEN, (caddr_t)&evh); + m_copydata(m, 0, ETHER_HDR_LEN, &evh); evh.evl_proto = evh.evl_encap_proto; evh.evl_encap_proto = oap->ap_ethertype; evh.evl_tag = (swfcl->swfcl_vlan->vlan_vid | @@ -5481,7 +5481,7 @@ swofp_group_mod_add(struct switch_softc *sc, struct mbuf *m) } m_copydata(m, offsetof(struct ofp_group_mod, gm_buckets), - swge->swge_buckets_len, (caddr_t)swge->swge_buckets); + swge->swge_buckets_len, swge->swge_buckets); } swofp_group_entry_add(sc, swge); @@ -5541,7 +5541,7 @@ swofp_group_mod_modify(struct switch_softc *sc, struct mbuf *m) if (swge->swge_buckets != NULL) m_copydata(m, offsetof(struct ofp_group_mod, gm_buckets), - swge->swge_buckets_len, (caddr_t)swge->swge_buckets); + swge->swge_buckets_len, swge->swge_buckets); m_freem(m); return (0); diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c index 5d1a30cc90e..c4a450f49cf 100644 --- a/sys/netinet/ip_ah.c +++ b/sys/netinet/ip_ah.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ah.c,v 1.145 2020/12/18 12:30:23 tobhe Exp $ */ +/* $OpenBSD: ip_ah.c,v 1.146 2021/02/25 02:48:21 dlg Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -327,7 +327,7 @@ ah_massage_headers(struct mbuf **m0, int af, int skip, int alg, int out) #ifdef INET6 case AF_INET6: /* Ugly... */ /* Copy and "cook" the IPv6 header. */ - m_copydata(m, 0, sizeof(ip6), (caddr_t) &ip6); + m_copydata(m, 0, sizeof(ip6), &ip6); /* We don't do IPv6 Jumbograms. */ if (ip6.ip6_plen == 0) { @@ -464,8 +464,7 @@ ah_massage_headers(struct mbuf **m0, int af, int skip, int alg, int out) sizeof(struct in6_addr) * (rh0->ip6r0_segleft - 1)); - m_copydata(m, 0, sizeof(ip6), - (caddr_t)&ip6); + m_copydata(m, 0, sizeof(ip6), &ip6); addr[0] = ip6.ip6_dst; ip6.ip6_dst = finaldst; error = m_copyback(m, 0, sizeof(ip6), @@ -539,13 +538,12 @@ ah_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) rplen = AH_FLENGTH + sizeof(u_int32_t); /* Save the AH header, we use it throughout. */ - m_copydata(m, skip + offsetof(struct ah, ah_hl), sizeof(u_int8_t), - (caddr_t) &hl); + m_copydata(m, skip + offsetof(struct ah, ah_hl), sizeof(u_int8_t), &hl); /* Replay window checking, if applicable. */ if (tdb->tdb_wnd > 0) { m_copydata(m, skip + offsetof(struct ah, ah_rpl), - sizeof(u_int32_t), (caddr_t) &btsx); + sizeof(u_int32_t), &btsx); btsx = ntohl(btsx); switch (checkreplaywindow(tdb, btsx, &esn, 0)) { @@ -668,7 +666,7 @@ ah_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) * Save the authenticator, the skipped portion of the packet, * and the AH header. */ - m_copydata(m, 0, skip + rplen + ahx->authsize, (caddr_t) (tc + 1)); + m_copydata(m, 0, skip + rplen + ahx->authsize, tc + 1); /* Zeroize the authenticator on the packet. */ m_copyback(m, skip + rplen, ahx->authsize, ipseczeroes, M_NOWAIT); @@ -751,7 +749,7 @@ ah_input_cb(struct tdb *tdb, struct tdb_crypto *tc, struct mbuf *m, int clen) /* Replay window checking, if applicable. */ if (tdb->tdb_wnd > 0) { m_copydata(m, skip + offsetof(struct ah, ah_rpl), - sizeof(u_int32_t), (caddr_t) &btsx); + sizeof(u_int32_t), &btsx); btsx = ntohl(btsx); switch (checkreplaywindow(tdb, btsx, &esn, 1)) { @@ -1034,7 +1032,7 @@ ah_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, ah = (struct ah *)(mtod(mi, caddr_t) + roff); /* Initialize the AH header. */ - m_copydata(m, protoff, sizeof(u_int8_t), (caddr_t) &ah->ah_nh); + m_copydata(m, protoff, sizeof(u_int8_t), &ah->ah_nh); ah->ah_hl = (rplen + ahx->authsize - AH_FLENGTH) / sizeof(u_int32_t); ah->ah_rv = 0; ah->ah_spi = tdb->tdb_spi; @@ -1087,7 +1085,7 @@ ah_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, } /* Save the skipped portion of the packet. */ - m_copydata(m, 0, skip, (caddr_t) (tc + 1)); + m_copydata(m, 0, skip, tc + 1); /* * Fix IP header length on the header used for diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c index 36b761273cd..a74bfd341ac 100644 --- a/sys/netinet/ip_esp.c +++ b/sys/netinet/ip_esp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp.c,v 1.161 2020/12/18 12:30:23 tobhe Exp $ */ +/* $OpenBSD: ip_esp.c,v 1.162 2021/02/25 02:48:21 dlg Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -373,7 +373,7 @@ esp_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) /* Replay window checking, if appropriate -- no value commitment. */ if (tdb->tdb_wnd > 0) { m_copydata(m, skip + sizeof(u_int32_t), sizeof(u_int32_t), - (unsigned char *) &btsx); + &btsx); btsx = ntohl(btsx); switch (checkreplaywindow(tdb, btsx, &esn, 0)) { @@ -484,7 +484,7 @@ esp_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) crda->crd_len = m->m_pkthdr.len - (skip + alen); /* Copy the authenticator */ - m_copydata(m, m->m_pkthdr.len - alen, alen, (caddr_t)(tc + 1)); + m_copydata(m, m->m_pkthdr.len - alen, alen, tc + 1); } else crde = &crp->crp_desc[0]; @@ -576,7 +576,7 @@ esp_input_cb(struct tdb *tdb, struct tdb_crypto *tc, struct mbuf *m, int clen) /* Replay window checking, if appropriate */ if (tdb->tdb_wnd > 0) { m_copydata(m, skip + sizeof(u_int32_t), sizeof(u_int32_t), - (unsigned char *) &btsx); + &btsx); btsx = ntohl(btsx); switch (checkreplaywindow(tdb, btsx, &esn, 1)) { diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 5deaa3822a8..a007aa6c2b3 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_icmp.c,v 1.184 2020/12/20 21:15:47 bluhm Exp $ */ +/* $OpenBSD: ip_icmp.c,v 1.185 2021/02/25 02:48:21 dlg Exp $ */ /* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */ /* @@ -259,7 +259,7 @@ icmp_do_error(struct mbuf *n, int type, int code, u_int32_t dest, int destmtu) } icp->icmp_code = code; - m_copydata(n, 0, icmplen, (caddr_t)&icp->icmp_ip); + m_copydata(n, 0, icmplen, &icp->icmp_ip); /* * Now, copy old ip header (without options) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 464130a457e..49f3aa89765 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.175 2020/07/24 20:39:03 cheloha Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.176 2021/02/25 02:48:21 dlg Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -654,7 +654,7 @@ tcp6_ctlinput(int cmd, struct sockaddr *sa, u_int rdomain, void *d) return; bzero(&th, sizeof(th)); - m_copydata(m, off, sizeof(*thp), (caddr_t)&th); + m_copydata(m, off, sizeof(*thp), &th); /* * Check to see if we have a valid TCP connection diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index e4e89c5cd07..46b49ee1a9b 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_input.c,v 1.230 2020/11/16 06:44:39 gnezdo Exp $ */ +/* $OpenBSD: ip6_input.c,v 1.231 2021/02/25 02:48:21 dlg Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -650,7 +650,7 @@ ip6_check_rh0hdr(struct mbuf *m, int *offp) return (1); } - m_copydata(m, off, sizeof(rthdr), (caddr_t)&rthdr); + m_copydata(m, off, sizeof(rthdr), &rthdr); if (rthdr.ip6r_type == IPV6_RTHDR_TYPE_0) { *offp += offsetof(struct ip6_rthdr, ip6r_type); @@ -673,7 +673,7 @@ ip6_check_rh0hdr(struct mbuf *m, int *offp) return (0); } - m_copydata(m, off, sizeof(opt6), (caddr_t)&opt6); + m_copydata(m, off, sizeof(opt6), &opt6); if (proto == IPPROTO_AH) off += (opt6.ip6e_len + 2) * 4; @@ -1143,7 +1143,7 @@ ip6_pullexthdr(struct mbuf *m, size_t off, int nxt) if (off + sizeof(ip6e) > m->m_pkthdr.len) return NULL; - m_copydata(m, off, sizeof(ip6e), (caddr_t)&ip6e); + m_copydata(m, off, sizeof(ip6e), &ip6e); if (nxt == IPPROTO_AH) elen = (ip6e.ip6e_len + 2) << 2; else @@ -1195,7 +1195,7 @@ ip6_get_prevhdr(struct mbuf *m, int off) len = sizeof(struct ip6_hdr); nlen = 0; while (len < off) { - m_copydata(m, len, sizeof(ip6e), (caddr_t)&ip6e); + m_copydata(m, len, sizeof(ip6e), &ip6e); switch (nxt) { case IPPROTO_FRAGMENT: @@ -1236,7 +1236,7 @@ ip6_nexthdr(struct mbuf *m, int off, int proto, int *nxtp) case IPPROTO_IPV6: if (m->m_pkthdr.len < off + sizeof(ip6)) return -1; - m_copydata(m, off, sizeof(ip6), (caddr_t)&ip6); + m_copydata(m, off, sizeof(ip6), &ip6); if (nxtp) *nxtp = ip6.ip6_nxt; off += sizeof(ip6); @@ -1249,7 +1249,7 @@ ip6_nexthdr(struct mbuf *m, int off, int proto, int *nxtp) */ if (m->m_pkthdr.len < off + sizeof(fh)) return -1; - m_copydata(m, off, sizeof(fh), (caddr_t)&fh); + m_copydata(m, off, sizeof(fh), &fh); if ((fh.ip6f_offlg & IP6F_OFF_MASK) != 0) return -1; if (nxtp) @@ -1260,7 +1260,7 @@ ip6_nexthdr(struct mbuf *m, int off, int proto, int *nxtp) case IPPROTO_AH: if (m->m_pkthdr.len < off + sizeof(ip6e)) return -1; - m_copydata(m, off, sizeof(ip6e), (caddr_t)&ip6e); + m_copydata(m, off, sizeof(ip6e), &ip6e); if (nxtp) *nxtp = ip6e.ip6e_nxt; off += (ip6e.ip6e_len + 2) << 2; @@ -1273,7 +1273,7 @@ ip6_nexthdr(struct mbuf *m, int off, int proto, int *nxtp) case IPPROTO_DSTOPTS: if (m->m_pkthdr.len < off + sizeof(ip6e)) return -1; - m_copydata(m, off, sizeof(ip6e), (caddr_t)&ip6e); + m_copydata(m, off, sizeof(ip6e), &ip6e); if (nxtp) *nxtp = ip6e.ip6e_nxt; off += (ip6e.ip6e_len + 1) << 3; -- 2.20.1