List Info

Thread: : nf_conntrack_h323: check range first in sequence extension




: nf_conntrack_h323: check range first in sequence extension
country flaguser name
Switzerland
2007-07-07 07:23:01
[NETFILTER]: nf_conntrack_h323: check range first in
sequence extension

Check range before checking STOP flag. This optimization may
save a
nanosecond or less 

Signed-off-by: Jing Min Zhao <zhaojingminvivecode.com>
Signed-off-by: Patrick McHardy <kabertrash.net>

---
commit f32236698107064a21157edb09cf06645f63409f
tree a2e0ecdb5fdee79963b3dca60e37f447416056d3
parent 0e430d6461fe5661dd2214dbb9aaf6d7fcceaeb9
author Jing Min Zhao <zhaojingminvivecode.com> Sat, 07
Jul 2007 12:15:02 +0200
committer Patrick McHardy <kabertrash.net> Sat, 07 Jul
2007 12:15:02 +0200

 net/netfilter/nf_conntrack_h323_asn1.c |   18
+++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/net/netfilter/nf_conntrack_h323_asn1.c
b/net/netfilter/nf_conntrack_h323_asn1.c
index 6b7eaa0..a869403 100644
--- a/net/netfilter/nf_conntrack_h323_asn1.c
+++ b/net/netfilter/nf_conntrack_h323_asn1.c
 -555,15
+555,6  int decode_seq(bitstr_t * bs, field_t * f, char
*base, int level)
 
 	/* Decode the extension components */
 	for (opt = 0; opt < bmp2_len; opt++, i++, son++) {
-		if (i < f->ub && son->attr & STOP)
{
-			PRINT("%*.s%sn", (level + 1) * TAB_SIZE,
" ",
-			      son->name);
-			return H323_ERROR_STOP;
-		}
-
-		if (!((0x80000000 >> opt) & bmp2))	/* Not
present */
-			continue;
-
 		/* Check Range */
 		if (i >= f->ub) {	/* Newer Version? */
 			CHECK_BOUND(bs, 2);
 -573,6
+564,15  int decode_seq(bitstr_t * bs, field_t * f, char
*base, int level)
 			continue;
 		}
 
+		if (son->attr & STOP) {
+			PRINT("%*.s%sn", (level + 1) * TAB_SIZE,
" ",
+			      son->name);
+			return H323_ERROR_STOP;
+		}
+
+		if (!((0x80000000 >> opt) & bmp2))	/* Not
present */
+			continue;
+
 		CHECK_BOUND(bs, 2);
 		len = get_len(bs);
 		CHECK_BOUND(bs, len);


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )