diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2010-03-23 12:40:13 -0400 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2010-03-25 11:03:12 -0400 |
commit | 9f5673174161cc026a6c87f70d9b457e7ad82a80 (patch) | |
tree | c0f763f86b93a476837193c4621f431960745ff1 /net/netfilter/xt_sctp.c | |
parent | 7911b5c75b613f533b6cb6f999041dd5ea3bb004 (diff) |
netfilter: xtables: untangle spaghetti if clauses in checkentry
As I'm changing the return values soon, I want to have a clear visual
path.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'net/netfilter/xt_sctp.c')
-rw-r--r-- | net/netfilter/xt_sctp.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/net/netfilter/xt_sctp.c b/net/netfilter/xt_sctp.c index 43c7e1de532..977b182dea5 100644 --- a/net/netfilter/xt_sctp.c +++ b/net/netfilter/xt_sctp.c | |||
@@ -148,14 +148,18 @@ static bool sctp_mt_check(const struct xt_mtchk_param *par) | |||
148 | { | 148 | { |
149 | const struct xt_sctp_info *info = par->matchinfo; | 149 | const struct xt_sctp_info *info = par->matchinfo; |
150 | 150 | ||
151 | return !(info->flags & ~XT_SCTP_VALID_FLAGS) | 151 | if (info->flags & ~XT_SCTP_VALID_FLAGS) |
152 | && !(info->invflags & ~XT_SCTP_VALID_FLAGS) | 152 | return false; |
153 | && !(info->invflags & ~info->flags) | 153 | if (info->invflags & ~XT_SCTP_VALID_FLAGS) |
154 | && ((!(info->flags & XT_SCTP_CHUNK_TYPES)) || | 154 | return false; |
155 | (info->chunk_match_type & | 155 | if (info->invflags & ~info->flags) |
156 | (SCTP_CHUNK_MATCH_ALL | 156 | return false; |
157 | | SCTP_CHUNK_MATCH_ANY | 157 | if (!(info->flags & XT_SCTP_CHUNK_TYPES)) |
158 | | SCTP_CHUNK_MATCH_ONLY))); | 158 | return true; |
159 | if (info->chunk_match_type & (SCTP_CHUNK_MATCH_ALL | | ||
160 | SCTP_CHUNK_MATCH_ANY | SCTP_CHUNK_MATCH_ONLY)) | ||
161 | return true; | ||
162 | return false; | ||
159 | } | 163 | } |
160 | 164 | ||
161 | static struct xt_match sctp_mt_reg[] __read_mostly = { | 165 | static struct xt_match sctp_mt_reg[] __read_mostly = { |