diff options
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> | 2007-05-20 21:13:06 +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> | 2007-05-20 21:13:06 +0000 |
commit | 9f1b4b2d028129966f7e6f23cec6ac0712c2b1b6 (patch) | |
tree | d635d4e4ad7dac6918470676bf222f27d21f192e /extensions | |
parent | 2932c6b8e6952ae84b221b854b43810c61e5c8fa (diff) | |
download | conntrack-tools-9f1b4b2d028129966f7e6f23cec6ac0712c2b1b6.tar.gz conntrack-tools-9f1b4b2d028129966f7e6f23cec6ac0712c2b1b6.zip |
- introduce cache_iterate
- empty debug_ct function if DEBUG_CT is not set
- revisit overrun handler: this is a hard battle, just try to do our best here, call Patrick :)
- explicit warning message when netlink_buffer_max_growth is reached
- fix silly bug in stats-mode when dumping in XML format
- fix UDP handler for conntrack
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/libct_proto_udp.c | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/extensions/libct_proto_udp.c b/extensions/libct_proto_udp.c index 6e8d13c..bae9bf8 100644 --- a/extensions/libct_proto_udp.c +++ b/extensions/libct_proto_udp.c @@ -43,12 +43,10 @@ static void help() static int parse_options(char c, char *argv[], struct nf_conntrack *ct, - struct nfct_tuple *exptuple, - struct nfct_tuple *mask, + struct nf_conntrack *exptuple, + struct nf_conntrack *mask, unsigned int *flags) { - int i; - switch(c) { case '1': if (!optarg) @@ -91,28 +89,44 @@ static int parse_options(char c, char *argv[], *flags |= UDP_REPL_DPORT; break; case '5': - if (optarg) { - mask->l4src.udp.port = htons(atoi(optarg)); - *flags |= UDP_MASK_SPORT; - } + if (!optarg) + break; + + nfct_set_attr_u16(mask, + ATTR_ORIG_PORT_SRC, + htons(atoi(optarg))); + + *flags |= UDP_MASK_SPORT; break; case '6': - if (optarg) { - mask->l4dst.udp.port = htons(atoi(optarg)); - *flags |= UDP_MASK_DPORT; - } + if (!optarg) + break; + + nfct_set_attr_u16(mask, + ATTR_ORIG_PORT_DST, + htons(atoi(optarg))); + + *flags |= UDP_MASK_DPORT; break; case '7': - if (optarg) { - exptuple->l4src.udp.port = htons(atoi(optarg)); - *flags |= UDP_EXPTUPLE_SPORT; - } + if (!optarg) + break; + + nfct_set_attr_u16(exptuple, + ATTR_ORIG_PORT_SRC, + htons(atoi(optarg))); + + *flags |= UDP_EXPTUPLE_SPORT; break; case '8': - if (optarg) { - exptuple->l4dst.udp.port = htons(atoi(optarg)); - *flags |= UDP_EXPTUPLE_DPORT; - } + if (!optarg) + break; + + nfct_set_attr_u16(exptuple, + ATTR_ORIG_PORT_DST, + htons(atoi(optarg))); + + *flags |= UDP_EXPTUPLE_DPORT; break; } return 1; |