All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipvs: fix header inline net_ipvs function to work without CONFIG_IP_VS
@ 2015-03-25  8:53 Rafał Miłecki
  2015-03-25  9:03 ` Nicolas Dichtel
  2015-03-25  9:17 ` [PATCH V2] ipvs: disable inline net_ipvs function with CONFIG_IP_VS not being set Rafał Miłecki
  0 siblings, 2 replies; 8+ messages in thread
From: Rafał Miłecki @ 2015-03-25  8:53 UTC (permalink / raw)
  To: Pablo Neira Ayuso, Patrick McHardy, Jozsef Kadlecsik
  Cc: netfilter-devel, coreteam, Nicolas Dichtel, Julian Anastasov,
	Simon Horman, Rafał Miłecki

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@gmail.com>
---
 include/net/ip_vs.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 615b20b..cd3942f 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -32,7 +32,10 @@
 /* Generic access of ipvs struct */
 static inline struct netns_ipvs *net_ipvs(struct net* net)
 {
+#if IS_ENABLED(CONFIG_IP_VS)
 	return net->ipvs;
+#endif
+	return NULL;
 }
 
 /* Get net ptr from skb in traffic cases
-- 
1.8.4.5

--
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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] ipvs: fix header inline net_ipvs function to work without CONFIG_IP_VS
  2015-03-25  8:53 [PATCH] ipvs: fix header inline net_ipvs function to work without CONFIG_IP_VS Rafał Miłecki
@ 2015-03-25  9:03 ` Nicolas Dichtel
  2015-03-25  9:17 ` [PATCH V2] ipvs: disable inline net_ipvs function with CONFIG_IP_VS not being set Rafał Miłecki
  1 sibling, 0 replies; 8+ messages in thread
From: Nicolas Dichtel @ 2015-03-25  9:03 UTC (permalink / raw)
  To: Rafał Miłecki, Pablo Neira Ayuso, Patrick McHardy,
	Jozsef Kadlecsik
  Cc: netfilter-devel, coreteam, Julian Anastasov, Simon Horman

Le 25/03/2015 09:53, Rafał Miłecki a écrit :
> 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@gmail.com>
> ---
>   include/net/ip_vs.h | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
> index 615b20b..cd3942f 100644
> --- a/include/net/ip_vs.h
> +++ b/include/net/ip_vs.h
> @@ -32,7 +32,10 @@
>   /* Generic access of ipvs struct */
>   static inline struct netns_ipvs *net_ipvs(struct net* net)
>   {
> +#if IS_ENABLED(CONFIG_IP_VS)
>   	return net->ipvs;
> +#endif
> +	return NULL;
>   }
This function is used only by the ipvs module, maybe it should be defined only
when CONFIG_IP_VS is set?

Anyway, it must not return NULL, all callers assume that the pointer is valid.
--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH V2] ipvs: disable inline net_ipvs function with CONFIG_IP_VS not being set
  2015-03-25  8:53 [PATCH] ipvs: fix header inline net_ipvs function to work without CONFIG_IP_VS Rafał Miłecki
  2015-03-25  9:03 ` Nicolas Dichtel
@ 2015-03-25  9:17 ` Rafał Miłecki
  2015-03-25 10:25   ` Nicolas Dichtel
  2015-03-25 20:04   ` Julian Anastasov
  1 sibling, 2 replies; 8+ messages in thread
From: Rafał Miłecki @ 2015-03-25  9:17 UTC (permalink / raw)
  To: Pablo Neira Ayuso, Patrick McHardy, Jozsef Kadlecsik
  Cc: netfilter-devel, coreteam, Nicolas Dichtel, Julian Anastasov,
	Simon Horman, Rafał Miłecki

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@gmail.com>
---
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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH V2] ipvs: disable inline net_ipvs function with CONFIG_IP_VS not being set
  2015-03-25  9:17 ` [PATCH V2] ipvs: disable inline net_ipvs function with CONFIG_IP_VS not being set Rafał Miłecki
@ 2015-03-25 10:25   ` Nicolas Dichtel
  2015-03-25 11:08     ` Rafał Miłecki
  2015-03-25 20:04   ` Julian Anastasov
  1 sibling, 1 reply; 8+ messages in thread
From: Nicolas Dichtel @ 2015-03-25 10:25 UTC (permalink / raw)
  To: Rafał Miłecki, Pablo Neira Ayuso, Patrick McHardy,
	Jozsef Kadlecsik
  Cc: netfilter-devel, Julian Anastasov, Simon Horman

