Author: pluto
Date: Thu Jun 16 23:34:15 2005
New Revision: 6107
Modified:
netfilter-2.6/iptables/trunk/ip6tables-restore.c
netfilter-2.6/iptables/trunk/iptables-restore.c
Log:
- flush chain with noflush when it is redefined (Charlie Brady).
Modified: netfilter-2.6/iptables/trunk/ip6tables-restore.c
==============================================================================
--- netfilter-2.6/iptables/trunk/ip6tables-restore.c (original)
+++ netfilter-2.6/iptables/trunk/ip6tables-restore.c Thu Jun 16 23:34:15 2005
@@ -7,7 +7,7 @@
* Rusty Russell <[EMAIL PROTECTED]>
* This code is distributed under the terms of GNU GPL v2
*
- * $Id: ip6tables-restore.c 3504 2004-12-27 19:49:28Z
/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=gandalf/[EMAIL
PROTECTED] $
+ * $Id: ip6tables-restore.c 3980 2005-06-12 15:54:15Z
/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=kaber/[EMAIL
PROTECTED] $
*/
#include <getopt.h>
@@ -233,12 +233,21 @@
}
if (ip6tc_builtin(chain, handle) <= 0) {
- DEBUGP("Creating new chain '%s'\n", chain);
- if (!ip6tc_create_chain(chain, &handle))
- exit_error(PARAMETER_PROBLEM,
- "error creating chain "
- "'%s':%s\n", chain,
- strerror(errno));
+ if (noflush && ip6tc_is_chain(chain, handle)) {
+ DEBUGP("Flushing existing user defined
chain '%s'\n", chain);
+ if (!ip6tc_flush_entries(chain,
&handle))
+ exit_error(PARAMETER_PROBLEM,
+ "error flushing
chain "
+ "'%s':%s\n", chain,
+ strerror(errno));
+ } else {
+ DEBUGP("Creating new chain '%s'\n",
chain);
+ if (!ip6tc_create_chain(chain, &handle))
+ exit_error(PARAMETER_PROBLEM,
+ "error creating
chain "
+ "'%s':%s\n", chain,
+ strerror(errno));
+ }
}
policy = strtok(NULL, " \t\n");
Modified: netfilter-2.6/iptables/trunk/iptables-restore.c
==============================================================================
--- netfilter-2.6/iptables/trunk/iptables-restore.c (original)
+++ netfilter-2.6/iptables/trunk/iptables-restore.c Thu Jun 16 23:34:15 2005
@@ -4,7 +4,7 @@
*
* This code is distributed under the terms of GNU GPL v2
*
- * $Id: iptables-restore.c 3504 2004-12-27 19:49:28Z
/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=gandalf/[EMAIL
PROTECTED] $
+ * $Id: iptables-restore.c 3980 2005-06-12 15:54:15Z
/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=kaber/[EMAIL
PROTECTED] $
*/
#include <getopt.h>
@@ -236,12 +236,21 @@
}
if (iptc_builtin(chain, handle) <= 0) {
- DEBUGP("Creating new chain '%s'\n", chain);
- if (!iptc_create_chain(chain, &handle))
- exit_error(PARAMETER_PROBLEM,
- "error creating chain "
- "'%s':%s\n", chain,
- strerror(errno));
+ if (noflush && iptc_is_chain(chain, handle)) {
+ DEBUGP("Flushing existing user defined
chain '%s'\n", chain);
+ if (!iptc_flush_entries(chain, &handle))
+ exit_error(PARAMETER_PROBLEM,
+ "error flushing
chain "
+ "'%s':%s\n", chain,
+ strerror(errno));
+ } else {
+ DEBUGP("Creating new chain '%s'\n",
chain);
+ if (!iptc_create_chain(chain, &handle))
+ exit_error(PARAMETER_PROBLEM,
+ "error creating
chain "
+ "'%s':%s\n", chain,
+ strerror(errno));
+ }
}
policy = strtok(NULL, " \t\n");
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit