Module Name:    src
Committed By:   maxv
Date:           Sun Jun  3 10:37:23 UTC 2018

Modified Files:
        src/sys/external/bsd/ipf/netinet: fil.c ip_fil.h ip_frag.c ip_ftp_pxy.c
            ip_log.c ip_nat.c ip_proxy.c ip_state.c ip_tftp_pxy.c

Log Message:
Constify a bunch of global varialbes under ipf/ so that they land in
.rodata (3472 bytes).

Also, remove ipf_tuneables[], unused.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/external/bsd/ipf/netinet/fil.c
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/ipf/netinet/ip_fil.h \
    src/sys/external/bsd/ipf/netinet/ip_tftp_pxy.c
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/ipf/netinet/ip_frag.c \
    src/sys/external/bsd/ipf/netinet/ip_ftp_pxy.c \
    src/sys/external/bsd/ipf/netinet/ip_proxy.c
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/ipf/netinet/ip_log.c
cvs rdiff -u -r1.19 -r1.20 src/sys/external/bsd/ipf/netinet/ip_nat.c
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/ipf/netinet/ip_state.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/ipf/netinet/fil.c
diff -u src/sys/external/bsd/ipf/netinet/fil.c:1.22 src/sys/external/bsd/ipf/netinet/fil.c:1.23
--- src/sys/external/bsd/ipf/netinet/fil.c:1.22	Sun Feb  4 08:19:42 2018
+++ src/sys/external/bsd/ipf/netinet/fil.c	Sun Jun  3 10:37:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fil.c,v 1.22 2018/02/04 08:19:42 mrg Exp $	*/
+/*	$NetBSD: fil.c,v 1.23 2018/06/03 10:37:23 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -138,7 +138,7 @@ extern struct timeout ipf_slowtimer_ch;
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.22 2018/02/04 08:19:42 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.23 2018/06/03 10:37:23 maxv Exp $");
 #else
 static const char sccsid[] = "@(#)fil.c	1.36 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: fil.c,v 1.1.1.2 2012/07/22 13:45:07 darrenr Exp $";
@@ -304,7 +304,7 @@ static ipfunc_resolve_t ipf_availfuncs[]
 	{ "",	       NULL,	      NULL,	      NULL }
 };
 
-static ipftuneable_t ipf_main_tuneables[] = {
+static const ipftuneable_t ipf_main_tuneables[] = {
 	{ { (void *)offsetof(struct ipf_main_softc_s, ipf_flags) },
 		"ipf_flags",		0,	0xffffffff,
 		stsizeof(ipf_main_softc_t, ipf_flags),
@@ -6923,7 +6923,7 @@ ipf_tune_array_unlink(ipf_main_softc_t *
 /* ipftp_void that points to the stored value.                              */
 /* ------------------------------------------------------------------------ */
 ipftuneable_t *
