svn commit: r300259 - head/sys/contrib/ipfilter/netinet

Cy Schubert Cy.Schubert at komquats.com
Fri May 20 03:27:26 UTC 2016


In message <201605200304.u4K34NTL019720 at repo.freebsd.org>, Cy Schubert 
writes:
> Author: cy
> Date: Fri May 20 03:04:22 2016
> New Revision: 300259
> URL: https://svnweb.freebsd.org/changeset/base/300259
> 
> Log:
>   Enable the two ip_frag tuneables. The code is there but the two
>   ip_frag tuneables aren't registered in the ipf_tuners linked list.
>   This commmit enables the two existing ip_frag tuneables by registering
>   them.
>   
>   MFC after:	1 month
> 
> Modified:
>   head/sys/contrib/ipfilter/netinet/ip_frag.c
>   head/sys/contrib/ipfilter/netinet/ip_frag.h
> 
> Modified: head/sys/contrib/ipfilter/netinet/ip_frag.c
> =============================================================================
> =
> --- head/sys/contrib/ipfilter/netinet/ip_frag.c	Fri May 20 03:03:04 201
> 6	(r300258)
> +++ head/sys/contrib/ipfilter/netinet/ip_frag.c	Fri May 20 03:04:22 201
> 6	(r300259)
> @@ -112,7 +112,7 @@ static void ipf_frag_free __P((ipf_frag_
>  
>  static frentry_t ipfr_block;
>  
> -const ipftuneable_t ipf_tuneables[] = {
> +static ipftuneable_t ipf_frag_tuneables[] = {
>  	{ { (void *)offsetof(ipf_frag_softc_t, ipfr_size) },
>  		"frag_size",		1,	0x7fffffff,
>  		stsizeof(ipf_frag_softc_t, ipfr_size),
> @@ -189,6 +189,18 @@ ipf_frag_soft_create(softc)
>  	RWLOCK_INIT(&softf->ipfr_frag, "ipf fragment rwlock");
>  	RWLOCK_INIT(&softf->ipfr_natfrag, "ipf NAT fragment rwlock");
>  
> +	softf->ipf_frag_tune = ipf_tune_array_copy(softf,
> +						   sizeof(ipf_frag_tuneables),
> +						   ipf_frag_tuneables);
> +	if (softf->ipf_frag_tune == NULL) {
> +		ipf_frag_soft_destroy(softc, softf);
> +		return NULL;
> +	}
> +	if (ipf_tune_array_link(softc, softf->ipf_frag_tune) == -1) {
> +		ipf_frag_soft_destroy(softc, softf);
> +		return NULL;
> +	}
> +
>  	softf->ipfr_size = IPFT_SIZE;
>  	softf->ipfr_ttl = IPF_TTLVAL(60);
>  	softf->ipfr_lock = 1;
> @@ -219,6 +231,13 @@ ipf_frag_soft_destroy(softc, arg)
>  	RW_DESTROY(&softf->ipfr_frag);
>  	RW_DESTROY(&softf->ipfr_natfrag);
>  
> +	if (softf->ipf_frag_tune != NULL) {
> +		ipf_tune_array_unlink(softc, softf->ipf_frag_tune);
> +		KFREES(softf->ipf_frag_tune, sizeof(ipf_frag_tuneables));
> +		softf->ipf_frag_tune = NULL;
> +	}
> +
> +
>  	KFREE(softf);
>  }
>  
> 
> Modified: head/sys/contrib/ipfilter/netinet/ip_frag.h
> =============================================================================
> =
> --- head/sys/contrib/ipfilter/netinet/ip_frag.h	Fri May 20 03:03:04 201
> 6	(r300258)
> +++ head/sys/contrib/ipfilter/netinet/ip_frag.h	Fri May 20 03:04:22 201
> 6	(r300259)
> @@ -78,6 +78,7 @@ typedef struct ipf_frag_softc_s  {
>  	int		ipfr_ttl;
>  	int		ipfr_lock;
>  	int		ipfr_inited;
> +	ipftuneable_t	*ipf_frag_tune;
>  	ipfr_t		*ipfr_list;
>  	ipfr_t		**ipfr_tail;
>  	ipfr_t		*ipfr_natlist;
> 

Darren Reed has been notified so that this patch can be included in the 
upline ipfilter repo.


-- 
Cheers,
Cy Schubert <Cy.Schubert at komquats.com> or <Cy.Schubert at cschubert.com>
FreeBSD UNIX:  <cy at FreeBSD.org>   Web:  http://www.FreeBSD.org

	The need of the many outweighs the greed of the few.




More information about the svn-src-head mailing list