From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Gao feng <gaofeng@cn.fujitsu.com>
Cc: netfilter-devel@vger.kernel.org, netdev@vger.kernel.org,
ebiederm@xmission.com, serge.hallyn@canonical.com,
dlezcano@fr.ibm.com
Subject: Re: [PATCH 01/12] netfilter: add struct netns_ct_proto to support netfilter namespace
Date: Tue, 17 Apr 2012 10:54:21 +0200 [thread overview]
Message-ID: <20120417085421.GB2100@1984> (raw)
In-Reply-To: <1334631383-12326-2-git-send-email-gaofeng@cn.fujitsu.com>
On Tue, Apr 17, 2012 at 10:56:12AM +0800, Gao feng wrote:
> the struct netns_ct_proto is used to store ctl_table_header and sysctl vars.
> because udp_conntrack and udplite_conntrack are used by netns_ct_proto,
> so move the udp_conntrack and udplite_conntrack to the header file,
>
> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
> ---
> include/linux/netfilter/nf_conntrack_udp.h | 10 ++++++
> include/linux/netfilter/nf_conntrack_udplite.h | 10 ++++++
> include/net/netns/conntrack.h | 37 ++++++++++++++++++++++++
> 3 files changed, 57 insertions(+), 0 deletions(-)
> create mode 100644 include/linux/netfilter/nf_conntrack_udp.h
> create mode 100644 include/linux/netfilter/nf_conntrack_udplite.h
>
> diff --git a/include/linux/netfilter/nf_conntrack_udp.h b/include/linux/netfilter/nf_conntrack_udp.h
> new file mode 100644
> index 0000000..02869fc
> --- /dev/null
> +++ b/include/linux/netfilter/nf_conntrack_udp.h
> @@ -0,0 +1,10 @@
> +#ifndef _NF_CONNTRACK_UDP_H
> +#define _NF_CONNTRACK_UDP_H
> +
> +enum udp_conntrack {
> + UDP_CT_UNREPLIED,
> + UDP_CT_REPLIED,
> + UDP_CT_MAX
> +};
This will be exported to user-space. We don't need this.
> +
> +#endif /* _NF_CONNTRACK_UDP_H */
> diff --git a/include/linux/netfilter/nf_conntrack_udplite.h b/include/linux/netfilter/nf_conntrack_udplite.h
> new file mode 100644
> index 0000000..62b90a2
> --- /dev/null
> +++ b/include/linux/netfilter/nf_conntrack_udplite.h
> @@ -0,0 +1,10 @@
> +#ifndef _NF_CONNTRACK_UDPLITE_H
> +#define _NF_CONNTRACK_UDPLITE_H
> +
> +enum udplite_conntrack {
> + UDPLITE_CT_UNREPLIED,
> + UDPLITE_CT_REPLIED,
> + UDPLITE_CT_MAX
> +};
> +
> +#endif /* _NF_CONNTRACK_UDPLITE_H */
> diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h
> index 7a911ec..5845665 100644
> --- a/include/net/netns/conntrack.h
> +++ b/include/net/netns/conntrack.h
> @@ -4,10 +4,46 @@
> #include <linux/list.h>
> #include <linux/list_nulls.h>
> #include <linux/atomic.h>
> +#include <linux/netfilter/nf_conntrack_tcp.h>
> +#include <linux/netfilter/nf_conntrack_udp.h>
> +#include <linux/netfilter/nf_conntrack_udplite.h>
> +#include <linux/netfilter/nf_conntrack_sctp.h>
>
> struct ctl_table_header;
> struct nf_conntrack_ecache;
>
> +struct netns_ct_proto {
> + unsigned int sysctl_generic_timeout;
> + unsigned int sysctl_tcp_timeouts[TCP_CONNTRACK_TIMEOUT_MAX];
> + unsigned int sysctl_tcp_loose;
> + unsigned int sysctl_tcp_be_liberal;
> + unsigned int sysctl_tcp_max_retrans;
> + unsigned int sysctl_udp_timeouts[UDP_CT_MAX];
> + unsigned int sysctl_udplite_timeouts[UDPLITE_CT_MAX];
> + unsigned int sysctl_sctp_timeouts[SCTP_CONNTRACK_MAX];
> + unsigned int sysctl_icmp_timeout;
> + unsigned int sysctl_icmpv6_timeout;
> +#ifdef CONFIG_SYSCTL
> + struct ctl_table_header *generic_sysctl_header;
> + struct ctl_table_header *tcp_sysctl_header;
> + struct ctl_table_header *udp_sysctl_header;
> + struct ctl_table_header *udplite_sysctl_header;
> + struct ctl_table_header *sctp_sysctl_header;
> + struct ctl_table_header *icmp_sysctl_header;
> + struct ctl_table_header *icmpv6_sysctl_header;
> + unsigned int tcp_table_users;
> + unsigned int udp_table_users;
> +#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
> + struct ctl_table_header *generic_compat_header;
> + struct ctl_table_header *tcp_compat_header;
> + struct ctl_table_header *udp_compat_header;
> + struct ctl_table_header *sctp_compat_header;
> + struct ctl_table_header *icmp_compat_header;
> + struct ctl_table_header *ipv4_compat_header;
> +#endif
> +#endif
> +};
No.
You cannot just send a patch that adds a structure like this and use
it in follow-up patches.
You have to make patches that leave the repository in consistent state.
Instead, you have to populate the structure little by little in your
patches.
> +
> struct netns_ct {
> atomic_t count;
> unsigned int expect_count;
> @@ -26,6 +62,7 @@ struct netns_ct {
> int sysctl_tstamp;
> int sysctl_checksum;
> unsigned int sysctl_log_invalid; /* Log invalid packets */
> + struct netns_ct_proto proto;
> #ifdef CONFIG_SYSCTL
> struct ctl_table_header *sysctl_header;
> struct ctl_table_header *acct_sysctl_header;
> --
> 1.7.7.6
>
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-04-17 8:54 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-17 2:56 [PATCH 00/12] add namespace support for netfilter protos Gao feng
2012-04-17 2:56 ` [PATCH 01/12] netfilter: add struct netns_ct_proto to support netfilter namespace Gao feng
2012-04-17 8:54 ` Pablo Neira Ayuso [this message]
2012-04-17 2:56 ` [PATCH 02/12] netfilter: don't register sysctl when register proto Gao feng
2012-04-17 8:56 ` Pablo Neira Ayuso
2012-04-17 10:25 ` Gao feng
2012-04-17 11:26 ` Pablo Neira Ayuso
2012-04-17 2:56 ` [PATCH 03/12] netfilter: generic proto sysctl support for net namespace Gao feng
2012-04-17 8:58 ` Pablo Neira Ayuso
2012-04-17 10:22 ` Gao feng
2012-04-17 11:35 ` Pablo Neira Ayuso
2012-04-18 0:20 ` Gao feng
2012-04-17 2:56 ` [PATCH 04/12] netfilter: tcp " Gao feng
2012-04-17 2:56 ` [PATCH 05/12] netfilter: udp " Gao feng
2012-04-17 2:56 ` [PATCH 06/12] netfilter: icmp " Gao feng
2012-04-17 2:56 ` [PATCH 07/12] netfilter: icmpv6 proto sysctl support for net Gao feng
2012-04-17 2:56 ` [PATCH 08/12] netfilter: ipv4 sysctl support for net namespace Gao feng
2012-04-17 2:56 ` [PATCH 09/12] netfilter: ipv6 " Gao feng
2012-04-17 2:56 ` [PATCH 10/12] netfilter: sctp proto " Gao feng
2012-04-17 10:30 ` Gao feng
2012-04-17 11:29 ` Pablo Neira Ayuso
2012-04-17 2:56 ` [PATCH 11/12] netfilter: udplite proto sysctl support for net Gao feng
2012-04-17 2:56 ` [PATCH 12/12] netfilter: export necessary function for generic proto Gao feng
2012-04-17 9:01 ` Pablo Neira Ayuso
2012-04-17 8:52 ` [PATCH 00/12] add namespace support for netfilter protos Pablo Neira Ayuso
2012-04-17 10:12 ` Gao feng
2012-04-17 10:34 ` Jan Engelhardt
2012-04-17 10:59 ` Pablo Neira Ayuso
2012-04-17 14:35 ` Serge Hallyn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120417085421.GB2100@1984 \
--to=pablo@netfilter.org \
--cc=dlezcano@fr.ibm.com \
--cc=ebiederm@xmission.com \
--cc=gaofeng@cn.fujitsu.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=serge.hallyn@canonical.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).