[libvirt] [PATCH] network: only check for IPv6 RA routes when the network has an IPv6 address

Laine Stump posted 1 patch 7 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20170324002337.5623-1-laine@laine.org
src/network/bridge_driver.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[libvirt] [PATCH] network: only check for IPv6 RA routes when the network has an IPv6 address
Posted by Laine Stump 7 years ago
commit 00d28a78 added a check to see if there were any IPv6 routes
added by RA (Router Advertisement) via an interface that had accept_ra
set to something other than "2". The check was being done
unconditionally, but it's only relevant if IPv6 forwarding is going to
be turned on, and that will only happen if the network has an IPv6
address.
---
 src/network/bridge_driver.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 0336ece..10e8f0e 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -2391,10 +2391,9 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver,
 
     /* If forward.type != NONE, turn on global IP forwarding */
     if (network->def->forward.type != VIR_NETWORK_FORWARD_NONE) {
-        if (!virNetDevIPCheckIPv6Forwarding())
+        if (v6present && !virNetDevIPCheckIPv6Forwarding())
             goto err3; /* Precise error message already provided */
 
-
         if (networkEnableIPForwarding(v4present, v6present) < 0) {
             virReportSystemError(errno, "%s",
                                  _("failed to enable IP forwarding"));
-- 
2.9.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] network: only check for IPv6 RA routes when the network has an IPv6 address
Posted by Cedric Bosdonnat 7 years ago
On Thu, 2017-03-23 at 20:23 -0400, Laine Stump wrote:
> commit 00d28a78 added a check to see if there were any IPv6 routes
> added by RA (Router Advertisement) via an interface that had accept_ra
> set to something other than "2". The check was being done
> unconditionally, but it's only relevant if IPv6 forwarding is going to
> be turned on, and that will only happen if the network has an IPv6
> address.
> ---
>  src/network/bridge_driver.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
> index 0336ece..10e8f0e 100644
> --- a/src/network/bridge_driver.c
> +++ b/src/network/bridge_driver.c
> @@ -2391,10 +2391,9 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver,
>  
>      /* If forward.type != NONE, turn on global IP forwarding */
>      if (network->def->forward.type != VIR_NETWORK_FORWARD_NONE) {
> -        if (!virNetDevIPCheckIPv6Forwarding())
> +        if (v6present && !virNetDevIPCheckIPv6Forwarding())
>              goto err3; /* Precise error message already provided */
>  
> -
>          if (networkEnableIPForwarding(v4present, v6present) < 0) {
>              virReportSystemError(errno, "%s",
>                                   _("failed to enable IP forwarding"));


Thanks for catching it! ACK

--
Cedric

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