summaryrefslogtreecommitdiffstats
path: root/sys/contrib
diff options
context:
space:
mode:
authorcy <cy@FreeBSD.org>2016-05-20 03:04:22 +0000
committercy <cy@FreeBSD.org>2016-05-20 03:04:22 +0000
commit932c0e5dafd6a9d1b5d7160027988622e77cf812 (patch)
tree2686d53dd63e0f6698d0c70dfeabdd209b8cea49 /sys/contrib
parent09fce610f95b1e08464b46c6bda32df7ba9c5c4a (diff)
downloadFreeBSD-src-932c0e5dafd6a9d1b5d7160027988622e77cf812.zip
FreeBSD-src-932c0e5dafd6a9d1b5d7160027988622e77cf812.tar.gz
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
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/ipfilter/netinet/ip_frag.c21
-rw-r--r--sys/contrib/ipfilter/netinet/ip_frag.h1
2 files changed, 21 insertions, 1 deletions
diff --git a/sys/contrib/ipfilter/netinet/ip_frag.c b/sys/contrib/ipfilter/netinet/ip_frag.c
index e0cc5f3..a1087a5 100644
--- a/sys/contrib/ipfilter/netinet/ip_frag.c
+++ b/sys/contrib/ipfilter/netinet/ip_frag.c
@@ -112,7 +112,7 @@ static void ipf_frag_free __P((ipf_frag_softc_t *, ipfr_t *));
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);
}
diff --git a/sys/contrib/ipfilter/netinet/ip_frag.h b/sys/contrib/ipfilter/netinet/ip_frag.h
index baa767d..08f45ff 100644
--- a/sys/contrib/ipfilter/netinet/ip_frag.h
+++ b/sys/contrib/ipfilter/netinet/ip_frag.h
@@ -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;
OpenPOWER on IntegriCloud