FreeBSD/sys/netinet/ip_reass.c
/*
 * Change the limit on the UMA zone, or disable the fragment allocation
 * at all.  Since 0 and -1 is a special values here, we need our own handler,
 * instead of sysctl_handle_uma_zone_max().
 */
Change the limit on the UMA zone, or disable the fragment allocation
at all.  Since 0 and -1 is a special values here, we need our own handler,
instead of sysctl_handle_uma_zone_max().
Change the limit on the UMA zone or disable the fragment allocation at all . Since 0 and - 1 is a special values here we need our own handler instead of sysctl_handle_uma_zone_max () .
static int
sysctl_maxfragpackets(SYSCTL_HANDLER_ARGS)
{
	int error, max;
	if (V_noreass == 0) {
		max = uma_zone_get_max(V_ipq_zone);
		if (max == 0)
			max = -1;
	} else 
		max = 0;
	error = sysctl_handle_int(oidp, &max, 0, req);
	if (error || !req->newptr)
		return (error);
	if (max > 0) {
		max = uma_zone_set_max(V_ipq_zone, max);
		ipreass_drain_tomax();
		V_noreass = 0;
	} else if (max == 0) {
		V_noreass = 1;
		ipreass_drain();
	} else if (max == -1) {
		V_noreass = 0;
		uma_zone_set_max(V_ipq_zone, 0);
	} else
		return (EINVAL);
	return (0);
}
static int sysctl_maxfragpackets ( SYSCTL_HANDLER_ARGS ) { int error , max ; if ( V_noreass == 0 ) { max = uma_zone_get_max ( V_ipq_zone ) ; if ( max == 0 ) max = -1 ; } else max = 0 ; error = sysctl_handle_int ( oidp , & max , 0 , req ) ; if ( error || ! req -> newptr ) return ( error ) ; if ( max > 0 ) { max = uma_zone_set_max ( V_ipq_zone , max ) ; ipreass_drain_tomax ( ) ; V_noreass = 0 ; } else if ( max == 0 ) { V_noreass = 1 ; ipreass_drain ( ) ; } else if ( max == -1 ) { V_noreass = 0 ; uma_zone_set_max ( V_ipq_zone , 0 ) ; } else return ( EINVAL ) ; return ( 0 ) ; }
Change the limit on the UMA zone, or disable the fragment allocation
 at all.
Change the limit on the UMA zone or disable the fragment allocation at all .
/*
		 * XXXRW: Might be a good idea to sanity check the argument
		 * and place an extreme upper bound.
		 */