git: d7cf2e714e29 - main - net*: remove remnants of caddr_t

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Fri, 16 Oct 2026 21:17:27 UTC
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=d7cf2e714e29a52264fa4bc67e7d727948003afb

commit d7cf2e714e29a52264fa4bc67e7d727948003afb
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2026-10-16 21:16:27 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2026-10-16 21:16:59 +0000

    net*: remove remnants of caddr_t
    
    caddr_t is a typedef for a character pointer (char *) that originated in
    Version 7 Unix, released by AT&T in 1979.  It became obsolete in 1989,
    when ANSI C introduced void *.
    
    What's left:
    
    * ioctl(9) KPI still uses caddr_t, thus network related ioctl method
      still use it.
    * if_clone KPI, to be done separately.
    * bpf(4), to be done separately.
    * SCTP, let maintainers decide.
    * iflib(4), let maintainers decide.
    
    Reviewed by:            zlei
    Differential Revision:  https://reviews.freebsd.org/D60738
---
 sys/net/bridgestp.c           | 12 ++++++------
 sys/net/if.c                  |  8 ++++----
 sys/net/if_arp.h              |  8 ++++----
 sys/net/if_bridge.c           | 16 ++++++++--------
 sys/net/if_bridgevar.h        |  6 +++---
 sys/net/if_ethersubr.c        |  2 +-
 sys/net/if_geneve.c           |  6 +++---
 sys/net/if_ovpn.c             |  4 ++--
 sys/net/if_stf.c              |  4 ++--
 sys/net/if_vxlan.c            |  3 +--
 sys/net/iflib.h               |  2 +-
 sys/net/pfkeyv2.h             |  2 +-
 sys/net/radix.h               |  4 ++--
 sys/net/route.c               |  2 +-
 sys/net/rtsock.c              | 34 +++++++++++++++++-----------------
 sys/netinet/if_ether.c        |  2 +-
 sys/netinet/in_rss.c          |  4 ++--
 sys/netinet/ip_carp.c         |  2 +-
 sys/netinet/ip_fastfwd.c      |  2 +-
 sys/netinet/ip_gre.c          |  2 +-
 sys/netinet/ip_icmp.c         | 17 ++++++++---------
 sys/netinet/ip_input.c        |  4 ++--
 sys/netinet/ip_mroute.c       | 10 +++++-----
 sys/netinet/ip_options.c      |  6 +++---
 sys/netinet/ip_output.c       |  4 ++--
 sys/netinet/libalias/alias.c  |  2 +-
 sys/netinet/siftr.c           |  4 ++--
 sys/netinet/tcp_input.c       | 10 +++++-----
 sys/netinet/tcp_log_buf.c     |  8 ++++----
 sys/netinet/tcp_lro.c         |  7 ++++---
 sys/netinet/tcp_output.c      | 10 +++++-----
 sys/netinet/tcp_stacks/bbr.c  |  7 ++++---
 sys/netinet/tcp_stacks/rack.c | 15 +++++++++------
 sys/netinet/tcp_subr.c        | 33 +++++++++++++++------------------
 sys/netinet/tcp_syncache.c    |  2 +-
 sys/netinet/tcp_usrreq.c      |  2 +-
 sys/netinet/udp_usrreq.c      |  4 ++--
 sys/netinet6/dest6.c          |  4 ++--
 sys/netinet6/frag6.c          |  7 +++----
 sys/netinet6/icmp6.c          | 40 ++++++++++++++++++++--------------------
 sys/netinet6/in6_rss.c        |  6 +++---
 sys/netinet6/ip6_input.c      | 20 ++++++++++----------
 sys/netinet6/ip6_mroute.c     |  2 +-
 sys/netinet6/ip6_output.c     | 14 +++++++-------
 sys/netinet6/mld6.c           |  3 +--
 sys/netinet6/nd6.c            |  6 +++---
 sys/netinet6/nd6.h            |  2 +-
 sys/netinet6/nd6_nbr.c        | 14 +++++++-------
 sys/netinet6/nd6_rtr.c        |  6 +++---
 sys/netinet6/raw_ip6.c        |  2 +-
 sys/netinet6/route6.c         |  4 ++--
 sys/netinet6/udp6_usrreq.c    |  6 +++---
 52 files changed, 202 insertions(+), 204 deletions(-)

diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c
index b5a863641de7..eb44f893183b 100644
--- a/sys/net/bridgestp.c
+++ b/sys/net/bridgestp.c
@@ -259,7 +259,7 @@ bstp_transmit_tcn(struct bstp_state *bs, struct bstp_port *bp)
 	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 @@ bstp_send_bpdu(struct bstp_state *bs, struct bstp_port *bp,
 			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 @@ bstp_send_bpdu(struct bstp_state *bs, struct bstp_port *bp,
 			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 @@ bstp_input(struct bstp_port *bp, struct ifnet *ifp, struct mbuf *m)
 	    (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 @@ bstp_received_stp(struct bstp_state *bs, struct bstp_port *bp,
 		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 @@ bstp_received_rstp(struct bstp_state *bs, struct bstp_port *bp,
 	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
index d8184a528f08..6bbacbeb78b6 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -257,7 +257,7 @@ int	(*carp_iamatch_p)(struct ifaddr *, uint8_t **);
 #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 @@ if_attach_internal(struct ifnet *ifp, bool vmove)
 		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 @@ next:				continue;
 				 */
 				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
index 6a944276674c..6b02cc8720fc 100644
--- a/sys/net/if_arp.h
+++ b/sys/net/if_arp.h
@@ -71,10 +71,10 @@ struct	arphdr {
 #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
index b8dc3b70d832..090b7e055662 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -4045,12 +4045,12 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir)
 	}
 
 	/* 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 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir)
 		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 @@ bridge_ip_checkbasic(struct mbuf **mp)
 	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 @@ bridge_ip6_checkbasic(struct mbuf **mp)
 	 * 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 @@ bridge_fragment(struct ifnet *ifp, struct mbuf **mp, struct ether_header *eh,
 					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 @@ bridge_fragment(struct ifnet *ifp, struct mbuf **mp, struct ether_header *eh,
 				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
index 5ed8c19f3128..de6eca5d4780 100644
--- a/sys/net/if_bridgevar.h
+++ b/sys/net/if_bridgevar.h
@@ -194,7 +194,7 @@ struct ifbreq {
 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 ifbareq {
 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 ifbpstpreq {
 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
index bbaf798b49f2..69b4e1470d4b 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1237,7 +1237,7 @@ ether_vlan_mtap(struct bpf_if *bp, struct mbuf *m, void *data, u_int dlen)
 	 */
 	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
index 6413506518ef..7d18e45741a3 100644
--- a/sys/net/if_geneve.c
+++ b/sys/net/if_geneve.c
@@ -2489,7 +2489,7 @@ geneve_inherit_l3_hdr(struct mbuf *m, struct geneve_softc *sc, uint16_t proto,
 	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 @@ geneve_inherit_l3_hdr(struct mbuf *m, struct geneve_softc *sc, uint16_t proto,
 
 	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 @@ geneve_udp_input(struct mbuf *m, int offset, struct inpcb *inpcb,
 	/* 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
index 4c100037b8d9..c0dea8a06b61 100644
--- a/sys/net/if_ovpn.c
+++ b/sys/net/if_ovpn.c
@@ -2466,7 +2466,7 @@ ovpn_peer_from_mbuf(struct ovpn_softc *sc, struct mbuf *m, int off)
 	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 @@ ovpn_udp_input(struct mbuf *m, int off, struct inpcb *inp,
 		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
index e35866e4ed99..bf0092747d5a 100644
--- a/sys/net/if_stf.c
+++ b/sys/net/if_stf.c
@@ -390,7 +390,7 @@ stf_encapcheck(const struct mbuf *m, int off, int proto, void *arg)
 	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 @@ in_stf_input(struct mbuf *m, int off, int proto, void *arg)
 		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
index e69f8e1f75a1..fbe022d7fbde 100644
--- a/sys/net/if_vxlan.c
+++ b/sys/net/if_vxlan.c
@@ -2825,8 +2825,7 @@ vxlan_rcv_udp_packet(struct mbuf *m, int offset, struct inpcb *inpcb,
 		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
index 9bf1a1d8dbbf..0536fb975bd9 100644
--- a/sys/net/iflib.h
+++ b/sys/net/iflib.h
@@ -239,7 +239,7 @@ typedef struct if_softc_ctx {
 	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
index 8df7536f7563..637b5c1b259c 100644
--- a/sys/net/pfkeyv2.h
+++ b/sys/net/pfkeyv2.h
@@ -460,7 +460,7 @@ struct sadb_x_if_hw_offl {
 #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
index 8313a7290073..17c579970f66 100644
--- a/sys/net/radix.h
+++ b/sys/net/radix.h
@@ -151,11 +151,11 @@ void rn_inithead_internal(struct radix_head *rh, struct radix_node *base_nodes,
 #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
index c51332e75ffd..baf71fc4a389 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -601,7 +601,7 @@ rt_maskedcopy(const struct sockaddr *src, struct sockaddr *dst,
 	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
index fcccbc98470c..61403cde28e7 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -695,7 +695,7 @@ fill_addrinfo(struct rt_msghdr *rtm, int len, struct linear_buffer *lb, u_int fi
 	 * 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 @@ rts_send(struct socket *so, int flags, struct mbuf *m,
 	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 @@ send_rtm_reply(struct socket *so, struct rt_msghdr *rtm, struct mbuf *m,
 		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 @@ rtsock_msg_mbuf(int type, struct rt_addrinfo *rtinfo)
 
 	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 @@ rtsock_msg_mbuf(int type, struct rt_addrinfo *rtinfo)
 			(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 @@ rtsock_msg_buffer(int type, struct rt_addrinfo *rtinfo, struct walkarg *w, int *
 				(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 @@ rtsock_ifmsg(struct ifnet *ifp, int if_flags_mask __unused)
 
 	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 @@ rtsock_addrmsg(int cmd, struct ifaddr *ifa, int fibnum)
 
 	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 @@ rtsock_routemsg(int cmd, struct rtentry *rt, struct nhop_object *nh,
 	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 @@ rt_newmaddrmsg(int cmd, struct ifmultiaddr *ifma)
 	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 @@ rt_makeifannouncemsg(struct ifnet *ifp, int type, int what,
 
 	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 @@ sysctl_dumpnhop(struct rtentry *rt, struct nhop_object *nh, uint32_t weight,
 	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 @@ sysctl_dumpnhop(struct rtentry *rt, struct nhop_object *nh, uint32_t weight,
 		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 @@ sysctl_iflist_ifml(struct ifnet *ifp, const struct if_data *src_ifd,
 
 	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 @@ sysctl_iflist_ifm(struct ifnet *ifp, const struct if_data *src_ifd,
 
 	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 @@ sysctl_iflist(int af, struct walkarg *w)
 	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 @@ sysctl_ifmalist(int af, struct walkarg *w)
 	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
index 8d65b88913b8..6bbaa2792bc9 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -396,7 +396,7 @@ arprequest_internal(struct ifnet *ifp, const struct in_addr *sip,
 	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
index 4854265bd9f4..a609667c9dd2 100644
--- a/sys/netinet/in_rss.c
+++ b/sys/netinet/in_rss.c
@@ -316,7 +316,7 @@ rss_mbuf_software_hash_v4(const struct mbuf *m, int dir, uint32_t *hashval,
 			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 @@ rss_mbuf_software_hash_v4(const struct mbuf *m, int dir, uint32_t *hashval,
 	} 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
index 9a97c1a19525..547389229691 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1408,7 +1408,7 @@ vrrp_send_ad_locked(struct carp_softc *sc)
 			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
index d95cca490a5d..0d7ae7b41527 100644
--- a/sys/netinet/ip_fastfwd.c
+++ b/sys/netinet/ip_fastfwd.c
@@ -186,7 +186,7 @@ ip_redir_alloc(struct mbuf *m, struct nhop_object *nh, u_short ip_len,
 	}
 	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
index 8175155cc2c0..0eb7c27a621e 100644
--- a/sys/netinet/ip_gre.c
+++ b/sys/netinet/ip_gre.c
@@ -528,7 +528,7 @@ in_gre_output(struct mbuf *m, int af, int hlen)
 		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
index ef7b931e1d93..ce66e6139c2f 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -244,7 +244,7 @@ icmp_error(struct mbuf *n, int type, int code, uint32_t dest, int mtu)
 	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 @@ stdreply:	icmpelen = max(8, min(V_icmp_quotelen, ntohs(oip->ip_len) -
 	 * 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 @@ stdreply:	icmpelen = max(8, min(V_icmp_quotelen, ntohs(oip->ip_len) -
 	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 @@ match:
 			     */
 			    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
index 8602cf0d5266..aa0136ba5351 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1017,7 +1017,7 @@ ip_forward(struct mbuf *m, int srcrt)
 	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, void *));
 	}
 #ifdef IPSTEALTH
 	if (V_ipstealth == 0)
@@ -1182,7 +1182,7 @@ ip_savecontrol(struct inpcb *inp, struct mbuf **mp, struct ip *ip,
 		} 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
index 1e0043b4e4fe..a4cc401fca94 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -477,7 +477,7 @@ X_ip_mrouter_set(struct socket *so, struct sockopt *sopt)
 		} 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 @@ del_vif_locked(struct mfctable *mfct, vifi_t vifi,
 
 	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 @@ bw_upcalls_send(struct mfctable *mfct)
 		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 @@ pim_register_send_rp(struct mfctable *mfct, struct ip *ip, struct vif *vifp,
 	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
index 285bdad46272..11d934de1164 100644
--- a/sys/netinet/ip_options.c
+++ b/sys/netinet/ip_options.c
@@ -453,9 +453,9 @@ ip_srcroute(struct mbuf *m0)
 	 */
 	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 @@ ip_pcbopts(struct inpcb *inp, int optname, struct mbuf *m)
 			/*
 			 * 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
index a7cb1234f97c..3a9fc76666a7 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1058,7 +1058,7 @@ in_delayed_cksum_o(struct mbuf *m, uint16_t iph_offset)
 		/* 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 @@ in_delayed_cksum_o(struct mbuf *m, uint16_t iph_offset)
 	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
index 6758813f6a21..815209d9f6d3 100644
--- a/sys/netinet/libalias/alias.c
+++ b/sys/netinet/libalias/alias.c
@@ -1818,7 +1818,7 @@ m_megapullup(struct mbuf *m, int len)
 		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
index 5b89ca026e85..93953b18dfae 100644
--- a/sys/netinet/siftr.c
+++ b/sys/netinet/siftr.c
@@ -754,7 +754,7 @@ siftr_chkpkt(struct mbuf **m, struct ifnet *ifp, int flags,
 	 * 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 @@ siftr_chkpkt6(struct mbuf **m, struct ifnet *ifp, int flags,
 	 * 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
index e74d533f7baa..67cec1dbf26b 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -638,7 +638,7 @@ tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port)
 	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 @@ tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port)
 			}
 		}
 		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 @@ tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port)
 					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 @@ tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port)
 					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 @@ tcp_pulloutofband(struct socket *so, struct tcphdr *th, struct mbuf *m,
 
 	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
index 35fa0b56a9c7..0a5f673dbeb8 100644
--- a/sys/netinet/tcp_log_buf.c
+++ b/sys/netinet/tcp_log_buf.c
@@ -2266,10 +2266,10 @@ tcp_log_getlogbuf(struct sockopt *sopt, struct tcpcb *tp)
 		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 @@ tcp_log_getlogbuf(struct sockopt *sopt, struct tcpcb *tp)
 		}
 	}
 
-	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
index 961a1fa2cb31..9c7ad52dcd98 100644
--- a/sys/netinet/tcp_lro.c
+++ b/sys/netinet/tcp_lro.c
@@ -426,9 +426,10 @@ tcp_lro_parser(struct mbuf *m, struct lro_parser *po, struct lro_parser *pi, boo
 			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
index 8d88c4f734f6..09295544855f 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -1077,8 +1077,7 @@ send:
*** 965 LINES SKIPPED ***