diff options
| author | Pablo Neira Ayuso <pablo@netfilter.org> | 2005-11-14 18:21:41 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2005-11-14 18:21:41 -0500 |
| commit | c0400c4f5a08cfd1c657f7f616fcf1dfbd76a4d7 (patch) | |
| tree | 61a90f49481595e707e0968f889483a4f0ff454f /include/linux | |
| parent | dbd36ea496726460299842fdbeaaa7fff2f0c5c7 (diff) | |
[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 <pablo@netfilter.org>
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | 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 index 72975fa8795d..8be2f840a557 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
| @@ -154,11 +154,14 @@ extern void nfattr_parse(struct nfattr *tb[], int maxattr, | |||
| 154 | 154 | ||
| 155 | #define nfattr_bad_size(tb, max, cta_min) \ | 155 | #define nfattr_bad_size(tb, max, cta_min) \ |
| 156 | ({ int __i, __res = 0; \ | 156 | ({ int __i, __res = 0; \ |
| 157 | for (__i=0; __i<max; __i++) \ | 157 | for (__i=0; __i<max; __i++) { \ |
| 158 | if (!cta_min[__i]) \ | ||
| 159 | continue; \ | ||
| 158 | if (tb[__i] && NFA_PAYLOAD(tb[__i]) < cta_min[__i]){ \ | 160 | if (tb[__i] && NFA_PAYLOAD(tb[__i]) < cta_min[__i]){ \ |
| 159 | __res = 1; \ | 161 | __res = 1; \ |
| 160 | break; \ | 162 | break; \ |
| 161 | } \ | 163 | } \ |
| 164 | } \ | ||
| 162 | __res; \ | 165 | __res; \ |
| 163 | }) | 166 | }) |
| 164 | 167 | ||
