[lxc-devel] [lxd/master] Network: Fixes inconsistency between normal bridge and fan bridge default ipv4.nat value

tomponline on Github lxc-bot at linuxcontainers.org
Thu Oct 15 16:08:57 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 481 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20201015/a6e508fe/attachment.bin>
-------------- next part --------------
From a57eb849b32ecee6aa726493e5d9784576405367 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Thu, 15 Oct 2020 17:07:16 +0100
Subject: [PATCH] lxd/network/driver/bridge: Fixes inconsistency between normal
 bridge and fan bridge default ipv4.nat value

Normal bridge (and docs) say if unset, the default is false, however the fan bridge was defaulting to true if unset.

Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
---
 lxd/network/driver_bridge.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/network/driver_bridge.go b/lxd/network/driver_bridge.go
index c1c1b6dea0..e0d8779072 100644
--- a/lxd/network/driver_bridge.go
+++ b/lxd/network/driver_bridge.go
@@ -1169,7 +1169,7 @@ func (n *bridge) setup(oldConfig map[string]string) error {
 		}
 
 		// Configure NAT.
-		if n.config["ipv4.nat"] == "" || shared.IsTrue(n.config["ipv4.nat"]) {
+		if shared.IsTrue(n.config["ipv4.nat"]) {
 			if n.config["ipv4.nat.order"] == "after" {
 				err = n.state.Firewall.NetworkSetupOutboundNAT(n.name, overlaySubnet, nil, true)
 				if err != nil {


More information about the lxc-devel mailing list