cleanup
PATCH 1/1 cleanup
Hello,
I got this patch for iptables in bugzilla #131848 from Steve Grubb. Are including it in the next version?
Thanks in advance,
Thomas
Signature · 5 lines
Thomas Woerner Software Engineer Phone: +49-711-96437-310 Red Hat GmbH Fax : +49-711-96437-111 Hauptstaetterstr. 58 Email: Thomas Woerner <[email protected]> D-70178 Stuttgart Web : http://www.redhat.de/
extensions/libipt_REJECT.c +12 -7
@@ -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 +printf ("reject-with: error reject->with not found " ); }/* Saves ipt_reject in parsable form to stdout. */
@@ -161,13 +164,15 @@ {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
extensions/libipt_rpc.c +1 -1
@@ -252,7 +252,7 @@ idup =0 ;memset (buf,0 ,sizeof (buf)); - dst = (char *)buf -1 ; + dst = (char *)buf; } }
Quoted 5 lines · Thomas Woerner
Hello,
I got this patch for iptables in bugzilla #131848 from Steve Grubb. Are including it in the next version?
This doesn't look like cleanup and I'm not going to dig up bugreports from redhat bugzilla. What is this patch supposed to fix ?
Regards
Patrick
Quoted 63 lines
Thanks in advance,
Thomas------------------------------------------------------------------------
diff -ur
iptables-1.2.11.orig/extensions/libipt_REJECT.ciptables-1.2.11/extensions/libipt_REJECT.cextensions/libipt_REJECT.c +12
-7@@ -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 +printf ("reject-with: error reject->with not found " ); }/* Saves ipt_reject in parsable form to stdout. */ @@ -161,13 +164,15 @@ {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" ); } staticdiff -ur
iptables-1.2.11.orig/extensions/libipt_rpc.ciptables-1.2.11/extensions/libipt_rpc.cextensions/libipt_rpc.c +1
-1@@ -252,7 +252,7 @@ idup =0 ;memset (buf,0 ,sizeof (buf)); - dst = (char *)buf -1 ; + dst = (char *)buf; } }