summaryrefslogtreecommitdiff
path: root/extensions/libct_proto_sctp.c
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/libct_proto_sctp.c')
-rw-r--r--extensions/libct_proto_sctp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/extensions/libct_proto_sctp.c b/extensions/libct_proto_sctp.c
index 2b1a337..5e96391 100644
--- a/extensions/libct_proto_sctp.c
+++ b/extensions/libct_proto_sctp.c
@@ -108,6 +108,7 @@ int parse_options(char c, char *argv[],
printf("doh?\n");
return 0;
}
+ *flags |= STATE;
}
break;
}
@@ -118,19 +119,24 @@ int final_check(unsigned int flags,
struct nfct_tuple *orig,
struct nfct_tuple *reply)
{
+ int ret = 0;
+
if ((flags & (ORIG_SPORT|ORIG_DPORT))
&& !(flags & (REPL_SPORT|REPL_DPORT))) {
reply->l4src.sctp.port = orig->l4dst.sctp.port;
reply->l4dst.sctp.port = orig->l4src.sctp.port;
- return 1;
+ ret = 1;
} else if (!(flags & (ORIG_SPORT|ORIG_DPORT))
&& (flags & (REPL_SPORT|REPL_DPORT))) {
orig->l4src.sctp.port = reply->l4dst.sctp.port;
orig->l4dst.sctp.port = reply->l4src.sctp.port;
- return 1;
+ ret = 1;
}
if ((flags & (ORIG_SPORT|ORIG_DPORT))
&& ((flags & (REPL_SPORT|REPL_DPORT))))
+ ret = 1;
+
+ if (ret & (flags & STATE))
return 1;
return 0;