summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'extensions')
-rw-r--r--extensions/libct_proto_tcp.c14
-rw-r--r--extensions/libct_proto_udp.c14
2 files changed, 10 insertions, 18 deletions
diff --git a/extensions/libct_proto_tcp.c b/extensions/libct_proto_tcp.c
index a2243dc..4cddf53 100644
--- a/extensions/libct_proto_tcp.c
+++ b/extensions/libct_proto_tcp.c
@@ -115,16 +115,12 @@ int parse(char c, char *argv[],
int final_check(unsigned int flags)
{
- if (!(flags & ORIG_SPORT))
- return 0;
- else if (!(flags & ORIG_DPORT))
- return 0;
- else if (!(flags & REPL_SPORT))
- return 0;
- else if (!(flags & REPL_DPORT))
- return 0;
+ if ((flags & ORIG_SPORT) && (flags & ORIG_DPORT))
+ return 1;
+ else if ((flags & REPL_SPORT) && (flags & REPL_DPORT))
+ return 1;
- return 1;
+ return 0;
}
void print_tuple(struct ip_conntrack_tuple *t)
diff --git a/extensions/libct_proto_udp.c b/extensions/libct_proto_udp.c
index 8e20bd5..0088cc5 100644
--- a/extensions/libct_proto_udp.c
+++ b/extensions/libct_proto_udp.c
@@ -82,16 +82,12 @@ int parse(char c, char *argv[],
int final_check(unsigned int flags)
{
- if (!(flags & ORIG_SPORT))
- return 0;
- else if (!(flags & ORIG_DPORT))
- return 0;
- else if (!(flags & REPL_SPORT))
- return 0;
- else if (!(flags & REPL_DPORT))
- return 0;
+ if ((flags & ORIG_SPORT) && (flags & ORIG_DPORT))
+ return 1;
+ else if ((flags & REPL_SPORT) && (flags & REPL_DPORT))
+ return 1;
- return 1;
+ return 0;
}
void print_tuple(struct ip_conntrack_tuple *t)