All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/4] skip sizechecking when not specified
@ 2005-11-10  1:04 Pablo Neira
  2005-11-12 11:05 ` Harald Welte
  0 siblings, 1 reply; 2+ messages in thread
From: Pablo Neira @ 2005-11-10  1:04 UTC (permalink / raw)
  To: Netfilter Development Mailinglist; +Cc: Harald Welte

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

This patch applies to nfnetlink. Skip sizecheck if the size of the
attribute wasn't specified, ie. zero.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

-- 
The dawn of the fourth age of Linux firewalling is coming; a time of
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris

[-- Attachment #2: 06-check-bad-size.patch --]
[-- Type: text/plain, Size: 884 bytes --]

Skip sizecheck if the size of the attribute wasn't specified, ie. zero.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

Index: netfilter-2.6.14.git/include/linux/netfilter/nfnetlink.h
===================================================================
--- netfilter-2.6.14.git.orig/include/linux/netfilter/nfnetlink.h	2005-11-06 19:31:06.000000000 +0100
+++ netfilter-2.6.14.git/include/linux/netfilter/nfnetlink.h	2005-11-06 19:31:28.000000000 +0100
@@ -154,11 +154,14 @@ extern void nfattr_parse(struct nfattr *
 
 #define nfattr_bad_size(tb, max, cta_min)				\
 ({	int __i, __res = 0;						\
- 	for (__i=0; __i<max; __i++) 					\
+ 	for (__i=0; __i<max; __i++) {					\
+ 		if (!cta_min[__i])					\
+ 			continue;					\
  		if (tb[__i] && NFA_PAYLOAD(tb[__i]) < cta_min[__i]){	\
  			__res = 1;					\
  			break;						\
  		}							\
+ 	}								\
  	__res;								\
 })
 

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

end of thread, other threads:[~2005-11-12 11:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-10  1:04 [PATCH 3/4] skip sizechecking when not specified Pablo Neira
2005-11-12 11:05 ` 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.