The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/7744

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
The same MAC address on all fan bridge interfaces in the cluster breaks host<->fan comms.
From a059598f46665a38e89369052c74a9c128a61ee4 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parr...@canonical.com>
Date: Fri, 7 Aug 2020 12:31:29 +0100
Subject: [PATCH 1/2] lxd/network/driver/bridge: Don't allow stable volatile
 MAC with fan network

Breaks host<->fan traffic.

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
---
 lxd/network/driver_bridge.go | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lxd/network/driver_bridge.go b/lxd/network/driver_bridge.go
index 5518259f0a..997a805184 100644
--- a/lxd/network/driver_bridge.go
+++ b/lxd/network/driver_bridge.go
@@ -48,6 +48,13 @@ type bridge struct {
 
 // fillHwaddr populates the volatile.bridge.hwaddr in config if it, nor 
bridge.hwaddr, are already set.
 func (n *bridge) fillHwaddr(config map[string]string) error {
+       // Fan bridge doesn't support having the same MAC on all nodes (it 
breaks host<->fan traffic).
+       // Presumably because the host's MAC address is used for routing across 
the fan network.
+       if config["bridge.mode"] == "fan" {
+               return nil
+       }
+
+       // Don't generate a volatile stable MAC if network already has stable 
MAC.
        if config["bridge.hwaddr"] != "" || config["volatile.bridge.hwaddr"] != 
"" {
                return nil
        }

From 0a111a8ae198e5d74b0551eeb54c028a7be51bca Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parr...@canonical.com>
Date: Fri, 7 Aug 2020 12:53:13 +0100
Subject: [PATCH 2/2] lxd/network/driver/bridge: Don't allow hwaddr to be set
 in fan mode

Fan mode doesn't support static MAC address across all nodes.

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
---
 lxd/network/driver_bridge.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lxd/network/driver_bridge.go b/lxd/network/driver_bridge.go
index 997a805184..cb098e4b88 100644
--- a/lxd/network/driver_bridge.go
+++ b/lxd/network/driver_bridge.go
@@ -162,6 +162,10 @@ func (n *bridge) Validate(config map[string]string) error {
                                return nil
                        }
 
+                       if n.config["bridge.mode"] == "fan" {
+                               return fmt.Errorf("Cannot specify static MAC 
address when using fan mode")
+                       }
+
                        return validate.IsNetworkMAC(value)
                },
                "volatile.bridge.hwaddr": func(value string) error {
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to