[PATCH] netfilter: ipvs: fix compiler warnings

Subsystems: ipvs, netfilter, networking [general], the rest

STALE5749d

6 messages, 3 authors, 2011-01-22 · open the first message on its own page

[PATCH] netfilter: ipvs: fix compiler warnings

From: Changli Gao <hidden>
Date: 2011-01-21 10:02:13

Fix compiler warnings when no transport protocol load balancing support
is configured.

Signed-off-by: Changli Gao <redacted>
---
 net/netfilter/ipvs/ip_vs_core.c  |    4 +---
 net/netfilter/ipvs/ip_vs_ctl.c   |    4 ++++
 net/netfilter/ipvs/ip_vs_proto.c |    4 ++++
 3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index f36a84f..d889f4f 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1894,9 +1894,7 @@ static int __net_init __ip_vs_init(struct net *net)
 
 static void __net_exit __ip_vs_cleanup(struct net *net)
 {
-	struct netns_ipvs *ipvs = net_ipvs(net);
-
-	IP_VS_DBG(10, "ipvs netns %d released\n", ipvs->gen);
+	IP_VS_DBG(10, "ipvs netns %d released\n", net_ipvs(net)->gen);
 }
 
 static struct pernet_operations ipvs_core_ops = {
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 09ca2ce..68b8033 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -2062,7 +2062,9 @@ static const struct file_operations ip_vs_stats_percpu_fops = {
  */
 static int ip_vs_set_timeout(struct net *net, struct ip_vs_timeout_user *u)
 {
+#if defined(CONFIG_IP_VS_PROTO_TCP) || defined(CONFIG_IP_VS_PROTO_UDP)
 	struct ip_vs_proto_data *pd;
+#endif
 
 	IP_VS_DBG(2, "Setting timeout tcp:%d tcpfin:%d udp:%d\n",
 		  u->tcp_timeout,
@@ -2405,7 +2407,9 @@ __ip_vs_get_dest_entries(struct net *net, const struct ip_vs_get_dests *get,
 static inline void
 __ip_vs_get_timeouts(struct net *net, struct ip_vs_timeout_user *u)
 {
+#if defined(CONFIG_IP_VS_PROTO_TCP) || defined(CONFIG_IP_VS_PROTO_UDP)
 	struct ip_vs_proto_data *pd;
+#endif
 
 #ifdef CONFIG_IP_VS_PROTO_TCP
 	pd = ip_vs_proto_data_get(net, IPPROTO_TCP);
diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c
index 6ac986c..17484a4 100644
--- a/net/netfilter/ipvs/ip_vs_proto.c
+++ b/net/netfilter/ipvs/ip_vs_proto.c
@@ -60,6 +60,9 @@ static int __used __init register_ip_vs_protocol(struct ip_vs_protocol *pp)
 	return 0;
 }
 
+#if defined(CONFIG_IP_VS_PROTO_TCP) || defined(CONFIG_IP_VS_PROTO_UDP) || \
+    defined(CONFIG_IP_VS_PROTO_SCTP) || defined(CONFIG_IP_VS_PROTO_AH) || \
+    defined(CONFIG_IP_VS_PROTO_ESP)
 /*
  *	register an ipvs protocols netns related data
  */
@@ -85,6 +88,7 @@ register_ip_vs_proto_netns(struct net *net, struct ip_vs_protocol *pp)
 
 	return 0;
 }
+#endif
 
 /*
  *	unregister an ipvs protocol

Re: [PATCH] netfilter: ipvs: fix compiler warnings

From: Patrick McHardy <hidden>
Date: 2011-01-21 16:50:09

Am 21.01.2011 11:02, schrieb Changli Gao:
Fix compiler warnings when no transport protocol load balancing support
is configured.
Thanks Changli, I'll apply your patch once one of the IPVS developers
ACKs this.

Re: [PATCH] netfilter: ipvs: fix compiler warnings

From: Simon Horman <horms@verge.net.au>
Date: 2011-01-22 02:22:33

On Fri, Jan 21, 2011 at 06:02:13PM +0800, Changli Gao wrote:
quoted hunk
Fix compiler warnings when no transport protocol load balancing support
is configured.

Signed-off-by: Changli Gao <redacted>
---
 net/netfilter/ipvs/ip_vs_core.c  |    4 +---
 net/netfilter/ipvs/ip_vs_ctl.c   |    4 ++++
 net/netfilter/ipvs/ip_vs_proto.c |    4 ++++
 3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index f36a84f..d889f4f 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1894,9 +1894,7 @@ static int __net_init __ip_vs_init(struct net *net)
 
 static void __net_exit __ip_vs_cleanup(struct net *net)
 {
-	struct netns_ipvs *ipvs = net_ipvs(net);
-
-	IP_VS_DBG(10, "ipvs netns %d released\n", ipvs->gen);
+	IP_VS_DBG(10, "ipvs netns %d released\n", net_ipvs(net)->gen);
 }
 
The hunk above seems unrelated to the problem described.
The rest of the changes look good. I will double check and
apply them to my tree.

Patrick, I have another fix. So I think it would be best
to take this fix though my tree and. I'll send you a pull
request shortly.
quoted hunk
 static struct pernet_operations ipvs_core_ops = {
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 09ca2ce..68b8033 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -2062,7 +2062,9 @@ static const struct file_operations ip_vs_stats_percpu_fops = {
  */
 static int ip_vs_set_timeout(struct net *net, struct ip_vs_timeout_user *u)
 {
+#if defined(CONFIG_IP_VS_PROTO_TCP) || defined(CONFIG_IP_VS_PROTO_UDP)
 	struct ip_vs_proto_data *pd;
+#endif
 
 	IP_VS_DBG(2, "Setting timeout tcp:%d tcpfin:%d udp:%d\n",
 		  u->tcp_timeout,
@@ -2405,7 +2407,9 @@ __ip_vs_get_dest_entries(struct net *net, const struct ip_vs_get_dests *get,
 static inline void
 __ip_vs_get_timeouts(struct net *net, struct ip_vs_timeout_user *u)
 {
+#if defined(CONFIG_IP_VS_PROTO_TCP) || defined(CONFIG_IP_VS_PROTO_UDP)
 	struct ip_vs_proto_data *pd;
+#endif
 
 #ifdef CONFIG_IP_VS_PROTO_TCP
 	pd = ip_vs_proto_data_get(net, IPPROTO_TCP);
diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c
index 6ac986c..17484a4 100644
--- a/net/netfilter/ipvs/ip_vs_proto.c
+++ b/net/netfilter/ipvs/ip_vs_proto.c
@@ -60,6 +60,9 @@ static int __used __init register_ip_vs_protocol(struct ip_vs_protocol *pp)
 	return 0;
 }
 
+#if defined(CONFIG_IP_VS_PROTO_TCP) || defined(CONFIG_IP_VS_PROTO_UDP) || \
+    defined(CONFIG_IP_VS_PROTO_SCTP) || defined(CONFIG_IP_VS_PROTO_AH) || \
+    defined(CONFIG_IP_VS_PROTO_ESP)
 /*
  *	register an ipvs protocols netns related data
  */
@@ -85,6 +88,7 @@ register_ip_vs_proto_netns(struct net *net, struct ip_vs_protocol *pp)
 
 	return 0;
 }
+#endif
 
 /*
  *	unregister an ipvs protocol

Re: [PATCH] netfilter: ipvs: fix compiler warnings

From: Changli Gao <hidden>
Date: 2011-01-22 02:34:23

On Sat, Jan 22, 2011 at 10:22 AM, Simon Horman [off-list ref] wrote:
On Fri, Jan 21, 2011 at 06:02:13PM +0800, Changli Gao wrote:
quoted
Fix compiler warnings when no transport protocol load balancing support
is configured.

Signed-off-by: Changli Gao <redacted>
---
 net/netfilter/ipvs/ip_vs_core.c  |    4 +---
 net/netfilter/ipvs/ip_vs_ctl.c   |    4 ++++
 net/netfilter/ipvs/ip_vs_proto.c |    4 ++++
 3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index f36a84f..d889f4f 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1894,9 +1894,7 @@ static int __net_init __ip_vs_init(struct net *net)
 static void __net_exit __ip_vs_cleanup(struct net *net)
 {
-     struct netns_ipvs *ipvs = net_ipvs(net);
-
-     IP_VS_DBG(10, "ipvs netns %d released\n", ipvs->gen);
+     IP_VS_DBG(10, "ipvs netns %d released\n", net_ipvs(net)->gen);
 }
The hunk above seems unrelated to the problem described.
The rest of the changes look good. I will double check and
apply them to my tree.
Yes, is a separated patch needed? It is trivial. Thanks.

-- 
Regards,
Changli Gao(xiaosuo@gmail.com)

Re: [PATCH] netfilter: ipvs: fix compiler warnings

From: Simon Horman <horms@verge.net.au>
Date: 2011-01-22 03:11:16

On Sat, Jan 22, 2011 at 10:34:23AM +0800, Changli Gao wrote:
On Sat, Jan 22, 2011 at 10:22 AM, Simon Horman [off-list ref] wrote:
quoted
On Fri, Jan 21, 2011 at 06:02:13PM +0800, Changli Gao wrote:
quoted
Fix compiler warnings when no transport protocol load balancing support
is configured.

Signed-off-by: Changli Gao <redacted>
---
 net/netfilter/ipvs/ip_vs_core.c  |    4 +---
 net/netfilter/ipvs/ip_vs_ctl.c   |    4 ++++
 net/netfilter/ipvs/ip_vs_proto.c |    4 ++++
 3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index f36a84f..d889f4f 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1894,9 +1894,7 @@ static int __net_init __ip_vs_init(struct net *net)
 static void __net_exit __ip_vs_cleanup(struct net *net)
 {
-     struct netns_ipvs *ipvs = net_ipvs(net);
-
-     IP_VS_DBG(10, "ipvs netns %d released\n", ipvs->gen);
+     IP_VS_DBG(10, "ipvs netns %d released\n", net_ipvs(net)->gen);
 }
The hunk above seems unrelated to the problem described.
The rest of the changes look good. I will double check and
apply them to my tree.
Yes, is a separated patch needed? It is trivial. Thanks.
Yes, please send a separate patch.
--
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

Re: [PATCH] netfilter: ipvs: fix compiler warnings

From: Simon Horman <horms@verge.net.au>
Date: 2011-01-22 03:12:02

On Sat, Jan 22, 2011 at 02:11:16PM +1100, Simon Horman wrote:
On Sat, Jan 22, 2011 at 10:34:23AM +0800, Changli Gao wrote:
quoted
On Sat, Jan 22, 2011 at 10:22 AM, Simon Horman [off-list ref] wrote:
quoted
On Fri, Jan 21, 2011 at 06:02:13PM +0800, Changli Gao wrote:
quoted
Fix compiler warnings when no transport protocol load balancing support
is configured.

Signed-off-by: Changli Gao <redacted>
---
 net/netfilter/ipvs/ip_vs_core.c  |    4 +---
 net/netfilter/ipvs/ip_vs_ctl.c   |    4 ++++
 net/netfilter/ipvs/ip_vs_proto.c |    4 ++++
 3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index f36a84f..d889f4f 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1894,9 +1894,7 @@ static int __net_init __ip_vs_init(struct net *net)
 static void __net_exit __ip_vs_cleanup(struct net *net)
 {
-     struct netns_ipvs *ipvs = net_ipvs(net);
-
-     IP_VS_DBG(10, "ipvs netns %d released\n", ipvs->gen);
+     IP_VS_DBG(10, "ipvs netns %d released\n", net_ipvs(net)->gen);
 }
The hunk above seems unrelated to the problem described.
The rest of the changes look good. I will double check and
apply them to my tree.
Yes, is a separated patch needed? It is trivial. Thanks.
Yes, please send a separate patch.
To clarify, I have applied the other hunks and included
them in a pull request that I sent to Patrick a few moments ago.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help