{"id":809458,"url":"http://patchwork.ozlabs.org/api/1.2/patches/809458/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/1504478574-13281-2-git-send-email-pablo@netfilter.org/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/1.2/projects/7/?format=json","name":"Linux network development","link_name":"netdev","list_id":"netdev.vger.kernel.org","list_email":"netdev@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1504478574-13281-2-git-send-email-pablo@netfilter.org>","list_archive_url":null,"date":"2017-09-03T22:42:44","name":"[37/47] netfilter: conntrack: print_conntrack only needed if CONFIG_NF_CONNTRACK_PROCFS","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"9567f1584f9fe19e754e24813678021c925805e7","submitter":{"id":1315,"url":"http://patchwork.ozlabs.org/api/1.2/people/1315/?format=json","name":"Pablo Neira Ayuso","email":"pablo@netfilter.org"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/1.2/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/1504478574-13281-2-git-send-email-pablo@netfilter.org/mbox/","series":[{"id":1283,"url":"http://patchwork.ozlabs.org/api/1.2/series/1283/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=1283","date":"2017-09-03T22:40:11","name":null,"version":1,"mbox":"http://patchwork.ozlabs.org/series/1283/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/809458/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/809458/checks/","tags":{},"related":[],"headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xlp1r43L0z9s06\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon,  4 Sep 2017 08:44:16 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753393AbdICWoO (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSun, 3 Sep 2017 18:44:14 -0400","from mail.us.es ([193.147.175.20]:53046 \"EHLO mail.us.es\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1753358AbdICWnI (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tSun, 3 Sep 2017 18:43:08 -0400","from antivirus1-rhel7.int (unknown [192.168.2.11])\n\tby mail.us.es (Postfix) with ESMTP id 7648B190F63\n\tfor <netdev@vger.kernel.org>; Mon,  4 Sep 2017 00:42:41 +0200 (CEST)","from antivirus1-rhel7.int (localhost [127.0.0.1])\n\tby antivirus1-rhel7.int (Postfix) with ESMTP id 62748B5024\n\tfor <netdev@vger.kernel.org>; Mon,  4 Sep 2017 00:42:41 +0200 (CEST)","by antivirus1-rhel7.int (Postfix, from userid 99)\n\tid 58248B5028; Mon,  4 Sep 2017 00:42:41 +0200 (CEST)","from antivirus1-rhel7.int (localhost [127.0.0.1])\n\tby antivirus1-rhel7.int (Postfix) with ESMTP id 32817B5024;\n\tMon,  4 Sep 2017 00:42:39 +0200 (CEST)","from 192.168.1.97 (192.168.1.97) by antivirus1-rhel7.int\n\t(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int); \n\tMon, 04 Sep 2017 00:42:39 +0200 (CEST)","from salvia.here (unknown [31.4.193.113])\n\t(Authenticated sender: pneira@us.es)\n\tby entrada.int (Postfix) with ESMTPA id CC5D84265A20;\n\tMon,  4 Sep 2017 00:42:38 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.1 (2015-04-28) on\n\tantivirus1-rhel7.int","X-Spam-Level":"","X-Spam-Status":"No, score=-108.2 required=7.5 tests=ALL_TRUSTED,BAYES_50,\n\tSMTPAUTH_US2,USER_IN_WHITELIST autolearn=disabled version=3.4.1","X-Virus-Status":"clean(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int)","X-SMTPAUTHUS":"auth mail.us.es","From":"Pablo Neira Ayuso <pablo@netfilter.org>","To":"netfilter-devel@vger.kernel.org","Cc":"davem@davemloft.net, netdev@vger.kernel.org","Subject":"[PATCH 37/47] netfilter: conntrack: print_conntrack only needed if\n\tCONFIG_NF_CONNTRACK_PROCFS","Date":"Mon,  4 Sep 2017 00:42:44 +0200","Message-Id":"<1504478574-13281-2-git-send-email-pablo@netfilter.org>","X-Mailer":"git-send-email 2.1.4","In-Reply-To":"<1504478574-13281-1-git-send-email-pablo@netfilter.org>","References":"<1504478574-13281-1-git-send-email-pablo@netfilter.org>","X-Virus-Scanned":"ClamAV using ClamSMTP","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"From: Florian Westphal <fw@strlen.de>\n\nSigned-off-by: Florian Westphal <fw@strlen.de>\nSigned-off-by: Pablo Neira Ayuso <pablo@netfilter.org>\n---\n include/net/netfilter/nf_conntrack_l4proto.h | 7 ++++---\n net/netfilter/nf_conntrack_proto_dccp.c      | 6 ++++++\n net/netfilter/nf_conntrack_proto_gre.c       | 4 ++++\n net/netfilter/nf_conntrack_proto_sctp.c      | 6 ++++++\n net/netfilter/nf_conntrack_proto_tcp.c       | 6 ++++++\n 5 files changed, 26 insertions(+), 3 deletions(-)","diff":"diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h\nindex 7e8da04a5eb6..4976ef92dc78 100644\n--- a/include/net/netfilter/nf_conntrack_l4proto.h\n+++ b/include/net/netfilter/nf_conntrack_l4proto.h\n@@ -61,9 +61,6 @@ struct nf_conntrack_l4proto {\n \t/* called by gc worker if table is full */\n \tbool (*can_early_drop)(const struct nf_conn *ct);\n \n-\t/* Print out the private part of the conntrack. */\n-\tvoid (*print_conntrack)(struct seq_file *s, struct nf_conn *);\n-\n \t/* Return the array of timeouts for this protocol. */\n \tunsigned int *(*get_timeouts)(struct net *net);\n \n@@ -97,6 +94,10 @@ struct nf_conntrack_l4proto {\n \t\tconst struct nla_policy *nla_policy;\n \t} ctnl_timeout;\n #endif\n+#ifdef CONFIG_NF_CONNTRACK_PROCFS\n+\t/* Print out the private part of the conntrack. */\n+\tvoid (*print_conntrack)(struct seq_file *s, struct nf_conn *);\n+#endif\n \tunsigned int\t*net_id;\n \t/* Init l4proto pernet data */\n \tint (*init_net)(struct net *net, u_int16_t proto);\ndiff --git a/net/netfilter/nf_conntrack_proto_dccp.c b/net/netfilter/nf_conntrack_proto_dccp.c\nindex d2df49ac390a..188347571fc7 100644\n--- a/net/netfilter/nf_conntrack_proto_dccp.c\n+++ b/net/netfilter/nf_conntrack_proto_dccp.c\n@@ -623,10 +623,12 @@ static bool dccp_can_early_drop(const struct nf_conn *ct)\n \treturn false;\n }\n \n+#ifdef CONFIG_NF_CONNTRACK_PROCFS\n static void dccp_print_conntrack(struct seq_file *s, struct nf_conn *ct)\n {\n \tseq_printf(s, \"%s \", dccp_state_names[ct->proto.dccp.state]);\n }\n+#endif\n \n #if IS_ENABLED(CONFIG_NF_CT_NETLINK)\n static int dccp_to_nlattr(struct sk_buff *skb, struct nlattr *nla,\n@@ -879,7 +881,9 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_dccp4 __read_mostly = {\n \t.get_timeouts\t\t= dccp_get_timeouts,\n \t.error\t\t\t= dccp_error,\n \t.can_early_drop\t\t= dccp_can_early_drop,\n+#ifdef CONFIG_NF_CONNTRACK_PROCFS\n \t.print_conntrack\t= dccp_print_conntrack,\n+#endif\n #if IS_ENABLED(CONFIG_NF_CT_NETLINK)\n \t.to_nlattr\t\t= dccp_to_nlattr,\n \t.nlattr_size\t\t= dccp_nlattr_size,\n@@ -913,7 +917,9 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_dccp6 __read_mostly = {\n \t.get_timeouts\t\t= dccp_get_timeouts,\n \t.error\t\t\t= dccp_error,\n \t.can_early_drop\t\t= dccp_can_early_drop,\n+#ifdef CONFIG_NF_CONNTRACK_PROCFS\n \t.print_conntrack\t= dccp_print_conntrack,\n+#endif\n #if IS_ENABLED(CONFIG_NF_CT_NETLINK)\n \t.to_nlattr\t\t= dccp_to_nlattr,\n \t.nlattr_size\t\t= dccp_nlattr_size,\ndiff --git a/net/netfilter/nf_conntrack_proto_gre.c b/net/netfilter/nf_conntrack_proto_gre.c\nindex cd28095dd7a4..c0e3a23ac23a 100644\n--- a/net/netfilter/nf_conntrack_proto_gre.c\n+++ b/net/netfilter/nf_conntrack_proto_gre.c\n@@ -224,6 +224,7 @@ static bool gre_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff,\n \treturn true;\n }\n \n+#ifdef CONFIG_NF_CONNTRACK_PROCFS\n /* print private data for conntrack */\n static void gre_print_conntrack(struct seq_file *s, struct nf_conn *ct)\n {\n@@ -231,6 +232,7 @@ static void gre_print_conntrack(struct seq_file *s, struct nf_conn *ct)\n \t\t   (ct->proto.gre.timeout / HZ),\n \t\t   (ct->proto.gre.stream_timeout / HZ));\n }\n+#endif\n \n static unsigned int *gre_get_timeouts(struct net *net)\n {\n@@ -357,7 +359,9 @@ static struct nf_conntrack_l4proto nf_conntrack_l4proto_gre4 __read_mostly = {\n \t.l4proto\t = IPPROTO_GRE,\n \t.pkt_to_tuple\t = gre_pkt_to_tuple,\n \t.invert_tuple\t = gre_invert_tuple,\n+#ifdef CONFIG_NF_CONNTRACK_PROCFS\n \t.print_conntrack = gre_print_conntrack,\n+#endif\n \t.get_timeouts    = gre_get_timeouts,\n \t.packet\t\t = gre_packet,\n \t.new\t\t = gre_new,\ndiff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c\nindex da83b401be17..890b5c73368d 100644\n--- a/net/netfilter/nf_conntrack_proto_sctp.c\n+++ b/net/netfilter/nf_conntrack_proto_sctp.c\n@@ -174,11 +174,13 @@ static bool sctp_invert_tuple(struct nf_conntrack_tuple *tuple,\n \treturn true;\n }\n \n+#ifdef CONFIG_NF_CONNTRACK_PROCFS\n /* Print out the private part of the conntrack. */\n static void sctp_print_conntrack(struct seq_file *s, struct nf_conn *ct)\n {\n \tseq_printf(s, \"%s \", sctp_conntrack_names[ct->proto.sctp.state]);\n }\n+#endif\n \n #define for_each_sctp_chunk(skb, sch, _sch, offset, dataoff, count)\t\\\n for ((offset) = (dataoff) + sizeof(struct sctphdr), (count) = 0;\t\\\n@@ -784,7 +786,9 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_sctp4 __read_mostly = {\n \t.l4proto \t\t= IPPROTO_SCTP,\n \t.pkt_to_tuple \t\t= sctp_pkt_to_tuple,\n \t.invert_tuple \t\t= sctp_invert_tuple,\n+#ifdef CONFIG_NF_CONNTRACK_PROCFS\n \t.print_conntrack\t= sctp_print_conntrack,\n+#endif\n \t.packet \t\t= sctp_packet,\n \t.get_timeouts\t\t= sctp_get_timeouts,\n \t.new \t\t\t= sctp_new,\n@@ -819,7 +823,9 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_sctp6 __read_mostly = {\n \t.l4proto \t\t= IPPROTO_SCTP,\n \t.pkt_to_tuple \t\t= sctp_pkt_to_tuple,\n \t.invert_tuple \t\t= sctp_invert_tuple,\n+#ifdef CONFIG_NF_CONNTRACK_PROCFS\n \t.print_conntrack\t= sctp_print_conntrack,\n+#endif\n \t.packet \t\t= sctp_packet,\n \t.get_timeouts\t\t= sctp_get_timeouts,\n \t.new \t\t\t= sctp_new,\ndiff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c\nindex c868b36b8945..33c52d9ab2f5 100644\n--- a/net/netfilter/nf_conntrack_proto_tcp.c\n+++ b/net/netfilter/nf_conntrack_proto_tcp.c\n@@ -301,11 +301,13 @@ static bool tcp_invert_tuple(struct nf_conntrack_tuple *tuple,\n \treturn true;\n }\n \n+#ifdef CONFIG_NF_CONNTRACK_PROCFS\n /* Print out the private part of the conntrack. */\n static void tcp_print_conntrack(struct seq_file *s, struct nf_conn *ct)\n {\n \tseq_printf(s, \"%s \", tcp_conntrack_names[ct->proto.tcp.state]);\n }\n+#endif\n \n static unsigned int get_conntrack_index(const struct tcphdr *tcph)\n {\n@@ -1549,7 +1551,9 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4 __read_mostly =\n \t.l4proto \t\t= IPPROTO_TCP,\n \t.pkt_to_tuple \t\t= tcp_pkt_to_tuple,\n \t.invert_tuple \t\t= tcp_invert_tuple,\n+#ifdef CONFIG_NF_CONNTRACK_PROCFS\n \t.print_conntrack \t= tcp_print_conntrack,\n+#endif\n \t.packet \t\t= tcp_packet,\n \t.get_timeouts\t\t= tcp_get_timeouts,\n \t.new \t\t\t= tcp_new,\n@@ -1585,7 +1589,9 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6 __read_mostly =\n \t.l4proto \t\t= IPPROTO_TCP,\n \t.pkt_to_tuple \t\t= tcp_pkt_to_tuple,\n \t.invert_tuple \t\t= tcp_invert_tuple,\n+#ifdef CONFIG_NF_CONNTRACK_PROCFS\n \t.print_conntrack \t= tcp_print_conntrack,\n+#endif\n \t.packet \t\t= tcp_packet,\n \t.get_timeouts\t\t= tcp_get_timeouts,\n \t.new \t\t\t= tcp_new,\n","prefixes":["37/47"]}