Le 25/03/2015 10:17, Rafał Miłecki a écrit :
> 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@gmail.com>
> ---
> 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
Ok, but this fix nothing, there is no bug upstream. This file is only included
by ipvs module files.
For me, it's a bit strange to have '#ifdef CONFIG_IP_VS' in a file specific to
this module. This just fix your third party module.
--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V2] ipvs: disable inline net_ipvs function with CONFIG_IP_VS not being set
  2015-03-25 10:25   ` Nicolas Dichtel
@ 2015-03-25 11:08     ` Rafał Miłecki
  2015-03-25 13:12       ` Nicolas Dichtel
  0 siblings, 1 reply; 8+ messages in thread
From: Rafał Miłecki @ 2015-03-25 11:08 UTC (permalink / raw)
  To: Nicolas Dichtel
  Cc: Pablo Neira Ayuso, Patrick McHardy, Jozsef Kadlecsik,
	netfilter-devel, Julian Anastasov, Simon Horman

On 25 March 2015 at 11:25, Nicolas Dichtel <nicolas.dichtel@6wind.com> wrote:
> Le 25/03/2015 10:17, Rafał Miłecki a écrit :
>>
>> 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@gmail.com>
>> ---
>> 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
>
> Ok, but this fix nothing, there is no bug upstream. This file is only
> included
> by ipvs module files.

So maybe it should be moved to net/netfilter/ipvs/?


> For me, it's a bit strange to have '#ifdef CONFIG_IP_VS' in a file specific
> to
> this module. This just fix your third party module.

Will do. I was just thinking this header doesn't follow headers logic
well and wanted to help.

-- 
Rafał
--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V2] ipvs: disable inline net_ipvs function with CONFIG_IP_VS not being set
  2015-03-25 11:08     ` Rafał Miłecki
@ 2015-03-25 13:12       ` Nicolas Dichtel
  0 siblings, 0 replies; 8+ messages in thread
From: Nicolas Dichtel @ 2015-03-25 13:12 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Pablo Neira Ayuso, Patrick McHardy, Jozsef Kadlecsik,
	netfilter-devel, Julian Anastasov, Simon Horman

Le 25/03/2015 12:08, Rafał Miłecki a écrit :
> On 25 March 2015 at 11:25, Nicolas Dichtel <nicolas.dichtel@6wind.com> wrote:
[snip]
>> For me, it's a bit strange to have '#ifdef CONFIG_IP_VS' in a file specific
>> to
>> this module. This just fix your third party module.
>
> Will do. I was just thinking this header doesn't follow headers logic
> well and wanted to help.
>
The logic is to fix bug that are in-tree ;-)
--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V2] ipvs: disable inline net_ipvs function with CONFIG_IP_VS not being set
  2015-03-25  9:17 ` [PATCH V2] ipvs: disable inline net_ipvs function with CONFIG_IP_VS not being set Rafał Miłecki
  2015-03-25 10:25   ` Nicolas Dichtel
@ 2015-03-25 20:04   ` Julian Anastasov
  2015-03-25 20:15     ` Rafał Miłecki
  1 sibling, 1 reply; 8+ messages in thread
From: Julian Anastasov @ 2015-03-25 20:04 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Pablo Neira Ayuso, Patrick McHardy, Jozsef Kadlecsik,
	netfilter-devel, coreteam, Nicolas Dichtel, Simon Horman

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1426 bytes --]


	Hello,

On Wed, 25 Mar 2015, Rafał Miłecki wrote:

> 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@gmail.com>
> ---
> V2: Disable function totally instead of returning NULL.

	While this version is better, the commit message
looks scary, it should explain that problem happens only
for modules out of kernel tree, we do not want other admins
to wonder whether they need this commit for their trees.

	And of course, it is better to implement your
own ip_vs_check_diff4 version, it is some inline stuff...

> ---
>  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

Regards

--
Julian Anastasov <ja@ssi.bg>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V2] ipvs: disable inline net_ipvs function with CONFIG_IP_VS not being set
  2015-03-25 20:04   ` Julian Anastasov
@ 2015-03-25 20:15     ` Rafał Miłecki
  0 siblings, 0 replies; 8+ messages in thread
From: Rafał Miłecki @ 2015-03-25 20:15 UTC (permalink / raw)
  To: Julian Anastasov
  Cc: Pablo Neira Ayuso, Patrick McHardy, Jozsef Kadlecsik,
	netfilter-devel, coreteam, Nicolas Dichtel, Simon Horman

On 25 March 2015 at 21:04, Julian Anastasov <ja@ssi.bg> wrote:
>
>         Hello,
>
> On Wed, 25 Mar 2015, Rafał Miłecki wrote:
>
>> 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@gmail.com>
>> ---
>> V2: Disable function totally instead of returning NULL.
>
>         While this version is better, the commit message
> looks scary, it should explain that problem happens only
> for modules out of kernel tree, we do not want other admins
> to wonder whether they need this commit for their trees.

OK, I just need some decision if you want/need this patch at all and
if I should send another version.


>         And of course, it is better to implement your
> own ip_vs_check_diff4 version, it is some inline stuff...

I did.
--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-03-25 20:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-25  8:53 [PATCH] ipvs: fix header inline net_ipvs function to work without CONFIG_IP_VS Rafał Miłecki
2015-03-25  9:03 ` Nicolas Dichtel
2015-03-25  9:17 ` [PATCH V2] ipvs: disable inline net_ipvs function with CONFIG_IP_VS not being set Rafał Miłecki
2015-03-25 10:25   ` Nicolas Dichtel
2015-03-25 11:08     ` Rafał Miłecki
2015-03-25 13:12       ` Nicolas Dichtel
2015-03-25 20:04   ` Julian Anastasov
2015-03-25 20:15     ` Rafał Miłecki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.