[NETFILTER] nfnetlink: skip size check if size not specified (== 0)

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

Signed-off-by: Pablo Neira Ayuso <[EMAIL PROTECTED]>
Signed-off-by: Harald Welte <[EMAIL PROTECTED]>

---
commit 2c6f159b30802fc23360dc80810cc47128c54a95
tree d420b242bfa2c0806b1daeee088251452c7823cf
parent 2e09968d59b232b96bc95c091e70ccfabf07ea30
author Pablo Neira Ayuso <[EMAIL PROTECTED]> Sat, 12 Nov 2005 12:05:02 +0100
committer Harald Welte <[EMAIL PROTECTED]> Sat, 12 Nov 2005 12:05:02 +0100

 include/linux/netfilter/nfnetlink.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/include/linux/netfilter/nfnetlink.h 
b/include/linux/netfilter/nfnetlink.h
--- a/include/linux/netfilter/nfnetlink.h
+++ b/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;                                                          \
 })
 

--
- 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
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to