The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/6859
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) === Signed-off-by: Free Ekanayaka <free.ekanay...@canonical.com>
From 29966798bd0a0585939d56f060e348e33e18ddfe Mon Sep 17 00:00:00 2001 From: Free Ekanayaka <free.ekanay...@canonical.com> Date: Mon, 10 Feb 2020 09:57:00 +0000 Subject: [PATCH] Consider the default port when checking address overlap Signed-off-by: Free Ekanayaka <free.ekanay...@canonical.com> --- lxd/util/net.go | 3 +++ lxd/util/net_test.go | 1 + 2 files changed, 4 insertions(+) diff --git a/lxd/util/net.go b/lxd/util/net.go index 154a0d98f5..af99fc98cd 100644 --- a/lxd/util/net.go +++ b/lxd/util/net.go @@ -138,6 +138,9 @@ func NetworkInterfaceAddress() string { // address2, in the sense that they are either the same address or address2 is // specified using a wildcard with the same port of address1. func IsAddressCovered(address1, address2 string) bool { + address1 = CanonicalNetworkAddress(address1) + address2 = CanonicalNetworkAddress(address2) + if address1 == address2 { return true } diff --git a/lxd/util/net_test.go b/lxd/util/net_test.go index 6c75a06ed0..e79ace9c3b 100644 --- a/lxd/util/net_test.go +++ b/lxd/util/net_test.go @@ -71,6 +71,7 @@ func TestIsAddressCovered(t *testing.T) { {"[::1]:8443", ":8443", true}, {":8443", "[::]:8443", true}, {"0.0.0.0:8443", "[::]:8443", true}, + {"10.30.0.8:8443", "[::]", true}, } // Test some localhost cases too
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel