diff options
author | /C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org> | 2005-11-03 19:57:50 +0000 |
---|---|---|
committer | /C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org> | 2005-11-03 19:57:50 +0000 |
commit | ba2a63e1b8e18e0d1f383af50d3d40c2eb785d3e (patch) | |
tree | d7c5823824c6922fd7ecca32b489062722421e48 /extensions | |
parent | 1c54be2dc910783f897034dbe16fe83b6901c2f2 (diff) | |
download | conntrack-tools-ba2a63e1b8e18e0d1f383af50d3d40c2eb785d3e.tar.gz conntrack-tools-ba2a63e1b8e18e0d1f383af50d3d40c2eb785d3e.zip |
See ChangeLog
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/libct_proto_sctp.c | 10 | ||||
-rw-r--r-- | extensions/libct_proto_tcp.c | 10 |
2 files changed, 16 insertions, 4 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; diff --git a/extensions/libct_proto_tcp.c b/extensions/libct_proto_tcp.c index 4aa6587..7c1e605 100644 --- a/extensions/libct_proto_tcp.c +++ b/extensions/libct_proto_tcp.c @@ -131,6 +131,7 @@ int parse_options(char c, char *argv[], printf("doh?\n"); return 0; } + *flags |= STATE; } break; } @@ -141,19 +142,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.tcp.port = orig->l4dst.tcp.port; reply->l4dst.tcp.port = orig->l4src.tcp.port; - return 1; + ret = 1; } else if (!(flags & (ORIG_SPORT|ORIG_DPORT)) && (flags & (REPL_SPORT|REPL_DPORT))) { orig->l4src.tcp.port = reply->l4dst.tcp.port; orig->l4dst.tcp.port = reply->l4src.tcp.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; |