ipfilter: Cast uintmax_t values to size_t when adding to a pointer.

GCC warns about the mismatched sizes on 32-bit platforms where
uintmax_t is larger in size than a pointer.

Reviewed by:	imp, cy
Differential Revision:	https://reviews.freebsd.org/D36753
This commit is contained in:
John Baldwin 2022-09-28 13:58:34 -07:00
parent c5eed4146f
commit 9c4f7e8234

View File

@ -383,7 +383,7 @@ sysctl_ipf_int_nat ( SYSCTL_HANDLER_ARGS )
ipf_nat_softc_t *nat_softc;
nat_softc = V_ipfmain.ipf_nat_soft;
arg1 = (void *)((uintptr_t)nat_softc + arg2);
arg1 = (void *)((uintptr_t)nat_softc + (size_t)arg2);
return (sysctl_ipf_int(oidp, arg1, 0, req));
}
@ -397,7 +397,7 @@ sysctl_ipf_int_state ( SYSCTL_HANDLER_ARGS )
ipf_state_softc_t *state_softc;
state_softc = V_ipfmain.ipf_state_soft;
arg1 = (void *)((uintptr_t)state_softc + arg2);
arg1 = (void *)((uintptr_t)state_softc + (size_t)arg2);
return (sysctl_ipf_int(oidp, arg1, 0, req));
}
@ -411,7 +411,7 @@ sysctl_ipf_int_auth ( SYSCTL_HANDLER_ARGS )
ipf_auth_softc_t *auth_softc;
auth_softc = V_ipfmain.ipf_auth_soft;
arg1 = (void *)((uintptr_t)auth_softc + arg2);
arg1 = (void *)((uintptr_t)auth_softc + (size_t)arg2);
return (sysctl_ipf_int(oidp, arg1, 0, req));
}
@ -425,7 +425,7 @@ sysctl_ipf_int_frag ( SYSCTL_HANDLER_ARGS )
ipf_frag_softc_t *frag_softc;
frag_softc = V_ipfmain.ipf_frag_soft;
arg1 = (void *)((uintptr_t)frag_softc + arg2);
arg1 = (void *)((uintptr_t)frag_softc + (size_t)arg2);
return (sysctl_ipf_int(oidp, arg1, 0, req));
}