-/* $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 <patrick@blueri.se>
* Copyright (c) 2013 Artturi Alm
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);
-/* $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
} 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);
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,
-/* $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 <jsg@openbsd.org>
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);
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) {
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);
-/* $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
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,
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 */
-/* $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
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 +
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);
} 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,
": 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));
-/* $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 <patrick@blueri.se>
*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) {
-/* $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 <dlg@openbsd.org>
&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);
#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);
}
-/* $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
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);
-/* $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)
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,
-/* $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 <damien.bergamini@free.fr>
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,
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);
-/* $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 <damien.bergamini@free.fr>
#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",
-/* $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 <damien.bergamini@free.fr>
#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;
-/* $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
*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;
}
-/* $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 <martynas@openbsd.org>
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;
-/* $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)
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 ||
-/* $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)
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];
(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 &&
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
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 */
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;
}
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 ||
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 ||
-/* $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
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;
-/* $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 <claudio@openbsd.org>
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);
-/* $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 <goda@openbsd.org>
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).
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)
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. */
-/* $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
{
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);
-/* $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 <reyk@openbsd.org>
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) ||
-/* $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.
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;
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);
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)))
}
/* 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;
/*
*/
/* 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' */
}
/* 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' */
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)
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);
}
/* 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' */
-/* $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 $ */
/*
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;
-/* $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 <goda@openbsd.org>
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));
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 |
}
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);
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);
-/* $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
#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) {
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),
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)) {
* 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);
/* 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)) {
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;
}
/* 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
-/* $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
/* 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)) {
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];
/* 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)) {
-/* $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 $ */
/*
}
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)
-/* $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 $ */
/*
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
-/* $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 $ */
/*
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);
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;
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
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:
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);
*/
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)
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;
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;