diff options
-rw-r--r-- | include/libnetfilter_conntrack/libnetfilter_conntrack.h | 3 | ||||
-rw-r--r-- | src/conntrack/api.c | 3 | ||||
-rw-r--r-- | utils/new_api_test.c | 8 |
3 files changed, 6 insertions, 8 deletions
diff --git a/include/libnetfilter_conntrack/libnetfilter_conntrack.h b/include/libnetfilter_conntrack/libnetfilter_conntrack.h index 9e7dd37..eaad584 100644 --- a/include/libnetfilter_conntrack/libnetfilter_conntrack.h +++ b/include/libnetfilter_conntrack/libnetfilter_conntrack.h @@ -494,7 +494,8 @@ extern int nfct_attr_unset(struct nf_conntrack *ct, /* output type */ enum { - NFCT_O_DEFAULT, + NFCT_O_PLAIN, + NFCT_O_DEFAULT = NFCT_O_PLAIN, NFCT_O_XML, NFCT_O_MAX }; diff --git a/src/conntrack/api.c b/src/conntrack/api.c index 1646839..a3cc061 100644 --- a/src/conntrack/api.c +++ b/src/conntrack/api.c @@ -28,9 +28,6 @@ struct nf_conntrack *nfct_new() memset(ct, 0, sizeof(struct nf_conntrack)); - /* always work with confirmed conntracks */ -// ct->status |= IPS_CONFIRMED; - return ct; } diff --git a/utils/new_api_test.c b/utils/new_api_test.c index 2bc26b1..aad2f52 100644 --- a/utils/new_api_test.c +++ b/utils/new_api_test.c @@ -54,16 +54,16 @@ int main() nfct_set_attr_u32(ct, ATTR_ORIG_IPV4_DST, inet_addr("2.2.2.2")); nfct_set_attr_u8(ct, ATTR_ORIG_L4PROTO, IPPROTO_TCP); - nfct_set_attr_u16(ct, ATTR_ORIG_PORT_SRC, ntohs(20)); - nfct_set_attr_u16(ct, ATTR_ORIG_PORT_DST, ntohs(10)); + nfct_set_attr_u16(ct, ATTR_ORIG_PORT_SRC, htons(20)); + nfct_set_attr_u16(ct, ATTR_ORIG_PORT_DST, htons(10)); nfct_set_attr_u8(ct, ATTR_REPL_L3PROTO, AF_INET); nfct_set_attr_u32(ct, ATTR_REPL_IPV4_SRC, inet_addr("2.2.2.2")); nfct_set_attr_u32(ct, ATTR_REPL_IPV4_DST, inet_addr("1.1.1.1")); nfct_set_attr_u8(ct, ATTR_REPL_L4PROTO, IPPROTO_TCP); - nfct_set_attr_u16(ct, ATTR_REPL_PORT_SRC, ntohs(10)); - nfct_set_attr_u16(ct, ATTR_REPL_PORT_DST, ntohs(20)); + nfct_set_attr_u16(ct, ATTR_REPL_PORT_SRC, htons(10)); + nfct_set_attr_u16(ct, ATTR_REPL_PORT_DST, htons(20)); nfct_set_attr_u8(ct, ATTR_TCP_STATE, TCP_CONNTRACK_LISTEN); nfct_set_attr_u32(ct, ATTR_TIMEOUT, 100); |