FreeBSD/sys/contrib/ipfilter/netinet/mlfk_ipl.c
/*
 * In the VIMAGE case kern_sysctl.c already adds the vnet base address given
 * we set CTLFLAG_VNET to get proper access checks.  Have to undo this.
 * Then we add the given offset to the specific malloced struct hanging off
 * virtualized ipmain struct.
 */
In the VIMAGE case kern_sysctl.c already adds the vnet base address given
we set CTLFLAG_VNET to get proper access checks.  Have to undo this.
Then we add the given offset to the specific malloced struct hanging off
virtualized ipmain struct.
In the VIMAGE case kern_sysctl . c already adds the vnet base address given we set CTLFLAG_VNET to get proper access checks . Have to undo this . Then we add the given offset to the specific malloced struct hanging off virtualized ipmain struct .
static int
sysctl_ipf_int_nat ( SYSCTL_HANDLER_ARGS )
{
	if (arg1) {
		ipf_nat_softc_t *nat_softc;
		nat_softc = V_ipfmain.ipf_nat_soft;
#ifdef VIMAGE
		arg1 = (void *)((uintptr_t)arg1 - curvnet->vnet_data_base);
#endif
		arg1 = (void *)((uintptr_t)nat_softc + (uintptr_t)arg1);
	}
	return (sysctl_ipf_int(oidp, arg1, arg2, req));
}
static int sysctl_ipf_int_nat ( SYSCTL_HANDLER_ARGS ) { if ( arg1 ) { ipf_nat_softc_t * nat_softc ; nat_softc = V_ipfmain . ipf_nat_soft ; #ifdef VIMAGE arg1 = ( void * ) ( ( uintptr_t ) arg1 - curvnet -> vnet_data_base ) ; #endif arg1 = ( void * ) ( ( uintptr_t ) nat_softc + ( uintptr_t ) arg1 ) ; } return ( sysctl_ipf_int ( oidp , arg1 , arg2 , req ) ) ; }
In the VIMAGE case kern_sysctl.c already adds the vnet base address given
 we set CTLFLAG_VNET to get proper access checks.
In the VIMAGE case kern_sysctl . c already adds the vnet base address given we set CTLFLAG_VNET to get proper access checks .