Mark McLoughlin 2105d6
From: Mark McLoughlin <markmc@redhat.com>
Mark McLoughlin 2105d6
Subject: [PATCH] Handle kernels with no ipv6 support
Mark McLoughlin 2105d6
Mark McLoughlin 2105d6
If the ipv6 kernel module is not loaded, then we get this when starting
Mark McLoughlin 2105d6
a virtual network:
Mark McLoughlin 2105d6
Mark McLoughlin 2105d6
  libvir: Network Config error :
Mark McLoughlin 2105d6
  cannot enable /proc/sys/net/ipv6/conf/virbr0/disable_ipv6:
Mark McLoughlin 2105d6
  No such file or directory
Mark McLoughlin 2105d6
Mark McLoughlin 2105d6
If disable_ipv6 is not present, we should just merrily continue on our
Mark McLoughlin 2105d6
way.
Mark McLoughlin 2105d6
Mark McLoughlin 2105d6
* src/network_driver.c: make networkDisableIPV6() not fail if the kernel
Mark McLoughlin 2105d6
  has no ipv6 support
Mark McLoughlin 2105d6
---
Mark McLoughlin 2105d6
 src/network_driver.c |    6 ++++++
Mark McLoughlin 2105d6
 1 files changed, 6 insertions(+), 0 deletions(-)
Mark McLoughlin 2105d6
Mark McLoughlin 2105d6
diff --git a/src/network_driver.c b/src/network_driver.c
Mark McLoughlin 2105d6
index eaea454..84910ab 100644
Mark McLoughlin 2105d6
--- a/src/network_driver.c
Mark McLoughlin 2105d6
+++ b/src/network_driver.c
Mark McLoughlin 2105d6
@@ -801,6 +801,12 @@ static int networkDisableIPV6(virConnectPtr conn,
Mark McLoughlin 2105d6
         goto cleanup;
Mark McLoughlin 2105d6
     }
Mark McLoughlin 2105d6
 
Mark McLoughlin 2105d6
+    if (access(field, W_OK) < 0 && errno == ENOENT) {
Mark McLoughlin 2105d6
+        VIR_DEBUG("ipv6 appears to already be disabled on %s", network->def->bridge);
Mark McLoughlin 2105d6
+        ret = 0;
Mark McLoughlin 2105d6
+        goto cleanup;
Mark McLoughlin 2105d6
+    }
Mark McLoughlin 2105d6
+
Mark McLoughlin 2105d6
     if (virFileWriteStr(field, "1") < 0) {
Mark McLoughlin 2105d6
         virReportSystemError(conn, errno,
Mark McLoughlin 2105d6
                              _("cannot enable %s"), field);
Mark McLoughlin 2105d6
-- 
Mark McLoughlin 2105d6
1.6.2.5
Mark McLoughlin 2105d6