Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F176428917
D60738.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
55 KB
Referenced Files
None
Subscribers
None
D60738.diff
View Options
diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c
--- a/sys/net/bridgestp.c
+++ b/sys/net/bridgestp.c
@@ -259,7 +259,7 @@
bpdu.tbu_protover = 0;
bpdu.tbu_bpdutype = BSTP_MSGTYPE_TCN;
- memcpy(mtod(m, caddr_t) + sizeof(*eh), &bpdu, sizeof(bpdu));
+ memcpy(mtod(m, char *) + sizeof(*eh), &bpdu, sizeof(bpdu));
bp->bp_txcount++;
ifp->if_transmit(ifp, m);
@@ -372,7 +372,7 @@
bpdu->cbu_protover = BSTP_PROTO_STP;
m->m_pkthdr.len = sizeof(*eh) + BSTP_BPDU_STP_LEN;
eh->ether_type = htons(BSTP_BPDU_STP_LEN);
- memcpy(mtod(m, caddr_t) + sizeof(*eh), bpdu,
+ memcpy(mtod(m, char *) + sizeof(*eh), bpdu,
BSTP_BPDU_STP_LEN);
break;
@@ -381,7 +381,7 @@
bpdu->cbu_versionlen = htons(0);
m->m_pkthdr.len = sizeof(*eh) + BSTP_BPDU_RSTP_LEN;
eh->ether_type = htons(BSTP_BPDU_RSTP_LEN);
- memcpy(mtod(m, caddr_t) + sizeof(*eh), bpdu,
+ memcpy(mtod(m, char *) + sizeof(*eh), bpdu,
BSTP_BPDU_RSTP_LEN);
break;
@@ -481,7 +481,7 @@
(m = m_pullup(m, sizeof(tpdu))) == NULL)
goto out;
- memcpy(&tpdu, mtod(m, caddr_t), sizeof(tpdu));
+ memcpy(&tpdu, mtod(m, char *), sizeof(tpdu));
/* basic packet checks */
if (tpdu.tbu_dsap != LLC_8021D_LSAP ||
@@ -546,7 +546,7 @@
if ((*mp)->m_len < BSTP_BPDU_STP_LEN &&
(*mp = m_pullup(*mp, BSTP_BPDU_STP_LEN)) == NULL)
return;
- memcpy(&cpdu, mtod(*mp, caddr_t), BSTP_BPDU_STP_LEN);
+ memcpy(&cpdu, mtod(*mp, char *), BSTP_BPDU_STP_LEN);
bstp_decode_bpdu(bp, &cpdu, cu);
bstp_received_bpdu(bs, bp, cu);
@@ -567,7 +567,7 @@
if ((*mp)->m_len < BSTP_BPDU_RSTP_LEN &&
(*mp = m_pullup(*mp, BSTP_BPDU_RSTP_LEN)) == NULL)
return;
- memcpy(&cpdu, mtod(*mp, caddr_t), BSTP_BPDU_RSTP_LEN);
+ memcpy(&cpdu, mtod(*mp, char *), BSTP_BPDU_RSTP_LEN);
bstp_decode_bpdu(bp, &cpdu, cu);
bstp_received_bpdu(bs, bp, cu);
diff --git a/sys/net/if.c b/sys/net/if.c
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -257,7 +257,7 @@
#endif
#ifdef INET6
struct ifaddr *(*carp_iamatch6_p)(struct ifnet *ifp, struct in6_addr *taddr6);
-caddr_t (*carp_macmatch6_p)(struct ifnet *ifp, struct mbuf *m,
+char * (*carp_macmatch6_p)(struct ifnet *ifp, struct mbuf *m,
const struct in6_addr *taddr);
#endif
@@ -886,7 +886,7 @@
ifp->if_addr = ifa;
ifa->ifa_ifp = ifp;
ifa->ifa_addr = (struct sockaddr *)sdl;
- sdl = (struct sockaddr_dl *)(socksize + (caddr_t)sdl);
+ sdl = (struct sockaddr_dl *)((char *)sdl + socksize);
ifa->ifa_netmask = (struct sockaddr *)sdl;
sdl->sdl_len = masklen;
while (namelen != 0)
@@ -1932,8 +1932,8 @@
*/
if (ifa_maybe == NULL ||
ifa_preferred(ifa_maybe, ifa) ||
- rn_refines((caddr_t)ifa->ifa_netmask,
- (caddr_t)ifa_maybe->ifa_netmask)) {
+ rn_refines(ifa->ifa_netmask,
+ ifa_maybe->ifa_netmask)) {
ifa_maybe = ifa;
}
}
diff --git a/sys/net/if_arp.h b/sys/net/if_arp.h
--- a/sys/net/if_arp.h
+++ b/sys/net/if_arp.h
@@ -71,10 +71,10 @@
#endif
};
-#define ar_sha(ap) (((caddr_t)((ap)+1)) + 0)
-#define ar_spa(ap) (((caddr_t)((ap)+1)) + (ap)->ar_hln)
-#define ar_tha(ap) (((caddr_t)((ap)+1)) + (ap)->ar_hln + (ap)->ar_pln)
-#define ar_tpa(ap) (((caddr_t)((ap)+1)) + 2*(ap)->ar_hln + (ap)->ar_pln)
+#define ar_sha(ap) (((char *)((ap)+1)) + 0)
+#define ar_spa(ap) (((char *)((ap)+1)) + (ap)->ar_hln)
+#define ar_tha(ap) (((char *)((ap)+1)) + (ap)->ar_hln + (ap)->ar_pln)
+#define ar_tpa(ap) (((char *)((ap)+1)) + 2*(ap)->ar_hln + (ap)->ar_pln)
#define arphdr_len2(ar_hln, ar_pln) \
(sizeof(struct arphdr) + 2*(ar_hln) + 2*(ar_pln))
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -4045,12 +4045,12 @@
}
/* Strip off the Ethernet header and keep a copy. */
- m_copydata(*mp, 0, ETHER_HDR_LEN, (caddr_t) &eh2);
+ m_copydata(*mp, 0, ETHER_HDR_LEN, &eh2);
m_adj(*mp, ETHER_HDR_LEN);
/* Strip off snap header, if present */
if (snap) {
- m_copydata(*mp, 0, sizeof(struct llc), (caddr_t) &llc1);
+ m_copydata(*mp, 0, sizeof(struct llc), &llc1);
m_adj(*mp, sizeof(struct llc));
}
@@ -4186,13 +4186,13 @@
M_PREPEND(*mp, sizeof(struct llc), M_NOWAIT);
if (*mp == NULL)
return (error);
- bcopy(&llc1, mtod(*mp, caddr_t), sizeof(struct llc));
+ bcopy(&llc1, mtod(*mp, void *), sizeof(struct llc));
}
M_PREPEND(*mp, ETHER_HDR_LEN, M_NOWAIT);
if (*mp == NULL)
return (error);
- bcopy(&eh2, mtod(*mp, caddr_t), ETHER_HDR_LEN);
+ bcopy(&eh2, mtod(*mp, void *), ETHER_HDR_LEN);
return (0);
@@ -4226,7 +4226,7 @@
if (*mp == NULL)
return (-1);
- if (IP_HDR_ALIGNED_P(mtod(m, caddr_t)) == 0) {
+ if (IP_HDR_ALIGNED_P(mtod(m, char *)) == 0) {
if ((m = m_copyup(m, sizeof(struct ip),
(max_linkhdr + 3) & ~3)) == NULL) {
/* XXXJRT new stat, please */
@@ -4323,7 +4323,7 @@
* it. Otherwise, if it is aligned, make sure the entire base
* IPv6 header is in the first mbuf of the chain.
*/
- if (IP6_HDR_ALIGNED_P(mtod(m, caddr_t)) == 0) {
+ if (IP6_HDR_ALIGNED_P(mtod(m, char *)) == 0) {
struct ifnet *inifp = m->m_pkthdr.rcvif;
if ((m = m_copyup(m, sizeof(struct ip6_hdr),
(max_linkhdr + 3) & ~3)) == NULL) {
@@ -4401,7 +4401,7 @@
mprev->m_nextpkt = nextpkt;
goto dropit;
}
- bcopy(llc, mtod(mcur, caddr_t),sizeof(struct llc));
+ bcopy(llc, mtod(mcur, void *), sizeof(struct llc));
}
M_PREPEND(mcur, ETHER_HDR_LEN, M_NOWAIT);
@@ -4412,7 +4412,7 @@
mprev->m_nextpkt = nextpkt;
goto dropit;
}
- bcopy(eh, mtod(mcur, caddr_t), ETHER_HDR_LEN);
+ bcopy(eh, mtod(mcur, void *), ETHER_HDR_LEN);
/*
* The previous two M_PREPEND could have inserted one or two
diff --git a/sys/net/if_bridgevar.h b/sys/net/if_bridgevar.h
--- a/sys/net/if_bridgevar.h
+++ b/sys/net/if_bridgevar.h
@@ -194,7 +194,7 @@
struct ifbifconf {
uint32_t ifbic_len; /* buffer size */
union {
- caddr_t ifbicu_buf;
+ char *ifbicu_buf;
struct ifbreq *ifbicu_req;
} ifbic_ifbicu;
#define ifbic_buf ifbic_ifbicu.ifbicu_buf
@@ -225,7 +225,7 @@
struct ifbaconf {
uint32_t ifbac_len; /* buffer size */
union {
- caddr_t ifbacu_buf;
+ char *ifbacu_buf;
struct ifbareq *ifbacu_req;
} ifbac_ifbacu;
#define ifbac_buf ifbac_ifbacu.ifbacu_buf
@@ -292,7 +292,7 @@
struct ifbpstpconf {
uint32_t ifbpstp_len; /* buffer size */
union {
- caddr_t ifbpstpu_buf;
+ char *ifbpstpu_buf;
struct ifbpstpreq *ifbpstpu_req;
} ifbpstp_ifbpstpu;
#define ifbpstp_buf ifbpstp_ifbpstpu.ifbpstpu_buf
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1237,7 +1237,7 @@
*/
if (data != NULL) {
mv.m_next = m;
- mv.m_data = (caddr_t)&vlan;
+ mv.m_data = (char *)&vlan;
mv.m_len = sizeof(vlan);
mb.m_next = &mv;
mb.m_data = data;
diff --git a/sys/net/if_geneve.c b/sys/net/if_geneve.c
--- a/sys/net/if_geneve.c
+++ b/sys/net/if_geneve.c
@@ -2489,7 +2489,7 @@
switch (proto) {
case ETHERTYPE_IP:
if (__predict_false(m->m_len < offset + sizeof(struct ip))) {
- m_copydata(m, offset, sizeof(struct ip), (caddr_t)&iphdr);
+ m_copydata(m, offset, sizeof(struct ip), &iphdr);
ip_inner = &iphdr;
} else
ip_inner = mtodo(m, offset);
@@ -2503,7 +2503,7 @@
case ETHERTYPE_IPV6:
if (__predict_false(m->m_len < offset + sizeof(struct ip6_hdr))) {
- m_copydata(m, offset, sizeof(struct ip6_hdr), (caddr_t)&ip6hdr);
+ m_copydata(m, offset, sizeof(struct ip6_hdr), &ip6hdr);
ip6_inner = &ip6hdr;
} else
ip6_inner = mtodo(m, offset);
@@ -2996,7 +2996,7 @@
/* Get geneve header */
offset += sizeof(struct udphdr);
if (__predict_false(m->m_len < offset + sizeof(struct genevehdr))) {
- m_copydata(m, offset, sizeof(struct genevehdr), (caddr_t)&gnvhdr);
+ m_copydata(m, offset, sizeof(struct genevehdr), &gnvhdr);
gnvh = &gnvhdr;
} else
gnvh = mtodo(m, offset);
diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c
--- a/sys/net/if_ovpn.c
+++ b/sys/net/if_ovpn.c
@@ -2466,7 +2466,7 @@
if (m_length(m, NULL) < (off + sizeof(struct udphdr) + hdrlen))
return (NULL);
- m_copydata(m, off + sizeof(struct udphdr), hdrlen, (caddr_t)&ohdr);
+ m_copydata(m, off + sizeof(struct udphdr), hdrlen, &ohdr);
peerid = ntohl(ohdr.opcode) & 0x00ffffff;
@@ -2512,7 +2512,7 @@
return (false);
}
- m_copydata(m, off + sizeof(*uhdr), ohdrlen, (caddr_t)&tmphdr);
+ m_copydata(m, off + sizeof(*uhdr), ohdrlen, &tmphdr);
op = ntohl(tmphdr.opcode) >> 24 >> OVPN_OP_SHIFT;
if (op != OVPN_OP_DATA_V2) {
diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c
--- a/sys/net/if_stf.c
+++ b/sys/net/if_stf.c
@@ -390,7 +390,7 @@
if (proto != IPPROTO_IPV6)
return (0);
- m_copydata(m, 0, sizeof(ip), (caddr_t)&ip);
+ m_copydata(m, 0, sizeof(ip), &ip);
if (ip.ip_v != 4)
return (0);
@@ -735,7 +735,7 @@
return (IPPROTO_DONE);
}
- m_copydata(m, 0, sizeof(struct ip), (caddr_t)&ip);
+ m_copydata(m, 0, sizeof(struct ip), &ip);
if (sc == NULL || (STF2IFP(sc)->if_flags & IFF_UP) == 0) {
m_freem(m);
SDT_PROBE2(if_stf, , stf_input, out, IPPROTO_DONE, __LINE__);
diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c
--- a/sys/net/if_vxlan.c
+++ b/sys/net/if_vxlan.c
@@ -2825,8 +2825,7 @@
goto out;
if (__predict_false(m->m_len < offset + sizeof(struct vxlan_header))) {
- m_copydata(m, offset, sizeof(struct vxlan_header),
- (caddr_t) &vxlanhdr);
+ m_copydata(m, offset, sizeof(struct vxlan_header), &vxlanhdr);
vxh = &vxlanhdr;
} else
vxh = mtodo(m, offset);
diff --git a/sys/net/iflib.h b/sys/net/iflib.h
--- a/sys/net/iflib.h
+++ b/sys/net/iflib.h
@@ -239,7 +239,7 @@
uint32_t __spare6__;
uint32_t __spare7__;
uint32_t __spare8__;
- caddr_t __spare9__;
+ void *__spare9__;
int isc_disable_msix;
if_txrx_t isc_txrx;
struct ifmedia *isc_media;
diff --git a/sys/net/pfkeyv2.h b/sys/net/pfkeyv2.h
--- a/sys/net/pfkeyv2.h
+++ b/sys/net/pfkeyv2.h
@@ -460,7 +460,7 @@
#define PFKEY_ADDR_PROTO(ext) \
(((const struct sadb_address *)(ext))->sadb_address_proto)
#define PFKEY_ADDR_SADDR(ext) \
- ((const struct sockaddr *)((c_caddr_t)(ext) + sizeof(struct sadb_address)))
+ ((const struct sockaddr *)((const char *)(ext) + sizeof(struct sadb_address)))
/* in 64bits */
#define PFKEY_UNUNIT64(a) ((a) << 3)
diff --git a/sys/net/radix.h b/sys/net/radix.h
--- a/sys/net/radix.h
+++ b/sys/net/radix.h
@@ -151,11 +151,11 @@
#ifndef _KERNEL
#define R_Malloc(p, t, n) (p = (t) malloc((unsigned int)(n)))
#define R_Zalloc(p, t, n) (p = (t) calloc(1,(unsigned int)(n)))
-#define R_Free(p) free((char *)p);
+#define R_Free(p) free(p);
#else
#define R_Malloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_NOWAIT))
#define R_Zalloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_NOWAIT | M_ZERO))
-#define R_Free(p) free((caddr_t)p, M_RTABLE);
+#define R_Free(p) free(p, M_RTABLE);
#define RADIX_NODE_HEAD_RLOCK_TRACKER struct rm_priotracker _rnh_tracker
#define RADIX_NODE_HEAD_LOCK_INIT(rnh) \
diff --git a/sys/net/route.c b/sys/net/route.c
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -601,7 +601,7 @@
while (cp2 < cplim)
*cp2++ = *cp1++ & *cp3++;
if (cp2 < cplim2)
- bzero((caddr_t)cp2, (unsigned)(cplim2 - cp2));
+ bzero(cp2, (unsigned)(cplim2 - cp2));
}
/*
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -695,7 +695,7 @@
* link-local address because rtrequest requires addresses with
* embedded scope id.
*/
- if (rt_xaddrs((caddr_t)(rtm + 1), len + (caddr_t)rtm, info))
+ if (rt_xaddrs((char *)(rtm + 1), (char *)rtm + len, info))
return (EINVAL);
info->rti_flags = rtm->rtm_flags;
@@ -1106,7 +1106,7 @@
if ((rtm = malloc(total_len, M_TEMP, M_NOWAIT)) == NULL)
senderr(ENOBUFS);
- m_copydata(m, 0, len, (caddr_t)rtm);
+ m_copydata(m, 0, len, rtm);
bzero(&info, sizeof(info));
nh = NULL;
struct linear_buffer lb = {
@@ -1294,7 +1294,7 @@
else
rtm->rtm_flags |= RTF_DONE;
- m_copyback(m, 0, rtm->rtm_msglen, (caddr_t)rtm);
+ m_copyback(m, 0, rtm->rtm_msglen, rtm);
if (m->m_pkthdr.len < rtm->rtm_msglen) {
m_freem(m);
m = NULL;
@@ -1753,7 +1753,7 @@
m->m_pkthdr.len = m->m_len = len;
rtm = mtod(m, struct rt_msghdr *);
- bzero((caddr_t)rtm, len);
+ bzero(rtm, len);
for (i = 0; i < RTAX_MAX; i++) {
if ((sa = rtinfo->rti_info[i]) == NULL)
continue;
@@ -1771,7 +1771,7 @@
(void)sa6_recoverscope(sin6);
}
#endif
- m_copyback(m, len, dlen, (caddr_t)sa);
+ m_copyback(m, len, dlen, sa);
len += dlen;
}
if (m->m_pkthdr.len != len) {
@@ -1881,7 +1881,7 @@
(void)sa6_recoverscope(sin6);
}
#endif
- bcopy((caddr_t)sa, cp, (unsigned)dlen);
+ bcopy(sa, cp, (unsigned)dlen);
cp += dlen;
buflen -= dlen;
} else if (cp != NULL) {
@@ -1976,7 +1976,7 @@
if (V_route_cb.any_count == 0)
return;
- bzero((caddr_t)&info, sizeof(info));
+ bzero(&info, sizeof(info));
m = rtsock_msg_mbuf(RTM_IFINFO, &info);
if (m == NULL)
return;
@@ -2010,7 +2010,7 @@
ncmd = cmd == RTM_ADD ? RTM_NEWADDR : RTM_DELADDR;
- bzero((caddr_t)&info, sizeof(info));
+ bzero(&info, sizeof(info));
info.rti_info[RTAX_IFA] = sa = ifa->ifa_addr;
info.rti_info[RTAX_IFP] = ifp->if_addr->ifa_addr;
info.rti_info[RTAX_NETMASK] = rtsock_fix_netmask(
@@ -2056,7 +2056,7 @@
init_sockaddrs_family(family, &dst.sa, &mask.sa);
export_rtaddrs(rt, &dst.sa, &mask.sa);
- bzero((caddr_t)&info, sizeof(info));
+ bzero(&info, sizeof(info));
info.rti_info[RTAX_DST] = &dst.sa;
info.rti_info[RTAX_NETMASK] = &mask.sa;
info.rti_info[RTAX_GATEWAY] = &nh->gw_sa;
@@ -2123,7 +2123,7 @@
if (V_route_cb.any_count == 0)
return;
- bzero((caddr_t)&info, sizeof(info));
+ bzero(&info, sizeof(info));
info.rti_info[RTAX_IFA] = ifma->ifma_addr;
if (ifp && ifp->if_addr)
info.rti_info[RTAX_IFP] = ifp->if_addr->ifa_addr;
@@ -2154,7 +2154,7 @@
if (V_route_cb.any_count == 0)
return NULL;
- bzero((caddr_t)info, sizeof(*info));
+ bzero(info, sizeof(*info));
m = rtsock_msg_mbuf(type, info);
if (m != NULL) {
ifan = mtod(m, struct if_announcemsghdr *);
@@ -2284,7 +2284,7 @@
if (w->w_op == NET_RT_FLAGS && !(rtflags & w->w_arg))
return (0);
- bzero((caddr_t)&info, sizeof(info));
+ bzero(&info, sizeof(info));
info.rti_info[RTAX_DST] = w->dst;
info.rti_info[RTAX_GATEWAY] = &nh->gw_sa;
info.rti_info[RTAX_NETMASK] = (rtflags & RTF_HOST) ? NULL : w->mask;
@@ -2316,7 +2316,7 @@
rtm->rtm_rmx.rmx_weight = weight;
rtm->rtm_index = nh->nh_ifp->if_index;
rtm->rtm_addrs = info.rti_addrs;
- error = SYSCTL_OUT(w->w_req, (caddr_t)rtm, size);
+ error = SYSCTL_OUT(w->w_req, rtm, size);
return (error);
}
return (error);
@@ -2359,7 +2359,7 @@
memcpy(ifd, src_ifd, sizeof(*ifd));
- return (SYSCTL_OUT(w->w_req, (caddr_t)ifm, len));
+ return (SYSCTL_OUT(w->w_req, ifm, len));
}
static int
@@ -2393,7 +2393,7 @@
memcpy(ifd, src_ifd, sizeof(*ifd));
- return (SYSCTL_OUT(w->w_req, (caddr_t)ifm, len));
+ return (SYSCTL_OUT(w->w_req, ifm, len));
}
static int
@@ -2472,7 +2472,7 @@
int len, error = 0;
struct sockaddr_storage ss;
- bzero((caddr_t)&info, sizeof(info));
+ bzero(&info, sizeof(info));
bzero(&ifd, sizeof(ifd));
CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) {
if (w->w_arg && w->w_arg != ifp->if_index)
@@ -2538,7 +2538,7 @@
NET_EPOCH_ASSERT();
error = 0;
- bzero((caddr_t)&info, sizeof(info));
+ bzero(&info, sizeof(info));
CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) {
if (w->w_arg && w->w_arg != ifp->if_index)
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -396,7 +396,7 @@
m->m_pkthdr.len = m->m_len;
M_ALIGN(m, m->m_len);
ah = mtod(m, struct arphdr *);
- bzero((caddr_t)ah, m->m_len);
+ bzero(ah, m->m_len);
#ifdef MAC
mac_netinet_arp_send(ifp, m);
#endif
diff --git a/sys/netinet/in_rss.c b/sys/netinet/in_rss.c
--- a/sys/netinet/in_rss.c
+++ b/sys/netinet/in_rss.c
@@ -316,7 +316,7 @@
RSS_DEBUG("short TCP frame?\n");
return (-1);
}
- th = (const struct tcphdr *)((c_caddr_t)ip + iphlen);
+ th = (const struct tcphdr *)((const char *)ip + iphlen);
return rss_proto_software_hash_v4(ip->ip_src, ip->ip_dst,
th->th_sport,
th->th_dport,
@@ -326,7 +326,7 @@
} else if ((rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV4) &&
(proto == IPPROTO_UDP) &&
(is_frag == 0)) {
- uh = (const struct udphdr *)((c_caddr_t)ip + iphlen);
+ uh = (const struct udphdr *)((const char *)ip + iphlen);
if (m->m_len < iphlen + sizeof(struct udphdr)) {
RSS_DEBUG("short UDP frame?\n");
return (-1);
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1408,7 +1408,7 @@
in = (struct sockaddr_in *)sc->sc_ifas[i]->ifa_addr;
if (m_append(m, sizeof(in->sin_addr),
- (caddr_t)&in->sin_addr) != 1) {
+ &in->sin_addr) != 1) {
m_freem(m);
goto resched;
}
diff --git a/sys/netinet/ip_fastfwd.c b/sys/netinet/ip_fastfwd.c
--- a/sys/netinet/ip_fastfwd.c
+++ b/sys/netinet/ip_fastfwd.c
@@ -186,7 +186,7 @@
}
mcopy->m_len = min(ip_len, M_TRAILINGSPACE(mcopy));
mcopy->m_pkthdr.len = mcopy->m_len;
- m_copydata(m, 0, mcopy->m_len, mtod(mcopy, caddr_t));
+ m_copydata(m, 0, mcopy->m_len, mtod(mcopy, void *));
return (mcopy);
}
diff --git a/sys/netinet/ip_gre.c b/sys/netinet/ip_gre.c
--- a/sys/netinet/ip_gre.c
+++ b/sys/netinet/ip_gre.c
@@ -528,7 +528,7 @@
m_copydata(m, hlen + offsetof(struct ip, ip_tos),
sizeof(u_char), &gi->gi_ip.ip_tos);
m_copydata(m, hlen + offsetof(struct ip, ip_id),
- sizeof(u_short), (caddr_t)&gi->gi_ip.ip_id);
+ sizeof(u_short), &gi->gi_ip.ip_id);
break;
#ifdef INET6
case AF_INET6:
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -244,7 +244,7 @@
if (oip->ip_off & htons(~(IP_MF|IP_DF)))
goto freeit;
if (oip->ip_p == IPPROTO_ICMP && type != ICMP_REDIRECT &&
- !ICMP_INFOTYPE(((struct icmp *)((caddr_t)oip +
+ !ICMP_INFOTYPE(((struct icmp *)((char *)oip +
oiphlen))->icmp_type)) {
ICMPSTAT_INC(icps_oldicmp);
goto freeit;
@@ -367,7 +367,7 @@
* Copy the quotation into ICMP message and
* convert quoted IP header back to network representation.
*/
- m_copydata(n, 0, icmplen, (caddr_t)&icp->icmp_ip);
+ m_copydata(n, 0, icmplen, &icp->icmp_ip);
nip = &icp->icmp_ip;
/*
@@ -384,7 +384,7 @@
m->m_pkthdr.len = m->m_len;
m->m_pkthdr.rcvif = n->m_pkthdr.rcvif;
nip = mtod(m, struct ip *);
- bcopy((caddr_t)oip, (caddr_t)nip, sizeof(struct ip));
+ bcopy(oip, nip, sizeof(struct ip));
nip->ip_len = htons(m->m_len);
nip->ip_v = IPVERSION;
nip->ip_hl = 5;
@@ -911,18 +911,17 @@
*/
if (opt == IPOPT_RR || opt == IPOPT_TS ||
opt == IPOPT_SECURITY) {
- bcopy((caddr_t)cp,
- mtod(opts, caddr_t) + opts->m_len, len);
- opts->m_len += len;
+ bcopy(cp, mtod(opts, char *) +
+ opts->m_len, len);
+ opts->m_len += len;
}
}
/* Terminate & pad, if necessary */
cnt = opts->m_len % 4;
if (cnt) {
for (; cnt < 4; cnt++) {
- *(mtod(opts, caddr_t) + opts->m_len) =
- IPOPT_EOL;
- opts->m_len++;
+ *(mtod(opts, char *) + opts->m_len) = IPOPT_EOL;
+ opts->m_len++;
}
}
#ifdef ICMPPRINTFS
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1017,7 +1017,7 @@
if (mcopy != NULL) {
mcopy->m_len = min(ntohs(ip->ip_len), M_TRAILINGSPACE(mcopy));
mcopy->m_pkthdr.len = mcopy->m_len;
- m_copydata(m, 0, mcopy->m_len, mtod(mcopy, caddr_t));
+ m_copydata(m, 0, mcopy->m_len, mtod(mcopy, char *));
}
#ifdef IPSTEALTH
if (V_ipstealth == 0)
@@ -1182,7 +1182,7 @@
} else {
microtime(&tv);
}
- *mp = sbcreatecontrol((caddr_t)&tv, sizeof(tv), SCM_TIMESTAMP,
+ *mp = sbcreatecontrol(&tv, sizeof(tv), SCM_TIMESTAMP,
SOL_SOCKET, M_NOWAIT);
if (*mp != NULL) {
mp = &(*mp)->m_next;
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -477,7 +477,7 @@
} else {
error = sooptcopyin(sopt, &mfc, sizeof(struct mfcctl),
sizeof(struct mfcctl));
- bzero((caddr_t)&mfc + sizeof(struct mfcctl),
+ bzero((char *)&mfc + sizeof(struct mfcctl),
sizeof(mfc) - sizeof(struct mfcctl));
}
if (error)
@@ -1088,7 +1088,7 @@
mtx_destroy(&vifp->v_mtx);
- bzero((caddr_t)vifp, sizeof (*vifp));
+ bzero(vifp, sizeof(*vifp));
CTR2(KTR_IPMF, "%s: delete vif %d", __func__, (int)vifi);
@@ -2286,10 +2286,10 @@
return;
}
- m_copyback(m, 0, sizeof(struct igmpmsg), (caddr_t)&igmpmsg);
+ m_copyback(m, 0, sizeof(struct igmpmsg), &igmpmsg);
len += sizeof(struct igmpmsg);
while ((bu = buf_ring_dequeue_mc(mfct->bw_upcalls)) != NULL) {
- m_copyback(m, len, sizeof(struct bw_upcall), (caddr_t)bu);
+ m_copyback(m, len, sizeof(struct bw_upcall), bu);
len += sizeof(struct bw_upcall);
free(bu, M_MRTABLE);
}
@@ -2538,7 +2538,7 @@
if (ip->ip_off & htons(IP_DF))
ip_outer->ip_off |= htons(IP_DF);
ip_fillid(ip_outer, V_ip_random_id);
- pimhdr = (struct pim_encap_pimhdr *)((caddr_t)ip_outer
+ pimhdr = (struct pim_encap_pimhdr *)((char *)ip_outer
+ sizeof(pim_encap_iphdr));
*pimhdr = pim_encap_pimhdr;
/* If the iif crosses a border, set the Border-bit */
diff --git a/sys/netinet/ip_options.c b/sys/netinet/ip_options.c
--- a/sys/netinet/ip_options.c
+++ b/sys/netinet/ip_options.c
@@ -453,9 +453,9 @@
*/
opts->ip_srcrt.nop = IPOPT_NOP;
opts->ip_srcrt.srcopt[IPOPT_OFFSET] = IPOPT_MINOFF;
- (void)memcpy(mtod(m, caddr_t) + sizeof(struct in_addr),
+ (void)memcpy(mtod(m, char *) + sizeof(struct in_addr),
&(opts->ip_srcrt.nop), OPTSIZ);
- q = (struct in_addr *)(mtod(m, caddr_t) +
+ q = (struct in_addr *)(mtod(m, char *) +
sizeof(struct in_addr) + OPTSIZ);
#undef OPTSIZ
/*
@@ -675,7 +675,7 @@
/*
* Move first hop before start of options.
*/
- bcopy((caddr_t)&cp[IPOPT_OFFSET+1], mtod(m, caddr_t),
+ bcopy(&cp[IPOPT_OFFSET+1], mtod(m, void *),
sizeof(struct in_addr));
/*
* Then copy rest of options back
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1058,7 +1058,7 @@
/* if udp header is not in the first mbuf copy udplen */
if (offset + sizeof(struct udphdr) > m->m_len) {
m_copydata(m, offset + offsetof(struct udphdr,
- uh_ulen), sizeof(cklen), (caddr_t)&cklen);
+ uh_ulen), sizeof(cklen), &cklen);
cklen = ntohs(cklen);
} else {
uh = (struct udphdr *)mtodo(m, offset);
@@ -1074,7 +1074,7 @@
offset += m->m_pkthdr.csum_data; /* checksum offset */
if (offset + sizeof(csum) > m->m_len)
- m_copyback(m, offset, sizeof(csum), (caddr_t)&csum);
+ m_copyback(m, offset, sizeof(csum), &csum);
else
*(u_short *)mtodo(m, offset) = csum;
}
diff --git a/sys/netinet/libalias/alias.c b/sys/netinet/libalias/alias.c
--- a/sys/netinet/libalias/alias.c
+++ b/sys/netinet/libalias/alias.c
@@ -1818,7 +1818,7 @@
goto bad;
m_align(mcl, len);
m_move_pkthdr(mcl, m);
- m_copydata(m, 0, len, mtod(mcl, caddr_t));
+ m_copydata(m, 0, len, mtod(mcl, void *));
mcl->m_len = mcl->m_pkthdr.len = len;
m_freem(m);
diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c
--- a/sys/netinet/siftr.c
+++ b/sys/netinet/siftr.c
@@ -754,7 +754,7 @@
* in 4-byte words, so multiply it to get the size in bytes.
*/
ip_hl = (ip->ip_hl << 2);
- th = (struct tcphdr *)((caddr_t)ip + ip_hl);
+ th = (struct tcphdr *)((char *)ip + ip_hl);
/*
* Only pkts selected by the tcp port filter
@@ -905,7 +905,7 @@
* in the ipv6 packet.
*/
ip6_hl = sizeof(struct ip6_hdr);
- th = (struct tcphdr *)((caddr_t)ip6 + ip6_hl);
+ th = (struct tcphdr *)((char *)ip6 + ip6_hl);
/*
* Only pkts selected by the tcp port filter
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -638,7 +638,7 @@
isipv6 = mtod(m, struct ip *)->ip_v == 6;
if (isipv6) {
ip6 = mtod(m, struct ip6_hdr *);
- th = (struct tcphdr *)((caddr_t)ip6 + off0);
+ th = (struct tcphdr *)((char *)ip6 + off0);
tlen = sizeof(*ip6) + ntohs(ip6->ip6_plen) - off0;
if (port)
goto skip6_csum;
@@ -700,7 +700,7 @@
}
}
ip = mtod(m, struct ip *);
- th = (struct tcphdr *)((caddr_t)ip + off0);
+ th = (struct tcphdr *)((char *)ip + off0);
tlen = ntohs(ip->ip_len) - off0;
iptos = ip->ip_tos;
@@ -775,7 +775,7 @@
return (IPPROTO_DONE);
}
ip6 = mtod(m, struct ip6_hdr *);
- th = (struct tcphdr *)((caddr_t)ip6 + off0);
+ th = (struct tcphdr *)((char *)ip6 + off0);
}
}
#endif
@@ -791,7 +791,7 @@
return (IPPROTO_DONE);
}
ip = mtod(m, struct ip *);
- th = (struct tcphdr *)((caddr_t)ip + off0);
+ th = (struct tcphdr *)((char *)ip + off0);
}
}
#endif
@@ -3588,7 +3588,7 @@
while (cnt >= 0) {
if (m->m_len > cnt) {
- char *cp = mtod(m, caddr_t) + cnt;
+ char *cp = mtod(m, char *) + cnt;
struct tcpcb *tp = sototcpcb(so);
INP_WLOCK_ASSERT(tptoinpcb(tp));
diff --git a/sys/netinet/tcp_log_buf.c b/sys/netinet/tcp_log_buf.c
--- a/sys/netinet/tcp_log_buf.c
+++ b/sys/netinet/tcp_log_buf.c
@@ -2266,10 +2266,10 @@
INP_WUNLOCK(inp);
} else {
/* Sanity check entries */
- KASSERT(((caddr_t)out_entry - (caddr_t)sopt->sopt_val) ==
+ KASSERT(((char *)out_entry - (char *)sopt->sopt_val) ==
outsize, ("%s: Actual output size (%zu) != "
"calculated output size (%zu)", __func__,
- (size_t)((caddr_t)out_entry - (caddr_t)sopt->sopt_val),
+ (size_t)((char *)out_entry - (char *)sopt->sopt_val),
outsize));
/* Free the entries we just copied out. */
@@ -2279,8 +2279,8 @@
}
}
- sopt->sopt_valsize = (size_t)((caddr_t)out_entry -
- (caddr_t)sopt->sopt_val);
+ sopt->sopt_valsize = (size_t)((char *)out_entry -
+ (char *)sopt->sopt_val);
return (error);
}
diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c
--- a/sys/netinet/tcp_lro.c
+++ b/sys/netinet/tcp_lro.c
@@ -426,9 +426,10 @@
break;
/* Try to parse inner headers. */
- data_ptr = tcp_lro_low_level_parser(data_ptr, pi, update_data, true,
- (m->m_len - ((caddr_t)data_ptr - m->m_data)));
- if (data_ptr == NULL || (pi->total_hdr_len + po->total_hdr_len) > m->m_len)
+ data_ptr = tcp_lro_low_level_parser(data_ptr, pi, update_data,
+ true, (m->m_len - ((char *)data_ptr - m->m_data)));
+ if (data_ptr == NULL ||
+ (pi->total_hdr_len + po->total_hdr_len) > m->m_len)
break;
/* Verify supported header types. */
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -1077,8 +1077,7 @@
*/
mb = sbsndptr_noadv(&so->so_snd, off, &moff);
if (len <= MHLEN - hdrlen - max_linkhdr && !hw_tls) {
- m_copydata(mb, moff, len,
- mtod(m, caddr_t) + hdrlen);
+ m_copydata(mb, moff, len, mtod(m, char *) + hdrlen);
if (SEQ_LT(tp->snd_nxt, tp->snd_max))
sbsndptr_adv(&so->so_snd, mb, len);
m->m_len += len;
@@ -1158,7 +1157,8 @@
if (isipv6) {
ip6 = mtod(m, struct ip6_hdr *);
if (tp->t_port) {
- udp = (struct udphdr *)((caddr_t)ip6 + sizeof(struct ip6_hdr));
+ udp = (struct udphdr *)((char *)ip6 +
+ sizeof(struct ip6_hdr));
udp->uh_sport = htons(V_tcp_udp_tunneling_port);
udp->uh_dport = tp->t_port;
ulen = hdrlen + len - sizeof(struct ip6_hdr);
@@ -1173,7 +1173,7 @@
{
ip = mtod(m, struct ip *);
if (tp->t_port) {
- udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip));
+ udp = (struct udphdr *)((char *)ip + sizeof(struct ip));
udp->uh_sport = htons(V_tcp_udp_tunneling_port);
udp->uh_dport = tp->t_port;
ulen = hdrlen + len - sizeof(struct ip);
@@ -2098,7 +2098,7 @@
n->m_data = m->m_data + off;
mb_dupcl(n, m);
} else
- bcopy(mtod(m, caddr_t)+off, mtod(n, caddr_t),
+ bcopy(mtod(m, char *) + off, mtod(n, char *),
(u_int)n->m_len);
if (sb && (sb->sb_sndptr == m) &&
diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c
--- a/sys/netinet/tcp_stacks/bbr.c
+++ b/sys/netinet/tcp_stacks/bbr.c
@@ -13138,7 +13138,7 @@
mb = sbsndptr_noadv(sb, sb_offset, &moff);
if (len <= MHLEN - hdrlen - max_linkhdr && !hw_tls) {
m_copydata(mb, moff, (int)len,
- mtod(m, caddr_t)+hdrlen);
+ mtod(m, char *)+hdrlen);
if (rsm == NULL)
sbsndptr_adv(sb, mb, len);
m->m_len += len;
@@ -13253,7 +13253,8 @@
if (isipv6) {
ip6 = mtod(m, struct ip6_hdr *);
if (tp->t_port) {
- udp = (struct udphdr *)((caddr_t)ip6 + sizeof(struct ip6_hdr));
+ udp = (struct udphdr *)((char *)ip6 +
+ sizeof(struct ip6_hdr));
udp->uh_sport = htons(V_tcp_udp_tunneling_port);
udp->uh_dport = tp->t_port;
ulen = hdrlen + len - sizeof(struct ip6_hdr);
@@ -13268,7 +13269,7 @@
{
ip = mtod(m, struct ip *);
if (tp->t_port) {
- udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip));
+ udp = (struct udphdr *)((char *)ip + sizeof(struct ip));
udp->uh_sport = htons(V_tcp_udp_tunneling_port);
udp->uh_dport = tp->t_port;
ulen = hdrlen + len - sizeof(struct ip);
diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -13946,7 +13946,8 @@
ip6 = (struct ip6_hdr *)rack->r_ctl.fsb.tcp_ip_hdr;
if (tp->t_port) {
rack->r_ctl.fsb.tcp_ip_hdr_len += sizeof(struct udphdr);
- udp = (struct udphdr *)((caddr_t)ip6 + sizeof(struct ip6_hdr));
+ udp = (struct udphdr *)((char *)ip6 +
+ sizeof(struct ip6_hdr));
udp->uh_sport = htons(V_tcp_udp_tunneling_port);
udp->uh_dport = tp->t_port;
rack->r_ctl.fsb.udp = udp;
@@ -13968,7 +13969,7 @@
ip = (struct ip *)rack->r_ctl.fsb.tcp_ip_hdr;
if (tp->t_port) {
rack->r_ctl.fsb.tcp_ip_hdr_len += sizeof(struct udphdr);
- udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip));
+ udp = (struct udphdr *)((char *)ip + sizeof(struct ip));
udp->uh_sport = htons(V_tcp_udp_tunneling_port);
udp->uh_dport = tp->t_port;
rack->r_ctl.fsb.udp = udp;
@@ -18117,7 +18118,7 @@
n->m_data = m->m_data + off;
mb_dupcl(n, m);
} else {
- bcopy(mtod(m, caddr_t)+off, mtod(n, caddr_t),
+ bcopy(mtod(m, char *) + off, mtod(n, char *),
(u_int)n->m_len);
}
len -= n->m_len;
@@ -21412,7 +21413,7 @@
s_moff = moff;
if (len <= MHLEN - hdrlen - max_linkhdr && !hw_tls) {
m_copydata(mb, moff, (int)len,
- mtod(m, caddr_t)+hdrlen);
+ mtod(m, char *) + hdrlen);
/*
* If we are not retransmitting advance the
* sndptr to help remember the next place in
@@ -21547,7 +21548,8 @@
if (isipv6) {
ip6 = mtod(m, struct ip6_hdr *);
if (tp->t_port) {
- udp = (struct udphdr *)((caddr_t)ip6 + sizeof(struct ip6_hdr));
+ udp = (struct udphdr *)((char *)ip6 +
+ sizeof(struct ip6_hdr));
udp->uh_sport = htons(V_tcp_udp_tunneling_port);
udp->uh_dport = tp->t_port;
ulen = hdrlen + len - sizeof(struct ip6_hdr);
@@ -21562,7 +21564,8 @@
#ifdef INET
ip = mtod(m, struct ip *);
if (tp->t_port) {
- udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip));
+ udp = (struct udphdr *)((char *)ip +
+ sizeof(struct ip));
udp->uh_sport = htons(V_tcp_udp_tunneling_port);
udp->uh_dport = tp->t_port;
ulen = hdrlen + len - sizeof(struct ip);
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -595,7 +595,7 @@
return (true);
}
iph = mtod(m, struct ip *);
- uh = (struct udphdr *)((caddr_t)iph + off);
+ uh = (struct udphdr *)((char *)iph + off);
th = (struct tcphdr *)(uh + 1);
thlen = th->th_off << 2;
if (m->m_len < off + sizeof(struct udphdr) + thlen) {
@@ -605,7 +605,7 @@
return (true);
} else {
iph = mtod(m, struct ip *);
- uh = (struct udphdr *)((caddr_t)iph + off);
+ uh = (struct udphdr *)((char *)iph + off);
th = (struct tcphdr *)(uh + 1);
}
}
@@ -1796,8 +1796,7 @@
m->m_data += max_linkhdr;
#ifdef INET6
if (isipv6) {
- bcopy((caddr_t)ip6, mtod(m, caddr_t),
- sizeof(struct ip6_hdr));
+ bcopy(ip6, mtod(m, char *), sizeof(struct ip6_hdr));
ip6 = mtod(m, struct ip6_hdr *);
nth = (struct tcphdr *)(ip6 + 1);
if (port) {
@@ -1810,7 +1809,7 @@
} else
#endif /* INET6 */
{
- bcopy((caddr_t)ip, mtod(m, caddr_t), sizeof(struct ip));
+ bcopy(ip, mtod(m, char *), sizeof(struct ip));
ip = mtod(m, struct ip *);
nth = (struct tcphdr *)(ip + 1);
if (port) {
@@ -1821,7 +1820,7 @@
nth = (struct tcphdr *)(uh + 1);
}
}
- bcopy((caddr_t)th, (caddr_t)nth, sizeof(struct tcphdr));
+ bcopy(th, nth, sizeof(struct tcphdr));
flags = TH_ACK;
} else if ((!M_WRITABLE(m)) || (port != 0)) {
struct mbuf *n;
@@ -1844,8 +1843,7 @@
#define xchg(a,b,type) { type t; t=a; a=b; b=t; }
#ifdef INET6
if (isipv6) {
- bcopy((caddr_t)ip6, mtod(n, caddr_t),
- sizeof(struct ip6_hdr));
+ bcopy(ip6, mtod(n, char *), sizeof(struct ip6_hdr));
ip6 = mtod(n, struct ip6_hdr *);
xchg(ip6->ip6_dst, ip6->ip6_src, struct in6_addr);
nth = (struct tcphdr *)(ip6 + 1);
@@ -1859,7 +1857,7 @@
} else
#endif /* INET6 */
{
- bcopy((caddr_t)ip, mtod(n, caddr_t), sizeof(struct ip));
+ bcopy(ip, mtod(n, char *), sizeof(struct ip));
ip = mtod(n, struct ip *);
xchg(ip->ip_dst.s_addr, ip->ip_src.s_addr, uint32_t);
nth = (struct tcphdr *)(ip + 1);
@@ -1871,7 +1869,7 @@
nth = (struct tcphdr *)(uh + 1);
}
}
- bcopy((caddr_t)th, (caddr_t)nth, sizeof(struct tcphdr));
+ bcopy(th, nth, sizeof(struct tcphdr));
xchg(nth->th_dport, nth->th_sport, uint16_t);
th = nth;
m_freem(m);
@@ -1883,7 +1881,7 @@
*/
m_freem(m->m_next);
m->m_next = NULL;
- m->m_data = (caddr_t)ipgen;
+ m->m_data = ipgen;
/* clear any receive flags for proper bpf timestamping */
m->m_flags &= ~(M_TSTMP | M_TSTMP_LRO);
/* m_len is set later */
@@ -3130,7 +3128,7 @@
}
ip = &icp->icmp_ip;
- th = (struct tcphdr *)((caddr_t)ip + (ip->ip_hl << 2));
+ th = (struct tcphdr *)((char *)ip + (ip->ip_hl << 2));
icmp_tcp_seq = th->th_seq;
inp = in_pcblookup(&V_tcbinfo, ip->ip_dst, th->th_dport, ip->ip_src,
th->th_sport, INPLOOKUP_WLOCKPCB, NULL);
@@ -3204,7 +3202,7 @@
int i_hlen, o_len;
uint16_t port;
- outer_ip = (struct ip *)((caddr_t)icmp - sizeof(struct ip));
+ outer_ip = (struct ip *)((char *)icmp - sizeof(struct ip));
inner_ip = &icmp->icmp_ip;
i_hlen = inner_ip->ip_hl << 2;
o_len = ntohs(outer_ip->ip_len);
@@ -3214,7 +3212,7 @@
return;
}
/* Ok lets strip out the inner udphdr header by copying up on top of it the tcp hdr */
- udp = (struct udphdr *)(((caddr_t)inner_ip) + i_hlen);
+ udp = (struct udphdr *)(((char *)inner_ip) + i_hlen);
if (ntohs(udp->uh_sport) != V_tcp_udp_tunneling_port) {
return;
}
@@ -3315,14 +3313,14 @@
return;
}
bzero(&t_ports, sizeof(struct tcp_ports));
- m_copydata(m, off, sizeof(struct tcp_ports), (caddr_t)&t_ports);
+ m_copydata(m, off, sizeof(struct tcp_ports), &t_ports);
inp = in6_pcblookup(&V_tcbinfo, &ip6->ip6_dst, t_ports.th_dport,
&ip6->ip6_src, t_ports.th_sport, INPLOOKUP_WLOCKPCB, NULL);
off += sizeof(struct tcp_ports);
if (m->m_pkthdr.len < (int32_t) (off + sizeof(tcp_seq))) {
goto out;
}
- m_copydata(m, off, sizeof(tcp_seq), (caddr_t)&icmp_tcp_seq);
+ m_copydata(m, off, sizeof(tcp_seq), &icmp_tcp_seq);
if (inp != NULL) {
tp = intotcpcb(inp);
#ifdef TCP_OFFLOAD
@@ -3398,8 +3396,7 @@
if (ip6cp->ip6c_m->m_pkthdr.len <
ip6cp->ip6c_off + sizeof(struct udphdr))
return;
- m_copydata(ip6cp->ip6c_m, ip6cp->ip6c_off, sizeof(udp),
- (caddr_t)&udp);
+ m_copydata(ip6cp->ip6c_m, ip6cp->ip6c_off, sizeof(udp), &udp);
if (ntohs(udp.uh_sport) != V_tcp_udp_tunneling_port)
return;
port = udp.uh_dport;
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -876,7 +876,7 @@
sin.sin_len = sizeof(sin);
sin.sin_addr = sc->sc_inc.inc_faddr;
sin.sin_port = sc->sc_inc.inc_fport;
- bzero((caddr_t)sin.sin_zero, sizeof(sin.sin_zero));
+ bzero(sin.sin_zero, sizeof(sin.sin_zero));
error = in_pcbconnect(inp, &sin, thread0.td_ucred);
if (error != 0)
goto abort;
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1332,7 +1332,7 @@
goto out;
}
m->m_len = 1;
- *mtod(m, caddr_t) = tp->t_iobc;
+ *mtod(m, char *) = tp->t_iobc;
if ((flags & MSG_PEEK) == 0)
tp->t_oobflags ^= (TCPOOB_HAVEDATA | TCPOOB_HADDATA);
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -503,7 +503,7 @@
}
}
ip = mtod(m, struct ip *);
- uh = (struct udphdr *)((caddr_t)ip + iphlen);
+ uh = (struct udphdr *)((char *)ip + iphlen);
cscov_partial = (proto == IPPROTO_UDPLITE) ? 1 : 0;
/*
@@ -743,7 +743,7 @@
if (icmp_errmap(icmp) == 0)
return;
- uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2));
+ uh = (struct udphdr *)((char *)ip + (ip->ip_hl << 2));
inp = in_pcblookup(pcbinfo, ip->ip_dst, uh->uh_dport, ip->ip_src,
uh->uh_sport, INPLOOKUP_WLOCKPCB, NULL);
if (inp != NULL) {
diff --git a/sys/netinet6/dest6.c b/sys/netinet6/dest6.c
--- a/sys/netinet6/dest6.c
+++ b/sys/netinet6/dest6.c
@@ -78,7 +78,7 @@
return (IPPROTO_DONE);
}
}
- dstopts = (struct ip6_dest *)(mtod(m, caddr_t) + off);
+ dstopts = (struct ip6_dest *)(mtod(m, char *) + off);
dstoptlen = (dstopts->ip6d_len + 1) << 3;
if (m->m_len < off + dstoptlen) {
@@ -89,7 +89,7 @@
return (IPPROTO_DONE);
}
}
- dstopts = (struct ip6_dest *)(mtod(m, caddr_t) + off);
+ dstopts = (struct ip6_dest *)(mtod(m, char *) + off);
off += dstoptlen;
dstoptlen -= sizeof(struct ip6_dest);
opt = (u_int8_t *)dstopts + sizeof(struct ip6_dest);
diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c
--- a/sys/netinet6/frag6.c
+++ b/sys/netinet6/frag6.c
@@ -474,7 +474,7 @@
* sizeof(struct ip6_frag) == 8
* sizeof(struct ip6_hdr) = 40
*/
- ip6f = (struct ip6_frag *)((caddr_t)ip6 + offset);
+ ip6f = (struct ip6_frag *)((char *)ip6 + offset);
if ((ip6f->ip6f_offlg & IP6F_MORE_FRAG) &&
(((ntohs(ip6->ip6_plen) - offset) & 0x7) != 0)) {
icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER,
@@ -503,7 +503,7 @@
* we must update the last one.
*/
m_copyback(m, ip6_get_prevhdr(m, offset), sizeof(uint8_t),
- (caddr_t)&nxt);
+ &nxt);
ip6->ip6_plen = htons(ntohs(ip6->ip6_plen) -
sizeof(struct ip6_frag));
if (ip6_deletefraghdr(m, offset, M_NOWAIT) != 0)
@@ -864,8 +864,7 @@
ip6_deletefraghdr(m, offset, M_NOWAIT);
/* Set nxt(-hdr field value) to the original value. */
- m_copyback(m, ip6_get_prevhdr(m, offset), sizeof(uint8_t),
- (caddr_t)&nxt);
+ m_copyback(m, ip6_get_prevhdr(m, offset), sizeof(uint8_t), &nxt);
#ifdef MAC
mac_ip6q_reassemble(q6, m);
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -337,7 +337,7 @@
}
}
oip6 = mtod(m, struct ip6_hdr *);
- icp = (struct icmp6_hdr *)(mtod(m, caddr_t) + off);
+ icp = (struct icmp6_hdr *)(mtod(m, char *) + off);
if (icp->icmp6_type < ICMP6_ECHO_REQUEST ||
icp->icmp6_type == ND_REDIRECT) {
@@ -499,7 +499,7 @@
}
/* Calculate the checksum. */
- icmp6 = (struct icmp6_hdr *)((caddr_t)ip6 + off);
+ icmp6 = (struct icmp6_hdr *)((char *)ip6 + off);
code = icmp6->icmp6_code;
if ((sum = in6_cksum(m, IPPROTO_ICMPV6, off, icmp6len)) != 0) {
nd6log((LOG_ERR,
@@ -608,7 +608,7 @@
break;
}
}
- nicmp6 = (struct icmp6_hdr *)(mtod(n, caddr_t) + off);
+ nicmp6 = (struct icmp6_hdr *)(mtod(n, char *) + off);
noff = off;
}
if (n) {
@@ -940,7 +940,7 @@
return (-1);
}
}
- icmp6 = (struct icmp6_hdr *)(mtod(m, caddr_t) + off);
+ icmp6 = (struct icmp6_hdr *)(mtod(m, char *) + off);
eip6 = (struct ip6_hdr *)(icmp6 + 1);
bzero(&icmp6dst, sizeof(icmp6dst));
@@ -973,7 +973,7 @@
}
}
eh = (struct ip6_ext *)
- (mtod(m, caddr_t) + eoff);
+ (mtod(m, char *) + eoff);
if (nxt == IPPROTO_AH)
eoff += (eh->ip6e_len + 2) << 2;
else
@@ -998,7 +998,7 @@
}
}
rth = (struct ip6_rthdr *)
- (mtod(m, caddr_t) + eoff);
+ (mtod(m, char *) + eoff);
rthlen = (rth->ip6r_len + 1) << 3;
/*
* XXX: currently there is no
@@ -1022,7 +1022,7 @@
}
}
rth0 = (struct ip6_rthdr0 *)
- (mtod(m, caddr_t) + eoff);
+ (mtod(m, char *) + eoff);
/* just ignore a bogus header */
if ((rth0->ip6r0_len % 2) == 0 &&
@@ -1042,7 +1042,7 @@
return (-1);
}
}
- fh = (struct ip6_frag *)(mtod(m, caddr_t) +
+ fh = (struct ip6_frag *)(mtod(m, char *) +
eoff);
/*
* Data after a fragment header is meaningless
@@ -1069,7 +1069,7 @@
}
}
notify:
- icmp6 = (struct icmp6_hdr *)(mtod(m, caddr_t) + off);
+ icmp6 = (struct icmp6_hdr *)(mtod(m, char *) + off);
/*
* retrieve parameters from the inner IPv6 header, and convert
@@ -1189,7 +1189,7 @@
struct in6_ifaddr *ia6 = NULL;
ip6 = mtod(m, struct ip6_hdr *);
- ni6 = (struct icmp6_nodeinfo *)(mtod(m, caddr_t) + off);
+ ni6 = (struct icmp6_nodeinfo *)(mtod(m, char *) + off);
/*
* Validate IPv6 source address.
@@ -1285,7 +1285,7 @@
* We do not do proxy at this moment.
*/
m_copydata(m, off + sizeof(struct icmp6_nodeinfo),
- subjlen, (caddr_t)&in6_subj);
+ subjlen, &in6_subj);
if (in6_setscope(&in6_subj, m->m_pkthdr.rcvif, NULL))
goto bad;
@@ -1332,8 +1332,8 @@
}
}
/* ip6 possibly invalid but not used after. */
- ni6 = (struct icmp6_nodeinfo *)(mtod(m, caddr_t) + off);
- subj = (char *)(mtod(m, caddr_t) + off +
+ ni6 = (struct icmp6_nodeinfo *)(mtod(m, char *) + off);
+ subj = (char *)(mtod(m, char *) + off +
sizeof(struct icmp6_nodeinfo));
if (!ni6_dnsmatch(subj, subjlen, mtod(n, const char *),
n->m_len)) {
@@ -1420,9 +1420,9 @@
n->m_pkthdr.len = n->m_len = replylen;
/* copy mbuf header and IPv6 + Node Information base headers */
- bcopy(mtod(m, caddr_t), mtod(n, caddr_t), sizeof(struct ip6_hdr));
+ bcopy(mtod(m, void *), mtod(n, void *), sizeof(struct ip6_hdr));
nni6 = (struct icmp6_nodeinfo *)(mtod(n, struct ip6_hdr *) + 1);
- bcopy((caddr_t)ni6, (caddr_t)nni6, sizeof(struct icmp6_nodeinfo));
+ bcopy(ni6, nni6, sizeof(struct icmp6_nodeinfo));
/* qtype dependent procedure */
switch (qtype) {
@@ -1442,7 +1442,7 @@
}
case NI_QTYPE_FQDN:
nni6->ni_code = ICMP6_NI_SUCCESS;
- fqdn = (struct ni_reply_fqdn *)(mtod(n, caddr_t) +
+ fqdn = (struct ni_reply_fqdn *)(mtod(n, char *) +
sizeof(struct ip6_hdr) + sizeof(struct icmp6_nodeinfo));
nni6->ni_flags = 0; /* XXX: meaningless TTL */
fqdn->ni_fqdn_ttl = 0; /* ditto. */
@@ -1911,7 +1911,7 @@
int delivered = 0, fib;
/* This is assumed to be safe; icmp6_input() does a pullup. */
- icmp6 = (struct icmp6_hdr *)((caddr_t)ip6 + off);
+ icmp6 = (struct icmp6_hdr *)((char *)ip6 + off);
/*
* XXX: the address may have embedded scope zone ID, which should be
@@ -2033,14 +2033,14 @@
struct ip6_hdr nip6;
l = off - sizeof(struct ip6_hdr);
- m_copydata(m, 0, sizeof(nip6), (caddr_t)&nip6);
+ m_copydata(m, 0, sizeof(nip6), &nip6);
m_adj(m, l);
l = sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr);
if (m->m_len < l) {
if ((m = m_pullup(m, l)) == NULL)
return;
}
- bcopy((caddr_t)&nip6, mtod(m, caddr_t), sizeof(nip6));
+ bcopy(&nip6, mtod(m, void *), sizeof(nip6));
} else /* off == sizeof(struct ip6_hdr) */ {
size_t l;
l = sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr);
@@ -2195,7 +2195,7 @@
}
}
ip6 = mtod(m, struct ip6_hdr *);
- nd_rd = (struct nd_redirect *)((caddr_t)ip6 + off);
+ nd_rd = (struct nd_redirect *)((char *)ip6 + off);
ifp = m->m_pkthdr.rcvif;
redtgt6 = nd_rd->nd_rd_target;
diff --git a/sys/netinet6/in6_rss.c b/sys/netinet6/in6_rss.c
--- a/sys/netinet6/in6_rss.c
+++ b/sys/netinet6/in6_rss.c
@@ -268,7 +268,7 @@
RSS_DEBUG("short fragment frame?\n");
return (-1);
}
- ip6f = (const struct ip6_frag *)((c_caddr_t)ip6 + off);
+ ip6f = (const struct ip6_frag *)((const char *)ip6 + off);
if ((ip6f->ip6f_offlg & ~IP6F_RESERVED_MASK) == 0) {
off = ip6_lasthdr(m, off, proto, &nxt);
if (off < 0) {
@@ -342,7 +342,7 @@
RSS_DEBUG("short TCP frame?\n");
return (-1);
}
- th = (const struct tcphdr *)((c_caddr_t)ip6 + off);
+ th = (const struct tcphdr *)((const char *)ip6 + off);
return rss_proto_software_hash_v6(&ip6->ip6_src, &ip6->ip6_dst,
th->th_sport,
th->th_dport,
@@ -355,7 +355,7 @@
RSS_DEBUG("short UDP frame?\n");
return (-1);
}
- uh = (const struct udphdr *)((c_caddr_t)ip6 + off);
+ uh = (const struct udphdr *)((const char *)ip6 + off);
return rss_proto_software_hash_v6(&ip6->ip6_src, &ip6->ip6_dst,
uh->uh_sport,
uh->uh_dport,
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -592,7 +592,7 @@
goto bad;
m_move_pkthdr(n, m);
- m_copydata(m, 0, n->m_pkthdr.len, mtod(n, caddr_t));
+ m_copydata(m, 0, n->m_pkthdr.len, mtod(n, void *));
n->m_len = n->m_pkthdr.len;
m_freem(m);
m = n;
@@ -959,7 +959,7 @@
return (-1);
}
}
- hbh = (struct ip6_hbh *)(mtod(m, caddr_t) + off);
+ hbh = (struct ip6_hbh *)(mtod(m, char *) + off);
hbhlen = (hbh->ip6h_len + 1) << 3;
if (m->m_len < off + hbhlen) {
@@ -970,7 +970,7 @@
return (-1);
}
}
- hbh = (struct ip6_hbh *)(mtod(m, caddr_t) + off);
+ hbh = (struct ip6_hbh *)(mtod(m, char *) + off);
off += hbhlen;
hbhlen -= sizeof(struct ip6_hbh);
if (ip6_process_hopopts(m, (u_int8_t *)hbh + sizeof(struct ip6_hbh),
@@ -1029,7 +1029,7 @@
return (-1);
}
optlen = IP6OPT_RTALERT_LEN;
- bcopy((caddr_t)(opt + 2), (caddr_t)&rtalert_val, 2);
+ bcopy(opt + 2, &rtalert_val, 2);
*rtalertp = ntohs(rtalert_val);
break;
case IP6OPT_JUMBO:
@@ -1403,7 +1403,7 @@
if (off + sizeof(*ip6e) > m->m_len)
goto loopend;
- ip6e = (struct ip6_ext *)(mtod(m, caddr_t) + off);
+ ip6e = (struct ip6_ext *)(mtod(m, char *) + off);
if (nxt == IPPROTO_AH)
elen = (ip6e->ip6e_len + 2) << 2;
else
@@ -1557,7 +1557,7 @@
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:
nlen = sizeof(struct ip6_frag);
@@ -1594,7 +1594,7 @@
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);
@@ -1607,7 +1607,7 @@
*/
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);
/* IP6F_OFF_MASK = 0xfff8(BigEndian), 0xf8ff(LittleEndian) */
if (fh.ip6f_offlg & IP6F_OFF_MASK)
return -1;
@@ -1619,7 +1619,7 @@
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;
@@ -1630,7 +1630,7 @@
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;
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -1854,7 +1854,7 @@
}
}
ip6 = mtod(m, struct ip6_hdr *);
- pim = (struct pim *)((caddr_t)ip6 + off);
+ pim = (struct pim *)((char *)ip6 + off);
#define PIM6_CHECKSUM
#ifdef PIM6_CHECKSUM
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -139,7 +139,7 @@
static int ip6_setpktopt(int, u_char *, int, struct ip6_pktopts *,
struct ucred *, int, int, int);
-static int ip6_copyexthdr(struct mbuf **, caddr_t, int);
+static int ip6_copyexthdr(struct mbuf **, const void *, int);
static int ip6_insertfraghdr(struct mbuf *, struct mbuf *, int,
struct ip6_frag **);
static int ip6_splithdr(struct mbuf *, struct ip6_exthdrs *);
@@ -157,7 +157,7 @@
#define MAKE_EXTHDR(hp, mp, _ol) \
do { \
struct ip6_ext *eh = (struct ip6_ext *)(hp); \
- error = ip6_copyexthdr((mp), (caddr_t)(hp), \
+ error = ip6_copyexthdr((mp), (hp), \
((eh)->ip6e_len + 1) << 3); \
if (error) \
goto freehdrs; \
@@ -198,7 +198,7 @@
offset += m->m_pkthdr.csum_data; /* checksum offset */
if (offset + sizeof(csum) > m->m_len)
- m_copyback(m, offset, sizeof(csum), (caddr_t)&csum);
+ m_copyback(m, offset, sizeof(csum), &csum);
else
*(u_short *)mtodo(m, offset) = csum;
}
@@ -1278,7 +1278,7 @@
}
static int
-ip6_copyexthdr(struct mbuf **mp, caddr_t hdr, int hlen)
+ip6_copyexthdr(struct mbuf **mp, const void *hdr, int hlen)
{
struct mbuf *m;
@@ -1293,7 +1293,7 @@
return (ENOBUFS);
m->m_len = hlen;
if (hdr)
- bcopy(hdr, mtod(m, caddr_t), hlen);
+ bcopy(hdr, mtod(m, void *), hlen);
*mp = m;
return (0);
@@ -1324,7 +1324,7 @@
if (M_WRITABLE(mlast) &&
M_TRAILINGSPACE(mlast) >= sizeof(struct ip6_frag)) {
/* use the trailing space of the last mbuf for the fragment hdr */
- *frghdrp = (struct ip6_frag *)(mtod(mlast, caddr_t) +
+ *frghdrp = (struct ip6_frag *)(mtod(mlast, char *) +
mlast->m_len);
mlast->m_len += sizeof(struct ip6_frag);
m->m_pkthdr.len += sizeof(struct ip6_frag);
@@ -3191,7 +3191,7 @@
mh->m_next = m;
m = mh;
m->m_len = sizeof(*ip6);
- bcopy((caddr_t)ip6, mtod(m, caddr_t), sizeof(*ip6));
+ bcopy(ip6, mtod(m, void *), sizeof(*ip6));
}
exthdrs->ip6e_ip6 = m;
return 0;
diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c
--- a/sys/netinet6/mld6.c
+++ b/sys/netinet6/mld6.c
@@ -1011,8 +1011,7 @@
soff = off + sizeof(struct mldv2_query);
nrecorded = 0;
for (i = 0; i < nsrc; i++) {
- m_copydata(m0, soff, sizeof(struct in6_addr),
- (caddr_t)&srcaddr);
+ m_copydata(m0, soff, sizeof(struct in6_addr), &srcaddr);
retval = in6m_record_source(inm, &srcaddr);
if (retval < 0)
break;
diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h
--- a/sys/netinet6/nd6.h
+++ b/sys/netinet6/nd6.h
@@ -380,7 +380,7 @@
void nd6_ns_input(struct mbuf *, int, int);
void nd6_ns_output(struct ifnet *, const struct in6_addr *,
const struct in6_addr *, const struct in6_addr *, uint8_t *);
-caddr_t nd6_ifptomac(struct ifnet *);
+char *nd6_ifptomac(struct ifnet *);
u_int nd6_lladdr_opt_pad(struct ifnet *);
void nd6_dad_init(void);
void nd6_dad_start(struct ifaddr *, int);
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -429,7 +429,7 @@
nd_opt = ndopts->nd_opts_search;
/* make sure nd_opt_len is inside the buffer */
- if ((caddr_t)&nd_opt->nd_opt_len >= (caddr_t)ndopts->nd_opts_last) {
+ if ((char *)&nd_opt->nd_opt_len >= (char *)ndopts->nd_opts_last) {
bzero(ndopts, sizeof(*ndopts));
return NULL;
}
@@ -444,7 +444,7 @@
return NULL;
}
- ndopts->nd_opts_search = (struct nd_opt_hdr *)((caddr_t)nd_opt + olen);
+ ndopts->nd_opts_search = (struct nd_opt_hdr *)((char *)nd_opt + olen);
if (ndopts->nd_opts_search > ndopts->nd_opts_last) {
/* option overruns the end of buffer, invalid */
bzero(ndopts, sizeof(*ndopts));
@@ -612,7 +612,7 @@
if (sizeof(hdr) > m->m_len)
return (NULL);
- m_copydata(m, 0, sizeof(hdr), (caddr_t)&hdr);
+ m_copydata(m, 0, sizeof(hdr), &hdr);
*src = hdr.ip6_src;
return (src);
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -180,7 +180,7 @@
}
}
ip6 = mtod(m, struct ip6_hdr *);
- nd_ns = (struct nd_neighbor_solicit *)((caddr_t)ip6 + off);
+ nd_ns = (struct nd_neighbor_solicit *)((char *)ip6 + off);
saddr6 = ip6->ip6_src;
daddr6 = ip6->ip6_dst;
@@ -623,10 +623,10 @@
m->m_pkthdr.len += optlen;
m->m_len += optlen;
icmp6len += optlen;
- bzero((caddr_t)nd_opt, optlen);
+ bzero(nd_opt, optlen);
nd_opt->nd_opt_type = ND_OPT_NONCE;
nd_opt->nd_opt_len = optlen >> 3;
- bcopy(nonce, (caddr_t)(nd_opt + 1), ND_OPT_NONCE_LEN);
+ bcopy(nonce, nd_opt + 1, ND_OPT_NONCE_LEN);
}
ip6->ip6_plen = htons((u_short)icmp6len);
nd_ns->nd_ns_cksum = 0;
@@ -718,7 +718,7 @@
}
}
ip6 = mtod(m, struct ip6_hdr *);
- nd_na = (struct nd_neighbor_advert *)((caddr_t)ip6 + off);
+ nd_na = (struct nd_neighbor_advert *)((char *)ip6 + off);
flags = nd_na->nd_na_flags_reserved;
is_router = ((flags & ND_NA_FLAG_ROUTER) != 0);
@@ -1004,7 +1004,7 @@
NET_EPOCH_ASSERT();
int icmp6len, maxlen, error;
- caddr_t mac = NULL;
+ char *mac = NULL;
daddr6 = *daddr6_0; /* make a local copy for modification */
@@ -1104,7 +1104,7 @@
m->m_pkthdr.len += optlen;
m->m_len += optlen;
icmp6len += optlen;
- bzero((caddr_t)nd_opt, optlen);
+ bzero(nd_opt, optlen);
nd_opt->nd_opt_type = ND_OPT_TARGET_LINKADDR;
nd_opt->nd_opt_len = optlen >> 3;
memcpy((char *)(nd_opt + 1) + pad, mac, ifp->if_addrlen);
@@ -1149,7 +1149,7 @@
}
#endif
-caddr_t
+char *
nd6_ifptomac(struct ifnet *ifp)
{
switch (ifp->if_type) {
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -213,7 +213,7 @@
}
}
ip6 = mtod(m, struct ip6_hdr *);
- nd_rs = (struct nd_router_solicit *)((caddr_t)ip6 + off);
+ nd_rs = (struct nd_router_solicit *)((char *)ip6 + off);
icmp6len -= sizeof(*nd_rs);
nd6_option_init(nd_rs + 1, icmp6len, &ndopts);
@@ -558,7 +558,7 @@
}
ip6 = mtod(m, struct ip6_hdr *);
}
- nd_ra = (struct nd_router_advert *)((caddr_t)ip6 + off);
+ nd_ra = (struct nd_router_advert *)((char *)ip6 + off);
icmp6len -= sizeof(*nd_ra);
nd6_option_init(nd_ra + 1, icmp6len, &ndopts);
@@ -637,7 +637,7 @@
auth = ((m->m_flags & M_AUTHIPHDR) && (m->m_flags & M_AUTHIPDGM));
for (pt = (struct nd_opt_hdr *)ndopts.nd_opts_pi;
pt <= (struct nd_opt_hdr *)ndopts.nd_opts_pi_end;
- pt = (struct nd_opt_hdr *)((caddr_t)pt +
+ pt = (struct nd_opt_hdr *)((char *)pt +
(pt->nd_opt_len << 3))) {
nd6_ra_opt_pi(pt, ifp, nd_ra, dr, auth, mcast);
}
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -516,7 +516,7 @@
}
if (!n)
goto bad;
- p = (u_int16_t *)(mtod(n, caddr_t) + off);
+ p = (uint16_t *)(mtod(n, char *) + off);
*p = 0;
*p = in6_cksum(m, ip6->ip6_nxt, sizeof(*ip6), plen);
}
diff --git a/sys/netinet6/route6.c b/sys/netinet6/route6.c
--- a/sys/netinet6/route6.c
+++ b/sys/netinet6/route6.c
@@ -89,7 +89,7 @@
}
}
ip6 = mtod(m, struct ip6_hdr *);
- rh = (struct ip6_rthdr *)((caddr_t)ip6 + off);
+ rh = (struct ip6_rthdr *)((char *)ip6 + off);
/*
* While this switch may look gratuitous, leave it in
@@ -104,7 +104,7 @@
}
IP6STAT_INC(ip6s_badoptions);
icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER,
- (caddr_t)&rh->ip6r_type - (caddr_t)ip6);
+ (char *)&rh->ip6r_type - (char *)ip6);
*mp = NULL;
return (IPPROTO_DONE);
}
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -377,7 +377,7 @@
}
}
ip6 = mtod(m, struct ip6_hdr *);
- uh = (struct udphdr *)((caddr_t)ip6 + off);
+ uh = (struct udphdr *)((char *)ip6 + off);
UDPSTAT_INC(udps_ipackets);
@@ -582,7 +582,7 @@
return;
bzero(&uh, sizeof(uh));
- m_copydata(m, off, sizeof(*uhp), (caddr_t)&uh);
+ m_copydata(m, off, sizeof(*uhp), &uh);
/* Check to see if its tunneled */
inp = in6_pcblookup_mbuf(pcbinfo, &ip6->ip6_dst, uh.uh_dport,
@@ -889,7 +889,7 @@
* Stuff checksum and output datagram.
*/
cscov = cscov_partial = 0;
- udp6 = (struct udphdr *)(mtod(m, caddr_t) + hlen);
+ udp6 = (struct udphdr *)(mtod(m, char *) + hlen);
udp6->uh_sport = inp->inp_lport; /* lport is always set in the PCB */
udp6->uh_dport = fport;
if (nxt == IPPROTO_UDPLITE) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Oct 19, 8:33 PM (1 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41065553
Default Alt Text
D60738.diff (55 KB)
Attached To
Mode
D60738: net*: remove remnants of caddr_t
Attached
Detach File
Event Timeline
Log In to Comment