Skip to content

Commit

Permalink
[NETFILTER] nfnetlink: skip size check if size not specified (== 0)
Browse files Browse the repository at this point in the history
Skip sizecheck if the size of the attribute wasn't specified, ie. zero.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pablo Neira Ayuso authored and David S. Miller committed Nov 14, 2005
1 parent dbd36ea commit c0400c4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/linux/netfilter/nfnetlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,14 @@ extern void nfattr_parse(struct nfattr *tb[], int maxattr,

#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; \
})

Expand Down

0 comments on commit c0400c4

Please sign in to comment.