pf: remove the use of caddr_t
Replace caddr_t with void *, or more accurate types. Suggested by: glebius Reviewed by: zlei Differential Revision: https://reviews.freebsd.org/D40186
This commit is contained in:
+3
-3
@@ -1704,7 +1704,7 @@ struct pfioc_state_kill {
|
||||
struct pfioc_states {
|
||||
int ps_len;
|
||||
union {
|
||||
caddr_t ps_buf;
|
||||
void *ps_buf;
|
||||
struct pfsync_state *ps_states;
|
||||
};
|
||||
};
|
||||
@@ -1713,7 +1713,7 @@ struct pfioc_states_v2 {
|
||||
int ps_len;
|
||||
uint64_t ps_req_version;
|
||||
union {
|
||||
caddr_t ps_buf;
|
||||
void *ps_buf;
|
||||
struct pf_state_export *ps_states;
|
||||
};
|
||||
};
|
||||
@@ -1721,7 +1721,7 @@ struct pfioc_states_v2 {
|
||||
struct pfioc_src_nodes {
|
||||
int psn_len;
|
||||
union {
|
||||
caddr_t psn_buf;
|
||||
void *psn_buf;
|
||||
struct pf_src_node *psn_src_nodes;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1447,8 +1447,8 @@ pf_setup_pfsync_matching(struct pf_kruleset *rs)
|
||||
|
||||
if (rs->rules[rs_cnt].inactive.rcount) {
|
||||
rs->rules[rs_cnt].inactive.ptr_array =
|
||||
malloc(sizeof(caddr_t) *
|
||||
rs->rules[rs_cnt].inactive.rcount,
|
||||
mallocarray(rs->rules[rs_cnt].inactive.rcount,
|
||||
sizeof(struct pf_rule **),
|
||||
M_TEMP, M_NOWAIT);
|
||||
|
||||
if (!rs->rules[rs_cnt].inactive.ptr_array)
|
||||
|
||||
@@ -883,7 +883,7 @@ pf_reassemble6(struct mbuf **m0, struct ip6_hdr *ip6, struct ip6_frag *fraghdr,
|
||||
/* Take protocol from first fragment header. */
|
||||
m = m_getptr(m, hdrlen + offsetof(struct ip6_frag, ip6f_nxt), &off);
|
||||
KASSERT(m, ("%s: short mbuf chain", __func__));
|
||||
proto = *(mtod(m, caddr_t) + off);
|
||||
proto = *(mtod(m, uint8_t *) + off);
|
||||
m = *m0;
|
||||
|
||||
/* Delete frag6 header */
|
||||
@@ -967,7 +967,7 @@ pf_refragment6(struct ifnet *ifp, struct mbuf **m0, struct m_tag *mtag,
|
||||
m = m_getptr(m, extoff + offsetof(struct ip6_ext, ip6e_nxt),
|
||||
&off);
|
||||
KASSERT((m != NULL), ("pf_refragment6: short mbuf chain"));
|
||||
proto = *(mtod(m, caddr_t) + off);
|
||||
proto = *(mtod(m, uint8_t *) + off);
|
||||
*(mtod(m, char *) + off) = IPPROTO_FRAGMENT;
|
||||
m = *m0;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user