iptables/iptables-1.3.0-cleanup.patch

75 lines
2.2 KiB
Diff
Raw Normal View History

--- iptables-1.3.0/extensions/libipt_rpc.c.cleanup 2005-11-09 16:37:34.000000000 +0100
+++ iptables-1.3.0/extensions/libipt_rpc.c 2005-11-09 16:37:38.000000000 +0100
@@ -205,7 +205,7 @@
memset(buf, 0, sizeof(buf));
- for (src=string, dst=buf; term != 1 ; src++, dst++) {
+ for (src=string, dst=buf; term != 1 ; src++) {
if ( *src != ',' && *src != '\0' ) {
if ( ( *src >= 65 && *src <= 90 ) || ( *src >= 97 && *src <= 122) ) {
@@ -220,7 +220,7 @@
string, src - string + 1);
}
-
+ dst++;
} else {
*dst = '\0';
if ( idup == 1 ) {
2005-03-18 16:45:13 +00:00
--- iptables-1.3.0/extensions/libipt_rpc.c.cleanup 2005-03-18 16:25:34.174370567 +0100
+++ iptables-1.3.0/extensions/libipt_rpc.c 2005-03-18 16:25:32.000000000 +0100
@@ -252,7 +252,7 @@
idup = 0;
memset(buf, 0, sizeof(buf));
- dst = (char *)buf - 1;
+ dst = (char *)buf;
}
}
--- iptables-1.3.0/extensions/libipt_REJECT.c.cleanup 2005-03-18 16:29:21.611549462 +0100
+++ iptables-1.3.0/extensions/libipt_REJECT.c 2005-03-18 16:31:26.951045260 +0100
@@ -147,13 +147,16 @@
{
const struct ipt_reject_info *reject
= (const struct ipt_reject_info *)target->data;
- unsigned int i;
+ unsigned int i, limit=sizeof(reject_table)/sizeof(struct reject_names);
- for (i = 0; i < sizeof(reject_table)/sizeof(struct reject_names); i++) {
+ for (i = 0; i < limit; i++) {
if (reject_table[i].with == reject->with)
break;
}
- printf("reject-with %s ", reject_table[i].name);
+ if (i < limit)
+ printf("reject-with %s ", reject_table[i].name);
+ else
+ fprintf(stderr, "reject-with: error reject->with not found ");
}
/* Saves ipt_reject in parsable form to stdout. */
@@ -161,13 +164,16 @@
{
const struct ipt_reject_info *reject
= (const struct ipt_reject_info *)target->data;
- unsigned int i;
+ unsigned int i, limit=sizeof(reject_table)/sizeof(struct reject_names);
- for (i = 0; i < sizeof(reject_table)/sizeof(struct reject_names); i++)
+ for (i = 0; i < limit; i++) {
if (reject_table[i].with == reject->with)
break;
-
- printf("--reject-with %s ", reject_table[i].name);
+ }
+ if (i < limit)
+ printf("--reject-with %s ", reject_table[i].name);
+ else
+ fprintf(stderr, "--reject-with error reject->with not found");
}
static struct iptables_target reject = {