-ipf_tune_array_copy(void *base, size_t size, ipftuneable_t *template)
+ipf_tune_array_copy(void *base, size_t size, const ipftuneable_t *template)
 {
 	ipftuneable_t *copy;
 	int i;

Index: src/sys/external/bsd/ipf/netinet/ip_fil.h
diff -u src/sys/external/bsd/ipf/netinet/ip_fil.h:1.5 src/sys/external/bsd/ipf/netinet/ip_fil.h:1.6
--- src/sys/external/bsd/ipf/netinet/ip_fil.h:1.5	Sat Jun 29 21:06:57 2013
+++ src/sys/external/bsd/ipf/netinet/ip_fil.h	Sun Jun  3 10:37:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_fil.h,v 1.5 2013/06/29 21:06:57 rmind Exp $	*/
+/*	$NetBSD: ip_fil.h,v 1.6 2018/06/03 10:37:23 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -1881,7 +1881,7 @@ extern	int	ipf_tune_array_link(ipf_main_
 extern	int	ipf_tune_array_unlink(ipf_main_softc_t *,
 					   ipftuneable_t *);
 extern	ipftuneable_t *ipf_tune_array_copy(void *, size_t,
-						ipftuneable_t *);
+						const ipftuneable_t *);
 
 extern int	ipf_pr_pullup(fr_info_t *, int);
 
Index: src/sys/external/bsd/ipf/netinet/ip_tftp_pxy.c
diff -u src/sys/external/bsd/ipf/netinet/ip_tftp_pxy.c:1.5 src/sys/external/bsd/ipf/netinet/ip_tftp_pxy.c:1.6
--- src/sys/external/bsd/ipf/netinet/ip_tftp_pxy.c:1.5	Mon Jul 30 19:27:47 2012
+++ src/sys/external/bsd/ipf/netinet/ip_tftp_pxy.c	Sun Jun  3 10:37:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_tftp_pxy.c,v 1.5 2012/07/30 19:27:47 pgoyette Exp $	*/
+/*	$NetBSD: ip_tftp_pxy.c,v 1.6 2018/06/03 10:37:23 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -49,7 +49,7 @@ typedef struct tftpinfo {
 	ipnat_t		*ti_rule;
 } tftpinfo_t;
 
-static  ipftuneable_t   ipf_tftp_tuneables[] = {
+static  const ipftuneable_t   ipf_tftp_tuneables[] = {
 	{ { (void *)offsetof(ipf_tftp_softc_t, ipf_p_tftp_readonly) },
 		"tftp_read_only",	0,	1,
 		stsizeof(ipf_tftp_softc_t, ipf_p_tftp_readonly),

Index: src/sys/external/bsd/ipf/netinet/ip_frag.c
diff -u src/sys/external/bsd/ipf/netinet/ip_frag.c:1.6 src/sys/external/bsd/ipf/netinet/ip_frag.c:1.7
--- src/sys/external/bsd/ipf/netinet/ip_frag.c:1.6	Thu May  3 07:13:48 2018
+++ src/sys/external/bsd/ipf/netinet/ip_frag.c	Sun Jun  3 10:37:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_frag.c,v 1.6 2018/05/03 07:13:48 maxv Exp $	*/
+/*	$NetBSD: ip_frag.c,v 1.7 2018/06/03 10:37:23 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -86,7 +86,7 @@ struct file;
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_frag.c,v 1.6 2018/05/03 07:13:48 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_frag.c,v 1.7 2018/06/03 10:37:23 maxv Exp $");
 #else
 static const char sccsid[] = "@(#)ip_frag.c	1.11 3/24/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_frag.c,v 1.1.1.2 2012/07/22 13:45:17 darrenr Exp";
@@ -136,21 +136,6 @@ static void ipf_frag_free(ipf_frag_softc
 
 static frentry_t ipfr_block;
 
-ipftuneable_t ipf_tuneables[] = {
-	{ { (void *)offsetof(ipf_frag_softc_t, ipfr_size) },
-		"frag_size",		1,	0x7fffffff,
-		stsizeof(ipf_frag_softc_t, ipfr_size),
-		IPFT_WRDISABLED,	NULL,	NULL },
-	{ { (void *)offsetof(ipf_frag_softc_t, ipfr_ttl) },
-		"frag_ttl",		1,	0x7fffffff,
-		stsizeof(ipf_frag_softc_t, ipfr_ttl),
-		0,			NULL,	NULL },
-	{ { NULL },
-		NULL,			0,	0,
-		0,
-		0,			NULL,	NULL }
-};
-
 #define	FBUMP(x)	softf->ipfr_stats.x++
 #define	FBUMPD(x)	do { softf->ipfr_stats.x++; DT(x); } while (0)
 
Index: src/sys/external/bsd/ipf/netinet/ip_ftp_pxy.c
diff -u src/sys/external/bsd/ipf/netinet/ip_ftp_pxy.c:1.6 src/sys/external/bsd/ipf/netinet/ip_ftp_pxy.c:1.7
--- src/sys/external/bsd/ipf/netinet/ip_ftp_pxy.c:1.6	Sun Oct 16 05:11:34 2016
+++ src/sys/external/bsd/ipf/netinet/ip_ftp_pxy.c	Sun Jun  3 10:37:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_ftp_pxy.c,v 1.6 2016/10/16 05:11:34 mrg Exp $	*/
+/*	$NetBSD: ip_ftp_pxy.c,v 1.7 2018/06/03 10:37:23 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -12,7 +12,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: ip_ftp_pxy.c,v 1.6 2016/10/16 05:11:34 mrg Exp $");
+__KERNEL_RCSID(1, "$NetBSD: ip_ftp_pxy.c,v 1.7 2018/06/03 10:37:23 maxv Exp $");
 
 #define	IPF_FTP_PROXY
 
@@ -120,7 +120,7 @@ void ipf_p_ftp_setpending(ipf_main_softc
 
 static	int	ipf_p_ftp_proxy_init = 0;
 static	frentry_t	ftppxyfr;
-static	ipftuneable_t	ipf_ftp_tuneables[] = {
+static	const ipftuneable_t	ipf_ftp_tuneables[] = {
 	{ { (void *)offsetof(ipf_ftp_softc_t, ipf_p_ftp_debug) },
 		"ftp_debug",	0,	0x7f,
 		stsizeof(ipf_ftp_softc_t, ipf_p_ftp_debug),
Index: src/sys/external/bsd/ipf/netinet/ip_proxy.c
diff -u src/sys/external/bsd/ipf/netinet/ip_proxy.c:1.6 src/sys/external/bsd/ipf/netinet/ip_proxy.c:1.7
--- src/sys/external/bsd/ipf/netinet/ip_proxy.c:1.6	Thu May  3 07:13:48 2018
+++ src/sys/external/bsd/ipf/netinet/ip_proxy.c	Sun Jun  3 10:37:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_proxy.c,v 1.6 2018/05/03 07:13:48 maxv Exp $	*/
+/*	$NetBSD: ip_proxy.c,v 1.7 2018/06/03 10:37:23 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -103,7 +103,7 @@ struct file;
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_proxy.c,v 1.6 2018/05/03 07:13:48 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_proxy.c,v 1.7 2018/06/03 10:37:23 maxv Exp $");
 #else
 static const char rcsid[] = "@(#)Id: ip_proxy.c,v 1.1.1.2 2012/07/22 13:45:33 darrenr Exp";
 #endif
@@ -124,7 +124,7 @@ typedef struct ipf_proxy_softc_s {
 	ipftuneable_t	*ipf_proxy_tune;
 } ipf_proxy_softc_t;
 
-static ipftuneable_t ipf_proxy_tuneables[] = {
+static const ipftuneable_t ipf_proxy_tuneables[] = {
 	{ { (void *)offsetof(ipf_proxy_softc_t, ips_proxy_debug) },
 		"proxy_debug",	0,	0x1f,
 		stsizeof(ipf_proxy_softc_t, ips_proxy_debug),

Index: src/sys/external/bsd/ipf/netinet/ip_log.c
diff -u src/sys/external/bsd/ipf/netinet/ip_log.c:1.7 src/sys/external/bsd/ipf/netinet/ip_log.c:1.8
--- src/sys/external/bsd/ipf/netinet/ip_log.c:1.7	Thu May  3 07:13:48 2018
+++ src/sys/external/bsd/ipf/netinet/ip_log.c	Sun Jun  3 10:37:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_log.c,v 1.7 2018/05/03 07:13:48 maxv Exp $	*/
+/*	$NetBSD: ip_log.c,v 1.8 2018/06/03 10:37:23 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -9,7 +9,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_log.c,v 1.7 2018/05/03 07:13:48 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_log.c,v 1.8 2018/06/03 10:37:23 maxv Exp $");
 
 #include <sys/param.h>
 #if defined(KERNEL) || defined(_KERNEL)
@@ -174,7 +174,7 @@ static int magic[IPL_LOGSIZE] = { IPL_MA
 				  IPL_MAGIC, IPL_MAGIC, IPL_MAGIC,
 				  IPL_MAGIC, IPL_MAGIC };
 
-static ipftuneable_t ipf_log_tuneables[] = {
+static const ipftuneable_t ipf_log_tuneables[] = {
 	/* log */
 	{ { (void *)offsetof(ipf_log_softc_t, ipl_suppress) },
 		"log_suppress",		0,	1,

Index: src/sys/external/bsd/ipf/netinet/ip_nat.c
diff -u src/sys/external/bsd/ipf/netinet/ip_nat.c:1.19 src/sys/external/bsd/ipf/netinet/ip_nat.c:1.20
--- src/sys/external/bsd/ipf/netinet/ip_nat.c:1.19	Thu May  3 07:13:48 2018
+++ src/sys/external/bsd/ipf/netinet/ip_nat.c	Sun Jun  3 10:37:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_nat.c,v 1.19 2018/05/03 07:13:48 maxv Exp $	*/
+/*	$NetBSD: ip_nat.c,v 1.20 2018/06/03 10:37:23 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -112,7 +112,7 @@ extern struct ifnet vpnif;
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_nat.c,v 1.19 2018/05/03 07:13:48 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_nat.c,v 1.20 2018/06/03 10:37:23 maxv Exp $");
 #else
 static const char sccsid[] = "@(#)ip_nat.c	1.11 6/5/96 (C) 1995 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_nat.c,v 1.1.1.2 2012/07/22 13:45:27 darrenr Exp";
@@ -138,7 +138,7 @@ static const char rcsid[] = "@(#)Id: ip_
 
 frentry_t	ipfnatblock;
 
-static ipftuneable_t ipf_nat_tuneables[] = {
+static const ipftuneable_t ipf_nat_tuneables[] = {
 	/* nat */
 	{ { (void *)offsetof(ipf_nat_softc_t, ipf_nat_lock) },
 		"nat_lock",	0,	1,

Index: src/sys/external/bsd/ipf/netinet/ip_state.c
diff -u src/sys/external/bsd/ipf/netinet/ip_state.c:1.10 src/sys/external/bsd/ipf/netinet/ip_state.c:1.11
--- src/sys/external/bsd/ipf/netinet/ip_state.c:1.10	Thu Oct 12 20:54:36 2017
+++ src/sys/external/bsd/ipf/netinet/ip_state.c	Sun Jun  3 10:37:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_state.c,v 1.10 2017/10/12 20:54:36 christos Exp $	*/
+/*	$NetBSD: ip_state.c,v 1.11 2018/06/03 10:37:23 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -100,7 +100,7 @@ struct file;
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_state.c,v 1.10 2017/10/12 20:54:36 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_state.c,v 1.11 2018/06/03 10:37:23 maxv Exp $");
 #else
 static const char sccsid[] = "@(#)ip_state.c	1.8 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_state.c,v 1.1.1.2 2012/07/22 13:45:37 darrenr Exp";
@@ -108,7 +108,7 @@ static const char rcsid[] = "@(#)Id: ip_
 #endif
 
 
-static ipftuneable_t ipf_state_tuneables[] = {
+static const ipftuneable_t ipf_state_tuneables[] = {
 	{ { (void *)offsetof(ipf_state_softc_t, ipf_state_max) },
 		"state_max",		1,	0x7fffffff,
 		stsizeof(ipf_state_softc_t, ipf_state_max),

Reply via email to