Skip to contentSkip to conversation

skip sizechecking when not specified

PATCH Applied Pablo Neira 2 participants 2 messages Nov 10, 2005 – Nov 12, 2005 netfilter

lore
Share & tools
lore

Pablo Neira

author maintainer
#0 lore raw

PATCH 3/4 skip sizechecking when not specified

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

Signature · 2 lines
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

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

include/linux/netfilter/nfnetlink.h +4 -1
Index: netfilter-2.6.14.git/include/linux/netfilter/nfnetlink.h
===================================================================
@@ -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;								\
 })
 
Applied
#1 lore raw
Quoted 2 lines · Pablo Neira

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

thanks, applied.

Signature · 5 lines
- Harald Welte <[email protected]>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie