diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2003-08-14 19:00:14 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2003-08-14 19:00:14 +0000 |
commit | 0b6b054dde657918dadbf3772248943ce0b55147 (patch) | |
tree | f5af25b2e0ec57e752af356f3effb204879b1a59 /sys/net | |
parent | a14f69d270af41914f7c3d15a9858cb54baeefe0 (diff) |
m_copyback()'s 4th arg is const void *, nuke (caddr_t) casts.
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_vlan.c | 6 | ||||
-rw-r--r-- | sys/net/pf.c | 73 | ||||
-rw-r--r-- | sys/net/pf_norm.c | 4 | ||||
-rw-r--r-- | sys/net/rtsock.c | 6 |
4 files changed, 41 insertions, 48 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index fa15a9b4fa0..9a6ec88a038 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vlan.c,v 1.39 2003/07/25 03:45:42 jason Exp $ */ +/* $OpenBSD: if_vlan.c,v 1.40 2003/08/14 19:00:12 jason Exp $ */ /* * Copyright 1998 Massachusetts Institute of Technology * @@ -206,7 +206,7 @@ vlan_start(struct ifnet *ifp) sizeof(struct ether_vlan_header); m_copyback(m0, 0, sizeof(struct ether_vlan_header), - (caddr_t)&evh); + &evh); m = m0; } @@ -265,7 +265,7 @@ vlan_input_tag(struct mbuf *m, u_int16_t t) if (m->m_len < sizeof(struct ether_vlan_header) && (m = m_pullup(m, sizeof(struct ether_vlan_header))) == NULL) return (-1); - m_copyback(m, 0, sizeof(struct ether_vlan_header), (caddr_t)&vh); + m_copyback(m, 0, sizeof(struct ether_vlan_header), &vh); ether_input_mbuf(m->m_pkthdr.rcvif, m); return (-1); } diff --git a/sys/net/pf.c b/sys/net/pf.c index 01c1d371d97..3369361121c 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.382 2003/08/09 14:56:48 cedric Exp $ */ +/* $OpenBSD: pf.c,v 1.383 2003/08/14 19:00:12 jason Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -2267,7 +2267,7 @@ pf_test_tcp(struct pf_rule **rm, struct pf_state **sm, int direction, if (r->log) { if (rewrite) - m_copyback(m, off, sizeof(*th), (caddr_t)th); + m_copyback(m, off, sizeof(*th), th); PFLOG_PACKET(ifp, h, m, af, direction, reason, r, a, ruleset); } @@ -2455,7 +2455,7 @@ pf_test_tcp(struct pf_rule **rm, struct pf_state **sm, int direction, /* copy back packet headers if we performed NAT operations */ if (rewrite) - m_copyback(m, off, sizeof(*th), (caddr_t)th); + m_copyback(m, off, sizeof(*th), th); return (PF_PASS); } @@ -2585,7 +2585,7 @@ pf_test_udp(struct pf_rule **rm, struct pf_state **sm, int direction, if (r->log) { if (rewrite) - m_copyback(m, off, sizeof(*uh), (caddr_t)uh); + m_copyback(m, off, sizeof(*uh), uh); PFLOG_PACKET(ifp, h, m, af, direction, reason, r, a, ruleset); } @@ -2696,7 +2696,7 @@ pf_test_udp(struct pf_rule **rm, struct pf_state **sm, int direction, /* copy back packet headers if we performed NAT operations */ if (rewrite) - m_copyback(m, off, sizeof(*uh), (caddr_t)uh); + m_copyback(m, off, sizeof(*uh), uh); return (PF_PASS); } @@ -2864,7 +2864,7 @@ pf_test_icmp(struct pf_rule **rm, struct pf_state **sm, int direction, #ifdef INET6 if (rewrite) m_copyback(m, off, sizeof(struct icmp6_hdr), - (caddr_t)pd->hdr.icmp6); + pd->hdr.icmp6); #endif /* INET6 */ PFLOG_PACKET(ifp, h, m, af, direction, reason, r, a, ruleset); } @@ -2954,7 +2954,7 @@ pf_test_icmp(struct pf_rule **rm, struct pf_state **sm, int direction, /* copy back packet headers if we performed IPv6 NAT operations */ if (rewrite) m_copyback(m, off, sizeof(struct icmp6_hdr), - (caddr_t)pd->hdr.icmp6); + pd->hdr.icmp6); #endif /* INET6 */ return (PF_PASS); @@ -3674,10 +3674,10 @@ pf_test_state_tcp(struct pf_state **state, int direction, struct ifnet *ifp, pf_change_ap(pd->dst, &th->th_dport, pd->ip_sum, &th->th_sum, &(*state)->lan.addr, (*state)->lan.port, 0, pd->af); - m_copyback(m, off, sizeof(*th), (caddr_t)th); + m_copyback(m, off, sizeof(*th), th); } else if (copyback) { /* Copyback sequence modulation or stateful scrub changes */ - m_copyback(m, off, sizeof(*th), (caddr_t)th); + m_copyback(m, off, sizeof(*th), th); } (*state)->rule.ptr->packets++; @@ -3747,7 +3747,7 @@ pf_test_state_udp(struct pf_state **state, int direction, struct ifnet *ifp, pf_change_ap(pd->dst, &uh->uh_dport, pd->ip_sum, &uh->uh_sum, &(*state)->lan.addr, (*state)->lan.port, 1, pd->af); - m_copyback(m, off, sizeof(*uh), (caddr_t)uh); + m_copyback(m, off, sizeof(*uh), uh); } (*state)->rule.ptr->packets++; @@ -3843,7 +3843,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct ifnet *ifp, &(*state)->gwy.addr, 0); m_copyback(m, off, sizeof(struct icmp6_hdr), - (caddr_t)pd->hdr.icmp6); + pd->hdr.icmp6); break; #endif /* INET6 */ } @@ -3863,7 +3863,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct ifnet *ifp, &(*state)->lan.addr, 0); m_copyback(m, off, sizeof(struct icmp6_hdr), - (caddr_t)pd->hdr.icmp6); + pd->hdr.icmp6); break; #endif /* INET6 */ } @@ -4054,24 +4054,24 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct ifnet *ifp, #ifdef INET case AF_INET: m_copyback(m, off, ICMP_MINLEN, - (caddr_t)pd->hdr.icmp); + pd->hdr.icmp); m_copyback(m, ipoff2, sizeof(h2), - (caddr_t)&h2); + &h2); break; #endif /* INET */ #ifdef INET6 case AF_INET6: m_copyback(m, off, sizeof(struct icmp6_hdr), - (caddr_t)pd->hdr.icmp6); + pd->hdr.icmp6); m_copyback(m, ipoff2, sizeof(h2_6), - (caddr_t)&h2_6); + &h2_6); break; #endif /* INET6 */ } - m_copyback(m, off2, 8, (caddr_t)&th); + m_copyback(m, off2, 8, &th); } else if (src->seqdiff) { - m_copyback(m, off2, 8, (caddr_t)&th); + m_copyback(m, off2, 8, &th); } return (PF_PASS); @@ -4116,23 +4116,21 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct ifnet *ifp, #ifdef INET case AF_INET: m_copyback(m, off, ICMP_MINLEN, - (caddr_t)pd->hdr.icmp); - m_copyback(m, ipoff2, sizeof(h2), - (caddr_t)&h2); + pd->hdr.icmp); + m_copyback(m, ipoff2, sizeof(h2), &h2); break; #endif /* INET */ #ifdef INET6 case AF_INET6: m_copyback(m, off, sizeof(struct icmp6_hdr), - (caddr_t)pd->hdr.icmp6); + pd->hdr.icmp6); m_copyback(m, ipoff2, sizeof(h2_6), - (caddr_t)&h2_6); + &h2_6); break; #endif /* INET6 */ } - m_copyback(m, off2, sizeof(uh), - (caddr_t)&uh); + m_copyback(m, off2, sizeof(uh), &uh); } return (PF_PASS); @@ -4174,12 +4172,9 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct ifnet *ifp, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET); } - m_copyback(m, off, ICMP_MINLEN, - (caddr_t)pd->hdr.icmp); - m_copyback(m, ipoff2, sizeof(h2), - (caddr_t)&h2); - m_copyback(m, off2, ICMP_MINLEN, - (caddr_t)&iih); + m_copyback(m, off, ICMP_MINLEN, pd->hdr.icmp); + m_copyback(m, ipoff2, sizeof(h2), &h2); + m_copyback(m, off2, ICMP_MINLEN, &iih); } return (PF_PASS); @@ -4223,11 +4218,10 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct ifnet *ifp, pd->ip_sum, 0, AF_INET6); } m_copyback(m, off, sizeof(struct icmp6_hdr), - (caddr_t)pd->hdr.icmp6); - m_copyback(m, ipoff2, sizeof(h2_6), - (caddr_t)&h2_6); + pd->hdr.icmp6); + m_copyback(m, ipoff2, sizeof(h2_6), &h2_6); m_copyback(m, off2, sizeof(struct icmp6_hdr), - (caddr_t)&iih); + &iih); } return (PF_PASS); @@ -4264,18 +4258,17 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct ifnet *ifp, #ifdef INET case AF_INET: m_copyback(m, off, ICMP_MINLEN, - (caddr_t)pd->hdr.icmp); - m_copyback(m, ipoff2, sizeof(h2), - (caddr_t)&h2); + pd->hdr.icmp); + m_copyback(m, ipoff2, sizeof(h2), &h2); break; #endif /* INET */ #ifdef INET6 case AF_INET6: m_copyback(m, off, sizeof(struct icmp6_hdr), - (caddr_t)pd->hdr.icmp6); + pd->hdr.icmp6); m_copyback(m, ipoff2, sizeof(h2_6), - (caddr_t)&h2_6); + &h2_6); break; #endif /* INET6 */ } diff --git a/sys/net/pf_norm.c b/sys/net/pf_norm.c index 5765cd379d8..cc49e4ed1b3 100644 --- a/sys/net/pf_norm.c +++ b/sys/net/pf_norm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_norm.c,v 1.70 2003/07/17 16:25:52 frantzen Exp $ */ +/* $OpenBSD: pf_norm.c,v 1.71 2003/08/14 19:00:12 jason Exp $ */ /* * Copyright 2001 Niels Provos <provos@citi.umich.edu> @@ -1275,7 +1275,7 @@ pf_normalize_tcp(int dir, struct ifnet *ifp, struct mbuf *m, int ipoff, /* copy back packet headers if we sanitized */ if (rewrite) - m_copyback(m, off, sizeof(*th), (caddr_t)th); + m_copyback(m, off, sizeof(*th), th); return (PF_PASS); diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 93d5de65566..c17a79a0374 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsock.c,v 1.30 2003/07/05 00:00:32 itojun Exp $ */ +/* $OpenBSD: rtsock.c,v 1.31 2003/08/14 19:00:12 jason Exp $ */ /* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */ /* @@ -394,7 +394,7 @@ flush: if (dst) route_proto.sp_protocol = dst->sa_family; if (rtm) { - 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; @@ -494,7 +494,7 @@ rt_msg1(type, rtinfo) continue; rtinfo->rti_addrs |= (1 << i); dlen = ROUNDUP(sa->sa_len); - m_copyback(m, len, dlen, (caddr_t)sa); + m_copyback(m, len, dlen, sa); len += dlen; } if (m->m_pkthdr.len != len) { |