summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2008-04-13 21:59:46 +0000
committer/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2008-04-13 21:59:46 +0000
commitebb9a1aa3813d71b99d7508c88b9cbf525e15b4a (patch)
tree9df4a1f35b09de313094bf3d61bd1feab2109211 /src
parent3ce7643c221878785ed0390cdc65e69054887f08 (diff)
fix conntrack -U -p tcp [...]
Diffstat (limited to 'src')
-rw-r--r--src/conntrack.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/conntrack.c b/src/conntrack.c
index f4dfec7..2dfb601 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -737,9 +737,9 @@ static int update_cb(enum nf_conntrack_msg_type type,
if (ignore_nat(tmp, ct))
return NFCT_CB_CONTINUE;
- if (options & CT_OPT_ORIG && !nfct_cmp(tmp, ct, NFCT_CMP_ORIG))
+ if (options & CT_OPT_TUPLE_ORIG && !nfct_cmp(tmp, ct, NFCT_CMP_ORIG))
return NFCT_CB_CONTINUE;
- if (options & CT_OPT_REPL && !nfct_cmp(tmp, ct, NFCT_CMP_REPL))
+ if (options & CT_OPT_TUPLE_REPL && !nfct_cmp(tmp, ct, NFCT_CMP_REPL))
return NFCT_CB_CONTINUE;
nfct_copy(tmp, ct, NFCT_CP_ORIG);
@@ -935,14 +935,6 @@ int main(int argc, char *argv[])
"`%s' unsupported protocol",
optarg);
- nfct_set_attr_u8(obj, ATTR_ORIG_L4PROTO, h->protonum);
- nfct_set_attr_u8(obj, ATTR_REPL_L4PROTO, h->protonum);
- nfct_set_attr_u8(exptuple,
- ATTR_ORIG_L4PROTO,
- h->protonum);
- nfct_set_attr_u8(mask,
- ATTR_ORIG_L4PROTO,
- h->protonum);
opts = merge_options(opts, h->opts, &h->option_offset);
if (opts == NULL)
exit_error(OTHER_PROBLEM, "out of memory");
@@ -1052,6 +1044,11 @@ int main(int argc, char *argv[])
if (family == AF_UNSPEC)
family = AF_INET;
+ /* set the protocol number if we have seen -p with no parameters */
+ if (h && !nfct_attr_is_set(obj, ATTR_ORIG_L4PROTO) &&
+ !nfct_attr_is_set(obj, ATTR_REPL_L4PROTO))
+ nfct_set_attr_u8(obj, ATTR_L4PROTO, h->protonum);
+
cmd = bit2cmd(command);
generic_cmd_check(cmd, options);
generic_opt_check(options,