[lxc-devel] [lxd/master] lxd/networks: Nicer error on misisng IPv6

stgraber on Github lxc-bot at linuxcontainers.org
Sat Oct 26 23:58:02 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20191026/813f5b65/attachment.bin>
-------------- next part --------------
From ce0941213ff55ff5381b6f98e0ac1848fb612c4b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sat, 26 Oct 2019 19:57:25 -0400
Subject: [PATCH] lxd/networks: Nicer error on misisng IPv6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/networks.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lxd/networks.go b/lxd/networks.go
index 767a14fefd..dfcb831a65 100644
--- a/lxd/networks.go
+++ b/lxd/networks.go
@@ -1093,6 +1093,10 @@ func (n *network) Setup(oldConfig map[string]string) error {
 
 	// IPv6 bridge configuration
 	if !shared.StringInSlice(n.config["ipv6.address"], []string{"", "none"}) {
+		if !shared.PathExists("/proc/sys/net/ipv6") {
+			return fmt.Errorf("Network has ipv6.address but kernel IPv6 support is missing")
+		}
+
 		err := device.NetworkSysctlSet(fmt.Sprintf("ipv6/conf/%s/autoconf", n.name), "0")
 		if err != nil {
 			return err


More information about the lxc-devel mailing list