[libvirt] [PATCH] network: honor the ipv6 network option

Ryan Goodfellow posted 1 patch 5 years, 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20181011040634.125810-1-rgoodfel@isi.edu
Test syntax-check passed
src/network/bridge_driver.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[libvirt] [PATCH] network: honor the ipv6 network option
Posted by Ryan Goodfellow 5 years, 5 months ago
According the the documentation for the ipv6 network attribute

https://libvirt.org/formatnetwork.html

"When set to yes, the optional parameter ipv6 enables a network
definition with no IPv6 gateway addresses specified to have
guest-to-guest communications."

But this is not the current behavior, the ipv6 attribute is ignored and
the resulting /proc/sys/net/ipv6/conf/<virbrX>/disable_ipv6 gets set to
1 even when ipv6="yes".

This commit fixes that by checking for the ipv6 network attribute during
bridge setup.

Signed-off-by: Ryan C Goodfellow <rgoodfel@isi.edu>
---
 src/network/bridge_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 4bbc4f5a6d..69022fbfbb 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -2221,7 +2221,8 @@ networkSetIPv6Sysctls(virNetworkObjPtr obj)
     virNetworkDefPtr def = virNetworkObjGetDef(obj);
     char *field = NULL;
     int ret = -1;
-    bool enableIPv6 = !!virNetworkDefGetIPByIndex(def, AF_INET6, 0);
+    bool enableIPv6 = !!virNetworkDefGetIPByIndex(def, AF_INET6, 0) |
+                      def->ipv6nogw;
 
     /* set disable_ipv6 if there are no ipv6 addresses defined for the
      * network. But also unset it if there *are* ipv6 addresses, as we
-- 
2.17.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] network: honor the ipv6 network option
Posted by John Ferlan 5 years, 5 months ago

On 10/11/18 12:06 AM, Ryan Goodfellow wrote:
> According the the documentation for the ipv6 network attribute
> 
> https://libvirt.org/formatnetwork.html
> 
> "When set to yes, the optional parameter ipv6 enables a network
> definition with no IPv6 gateway addresses specified to have
> guest-to-guest communications."
> 
> But this is not the current behavior, the ipv6 attribute is ignored and
> the resulting /proc/sys/net/ipv6/conf/<virbrX>/disable_ipv6 gets set to
> 1 even when ipv6="yes".

Interesting, so it seems commit 705e67d40b didn't do all it claimed to
do... Or is it the case where that perception is different.  The
parameter was added and the code changed to modify guest to guest
communication filters (in/for 1.0.1)

By changing this that would see to allow more - I've CC'd laine to grab
his attention to this and get his feedback, especially since commit
c0788af0 was generated after the other one and he wrote that one (in/for
1.2.7).

John

> 
> This commit fixes that by checking for the ipv6 network attribute during
> bridge setup.
> 
> Signed-off-by: Ryan C Goodfellow <rgoodfel@isi.edu>
> ---
>  src/network/bridge_driver.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
> index 4bbc4f5a6d..69022fbfbb 100644
> --- a/src/network/bridge_driver.c
> +++ b/src/network/bridge_driver.c
> @@ -2221,7 +2221,8 @@ networkSetIPv6Sysctls(virNetworkObjPtr obj)
>      virNetworkDefPtr def = virNetworkObjGetDef(obj);
>      char *field = NULL;
>      int ret = -1;
> -    bool enableIPv6 = !!virNetworkDefGetIPByIndex(def, AF_INET6, 0);
> +    bool enableIPv6 = !!virNetworkDefGetIPByIndex(def, AF_INET6, 0) |
> +                      def->ipv6nogw;
>  
>      /* set disable_ipv6 if there are no ipv6 addresses defined for the
>       * network. But also unset it if there *are* ipv6 addresses, as we
> 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list