Skip to content

Commit

Permalink
netfilter: ipvs: fix compiler warnings
Browse files Browse the repository at this point in the history
Fix compiler warnings when no transport protocol load balancing support
is configured.

[[email protected]: removed suprious __ip_vs_cleanup() clean-up hunk]
Signed-off-by: Changli Gao <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
  • Loading branch information
xiaosuo authored and horms committed Jan 22, 2011
1 parent bced94e commit 091bb34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/netfilter/ipvs/ip_vs_ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions net/netfilter/ipvs/ip_vs_proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -85,6 +88,7 @@ register_ip_vs_proto_netns(struct net *net, struct ip_vs_protocol *pp)

return 0;
}
#endif

/*
* unregister an ipvs protocol
Expand Down

0 comments on commit 091bb34

Please sign in to comment.