[PATCH V2] ipvs: disable inline net_ipvs function with CONFIG_IP_VS not being set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Including net/ip_vs.h without CONFIG_IP_VS was causing:
include/net/ip_vs.h: In function 'net_ipvs':
include/net/ip_vs.h:35:12: error: 'struct net' has no member named 'ipvs'

Fixes: 8b4d14d8eb368 ("netns: exclude ipvs from struct net when IPVS disabled")
Signed-off-by: Rafał Miłecki <zajec5@xxxxxxxxx>
---
V2: Disable function totally instead of returning NULL.
---
 include/net/ip_vs.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 615b20b..e6f2f2a 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -29,11 +29,13 @@
 #endif
 #include <net/net_namespace.h>		/* Netw namespace */
 
+#if IS_ENABLED(CONFIG_IP_VS)
 /* Generic access of ipvs struct */
 static inline struct netns_ipvs *net_ipvs(struct net* net)
 {
 	return net->ipvs;
 }
+#endif
 
 /* Get net ptr from skb in traffic cases
  * use skb_sknet when call is from userland (ioctl or netlink)
-- 
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux