All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch to save ca 100.000 kbyte, integrate save & restore to iptables
@ 2004-09-20 15:24 Jan Holmberg
  2004-09-21 14:16 ` Harald Welte
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Holmberg @ 2004-09-20 15:24 UTC (permalink / raw)
  To: netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 191 bytes --]

Hi all,

A patch to save flash memory in embedded system  and make a symbolic 
link to iptables
to iptables-save and iptables-restore. More than 100.000 kbyte saved 
with this patch.


//Jan

[-- Attachment #2: patch-iptables-1.2.9-hoj.diff --]
[-- Type: text/plain, Size: 2257 bytes --]

diff -ur iptables-1.2.9/iptables-restore.c iptables-1.2.9-p/iptables-restore.c
--- iptables-1.2.9/iptables-restore.c	Sat May  3 20:52:13 2003
+++ iptables-1.2.9-p/iptables-restore.c	Sun May 23 23:14:51 2004
@@ -97,7 +97,7 @@
 		free(newargv[i]);
 }
 
-int main(int argc, char *argv[])
+int do_restore(int argc, char *argv[])
 {
 	iptc_handle_t handle = NULL;
 	char buffer[10240];
Only in iptables-1.2.9-p/: iptables-save
diff -ur iptables-1.2.9/iptables-save.c iptables-1.2.9-p/iptables-save.c
--- iptables-1.2.9/iptables-save.c	Sat May  3 20:52:13 2003
+++ iptables-1.2.9-p/iptables-save.c	Sun May 23 22:46:22 2004
@@ -313,7 +313,7 @@
  * :Chain name POLICY packets bytes
  * rule
  */
-int main(int argc, char *argv[])
+int do_save(int argc, char *argv[])
 {
 	const char *tablename = NULL;
 	int c;
diff -ur iptables-1.2.9/iptables-standalone.c iptables-1.2.9-p/iptables-standalone.c
--- iptables-1.2.9/iptables-standalone.c	Thu Aug  8 15:36:19 2002
+++ iptables-1.2.9-p/iptables-standalone.c	Sun May 23 23:15:52 2004
@@ -37,6 +37,10 @@
 #include <string.h>
 #include <iptables.h>
 
+int do_save(int, char *[]);
+ 
+int do_restore(int, char *[]);
+ 
 int
 main(int argc, char *argv[])
 {
@@ -50,7 +54,15 @@
 #ifdef NO_SHARED_LIBS
 	init_extensions();
 #endif
-
+  
+        if ( strlen(argv[0]) >=13 && 
+          !strncmp(argv[0]+strlen(argv[0])-13,"iptables-save",13)) 
+             return (do_save(argc, argv));  
+          
+        if ( strlen(argv[0]) >=16 && 
+          !strncmp(argv[0]+strlen(argv[0])-16,"iptables-restore",16)) 
+             return (do_restore(argc, argv));  
+          
 	ret = do_command(argc, argv, &table, &handle);
 	if (ret)
 		ret = iptc_commit(&handle);
@@ -58,6 +70,6 @@
 	if (!ret)
 		fprintf(stderr, "iptables: %s\n",
 			iptc_strerror(errno));
-
+        
 	exit(!ret);
 }
Only in iptables-1.2.9-p/: iptables-standalone.d
diff -ur iptables-1.2.9/iptables.c iptables-1.2.9-p/iptables.c
--- iptables-1.2.9/iptables.c	Sun Jun 15 00:39:35 2003
+++ iptables-1.2.9-p/iptables.c	Sun May 23 22:30:18 2004
@@ -2296,3 +2296,4 @@
 
 	return ret;
 }
+
Only in iptables-1.2.9-p/: iptables.d
Only in iptables-1.2.9-p/libiptc: libip4tc.d
Only in iptables-1.2.9-p/libiptc: libip6tc.d
Only in iptables-1.2.9-p/: patch-o-matic

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Patch to save ca 100.000 kbyte, integrate save & restore to iptables
  2004-09-20 15:24 Patch to save ca 100.000 kbyte, integrate save & restore to iptables Jan Holmberg
@ 2004-09-21 14:16 ` Harald Welte
  0 siblings, 0 replies; 2+ messages in thread
From: Harald Welte @ 2004-09-21 14:16 UTC (permalink / raw)
  To: Jan Holmberg; +Cc: netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 737 bytes --]

On Mon, Sep 20, 2004 at 05:24:08PM +0200, Jan Holmberg wrote:
> Hi all,
> 
> A patch to save flash memory in embedded system  and make a symbolic 
> link to iptables to iptables-save and iptables-restore. More than
> 100.000 kbyte saved with this patch.

Thanks, but this is already implemented in our CVS tree since Fri Jun 25
11:18:57 2004 UTC

> //Jan
-- 
- Harald Welte <laforge@netfilter.org>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-09-21 14:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-20 15:24 Patch to save ca 100.000 kbyte, integrate save & restore to iptables Jan Holmberg
2004-09-21 14:16 ` Harald Welte

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.