diff options
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_ah.c | 20 | ||||
-rw-r--r-- | sys/netinet/ip_esp.c | 8 | ||||
-rw-r--r-- | sys/netinet/ip_icmp.c | 4 | ||||
-rw-r--r-- | sys/netinet/tcp_subr.c | 4 |
4 files changed, 17 insertions, 19 deletions
diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c index 5d1a30cc90e..c4a450f49cf 100644 --- a/sys/netinet/ip_ah.c +++ b/sys/netinet/ip_ah.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ah.c,v 1.145 2020/12/18 12:30:23 tobhe Exp $ */ +/* $OpenBSD: ip_ah.c,v 1.146 2021/02/25 02:48:21 dlg Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -327,7 +327,7 @@ ah_massage_headers(struct mbuf **m0, int af, int skip, int alg, int out) #ifdef INET6 case AF_INET6: /* Ugly... */ /* Copy and "cook" the IPv6 header. */ - m_copydata(m, 0, sizeof(ip6), (caddr_t) &ip6); + m_copydata(m, 0, sizeof(ip6), &ip6); /* We don't do IPv6 Jumbograms. */ if (ip6.ip6_plen == 0) { @@ -464,8 +464,7 @@ ah_massage_headers(struct mbuf **m0, int af, int skip, int alg, int out) sizeof(struct in6_addr) * (rh0->ip6r0_segleft - 1)); - m_copydata(m, 0, sizeof(ip6), - (caddr_t)&ip6); + m_copydata(m, 0, sizeof(ip6), &ip6); addr[0] = ip6.ip6_dst; ip6.ip6_dst = finaldst; error = m_copyback(m, 0, sizeof(ip6), @@ -539,13 +538,12 @@ ah_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) rplen = AH_FLENGTH + sizeof(u_int32_t); /* Save the AH header, we use it throughout. */ - m_copydata(m, skip + offsetof(struct ah, ah_hl), sizeof(u_int8_t), - (caddr_t) &hl); + m_copydata(m, skip + offsetof(struct ah, ah_hl), sizeof(u_int8_t), &hl); /* Replay window checking, if applicable. */ if (tdb->tdb_wnd > 0) { m_copydata(m, skip + offsetof(struct ah, ah_rpl), - sizeof(u_int32_t), (caddr_t) &btsx); + sizeof(u_int32_t), &btsx); btsx = ntohl(btsx); switch (checkreplaywindow(tdb, btsx, &esn, 0)) { @@ -668,7 +666,7 @@ ah_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) * Save the authenticator, the skipped portion of the packet, * and the AH header. */ - m_copydata(m, 0, skip + rplen + ahx->authsize, (caddr_t) (tc + 1)); + m_copydata(m, 0, skip + rplen + ahx->authsize, tc + 1); /* Zeroize the authenticator on the packet. */ m_copyback(m, skip + rplen, ahx->authsize, ipseczeroes, M_NOWAIT); @@ -751,7 +749,7 @@ ah_input_cb(struct tdb *tdb, struct tdb_crypto *tc, struct mbuf *m, int clen) /* Replay window checking, if applicable. */ if (tdb->tdb_wnd > 0) { m_copydata(m, skip + offsetof(struct ah, ah_rpl), - sizeof(u_int32_t), (caddr_t) &btsx); + sizeof(u_int32_t), &btsx); btsx = ntohl(btsx); switch (checkreplaywindow(tdb, btsx, &esn, 1)) { @@ -1034,7 +1032,7 @@ ah_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, ah = (struct ah *)(mtod(mi, caddr_t) + roff); /* Initialize the AH header. */ - m_copydata(m, protoff, sizeof(u_int8_t), (caddr_t) &ah->ah_nh); + m_copydata(m, protoff, sizeof(u_int8_t), &ah->ah_nh); ah->ah_hl = (rplen + ahx->authsize - AH_FLENGTH) / sizeof(u_int32_t); ah->ah_rv = 0; ah->ah_spi = tdb->tdb_spi; @@ -1087,7 +1085,7 @@ ah_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, } /* Save the skipped portion of the packet. */ - m_copydata(m, 0, skip, (caddr_t) (tc + 1)); + m_copydata(m, 0, skip, tc + 1); /* * Fix IP header length on the header used for diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c index 36b761273cd..a74bfd341ac 100644 --- a/sys/netinet/ip_esp.c +++ b/sys/netinet/ip_esp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp.c,v 1.161 2020/12/18 12:30:23 tobhe Exp $ */ +/* $OpenBSD: ip_esp.c,v 1.162 2021/02/25 02:48:21 dlg Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -373,7 +373,7 @@ esp_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) /* Replay window checking, if appropriate -- no value commitment. */ if (tdb->tdb_wnd > 0) { m_copydata(m, skip + sizeof(u_int32_t), sizeof(u_int32_t), - (unsigned char *) &btsx); + &btsx); btsx = ntohl(btsx); switch (checkreplaywindow(tdb, btsx, &esn, 0)) { @@ -484,7 +484,7 @@ esp_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) crda->crd_len = m->m_pkthdr.len - (skip + alen); /* Copy the authenticator */ - m_copydata(m, m->m_pkthdr.len - alen, alen, (caddr_t)(tc + 1)); + m_copydata(m, m->m_pkthdr.len - alen, alen, tc + 1); } else crde = &crp->crp_desc[0]; @@ -576,7 +576,7 @@ esp_input_cb(struct tdb *tdb, struct tdb_crypto *tc, struct mbuf *m, int clen) /* Replay window checking, if appropriate */ if (tdb->tdb_wnd > 0) { m_copydata(m, skip + sizeof(u_int32_t), sizeof(u_int32_t), - (unsigned char *) &btsx); + &btsx); btsx = ntohl(btsx); switch (checkreplaywindow(tdb, btsx, &esn, 1)) { diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 5deaa3822a8..a007aa6c2b3 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_icmp.c,v 1.184 2020/12/20 21:15:47 bluhm Exp $ */ +/* $OpenBSD: ip_icmp.c,v 1.185 2021/02/25 02:48:21 dlg Exp $ */ /* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */ /* @@ -259,7 +259,7 @@ icmp_do_error(struct mbuf *n, int type, int code, u_int32_t dest, int destmtu) } icp->icmp_code = code; - m_copydata(n, 0, icmplen, (caddr_t)&icp->icmp_ip); + m_copydata(n, 0, icmplen, &icp->icmp_ip); /* * Now, copy old ip header (without options) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 464130a457e..49f3aa89765 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.175 2020/07/24 20:39:03 cheloha Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.176 2021/02/25 02:48:21 dlg Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -654,7 +654,7 @@ tcp6_ctlinput(int cmd, struct sockaddr *sa, u_int rdomain, void *d) return; bzero(&th, sizeof(th)); - m_copydata(m, off, sizeof(*thp), (caddr_t)&th); + m_copydata(m, off, sizeof(*thp), &th); /* * Check to see if we have a valid TCP connection |