From 3dedd39ac8c3f4c9b3503e6a9b602fdf0341c7ed Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 16 May 2008 15:50:08 +0200 Subject: fix __nfct_l4 structure layout (specifically, ICMP) fix nfct_cmp(): add port comparison, better ICMP support --- include/internal.h | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/internal.h b/include/internal.h index ae1bd9d..039c64c 100644 --- a/include/internal.h +++ b/include/internal.h @@ -62,7 +62,7 @@ struct nfct_handle { void *data); }; -union __nfct_l4 { +union __nfct_l4_src { /* Add other protocols here. */ u_int16_t all; struct { @@ -72,7 +72,6 @@ union __nfct_l4 { u_int16_t port; } udp; struct { - u_int8_t type, code; u_int16_t id; } icmp; struct { @@ -80,6 +79,23 @@ union __nfct_l4 { } sctp; }; +union __nfct_l4_dst { + /* Add other protocols here. */ + u_int16_t all; + struct { + u_int16_t port; + } tcp; + struct { + u_int16_t port; + } udp; + struct { + u_int8_t type, code; + } icmp; + struct { + u_int16_t port; + } sctp; +}; + union __nfct_address { u_int32_t v4; struct in6_addr v6; @@ -91,8 +107,8 @@ struct __nfct_tuple { u_int8_t l3protonum; u_int8_t protonum; - union __nfct_l4 l4src; - union __nfct_l4 l4dst; + union __nfct_l4_src l4src; + union __nfct_l4_dst l4dst; struct { u_int32_t correction_pos; @@ -123,7 +139,7 @@ struct __nfct_counters { struct __nfct_nat { u_int32_t min_ip, max_ip; - union __nfct_l4 l4min, l4max; + union __nfct_l4_src l4min, l4max; }; struct nf_conntrack { -- cgit v1.2.3