mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-20 09:47:49 +02:00
Change network mask to limit number of peers to 65k (#339)
This commit is contained in:
parent
feff6dc966
commit
59a964eed8
@ -267,7 +267,7 @@ func TestAccountManager_AddAccount(t *testing.T) {
|
|||||||
expectedSetupKeysSize := 2
|
expectedSetupKeysSize := 2
|
||||||
expectedNetwork := net.IPNet{
|
expectedNetwork := net.IPNet{
|
||||||
IP: net.IP{100, 64, 0, 0},
|
IP: net.IP{100, 64, 0, 0},
|
||||||
Mask: net.IPMask{255, 192, 0, 0},
|
Mask: net.IPMask{255, 255, 0, 0},
|
||||||
}
|
}
|
||||||
|
|
||||||
account, err := manager.AddAccount(expectedId, userId, "")
|
account, err := manager.AddAccount(expectedId, userId, "")
|
||||||
|
@ -365,7 +365,7 @@ func toWiretrusteeConfig(config *Config, turnCredentials *TURNCredentials) *prot
|
|||||||
|
|
||||||
func toPeerConfig(peer *Peer) *proto.PeerConfig {
|
func toPeerConfig(peer *Peer) *proto.PeerConfig {
|
||||||
return &proto.PeerConfig{
|
return &proto.PeerConfig{
|
||||||
Address: peer.IP.String() + "/24", // todo make it explicit
|
Address: peer.IP.String() + "/16", // todo make it explicit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ func Test_SyncProtocol(t *testing.T) {
|
|||||||
t.Fatal("expecting SyncResponse to have NetworkMap with a non-nil PeerConfig")
|
t.Fatal("expecting SyncResponse to have NetworkMap with a non-nil PeerConfig")
|
||||||
}
|
}
|
||||||
|
|
||||||
if networkMap.GetPeerConfig().GetAddress() != "100.64.0.1/24" {
|
if networkMap.GetPeerConfig().GetAddress() != "100.64.0.1/16" {
|
||||||
t.Fatal("expecting SyncResponse to have NetworkMap with a PeerConfig having valid Address")
|
t.Fatal("expecting SyncResponse to have NetworkMap with a PeerConfig having valid Address")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ var _ = Describe("Management service", func() {
|
|||||||
err = encryption.DecryptMessage(serverPubKey, key, encryptedResponse.Body, resp)
|
err = encryption.DecryptMessage(serverPubKey, key, encryptedResponse.Body, resp)
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
|
|
||||||
Expect(resp.PeerConfig.Address).To(BeEquivalentTo("100.64.0.1/24"))
|
Expect(resp.PeerConfig.Address).To(BeEquivalentTo("100.64.0.1/16"))
|
||||||
|
|
||||||
expectedSignalConfig := &mgmtProto.HostConfig{
|
expectedSignalConfig := &mgmtProto.HostConfig{
|
||||||
Uri: "signal.wiretrustee.com:10000",
|
Uri: "signal.wiretrustee.com:10000",
|
||||||
|
@ -33,7 +33,7 @@ type Network struct {
|
|||||||
func NewNetwork() *Network {
|
func NewNetwork() *Network {
|
||||||
return &Network{
|
return &Network{
|
||||||
Id: xid.New().String(),
|
Id: xid.New().String(),
|
||||||
Net: net.IPNet{IP: net.ParseIP("100.64.0.0"), Mask: net.IPMask{255, 192, 0, 0}},
|
Net: net.IPNet{IP: net.ParseIP("100.64.0.0"), Mask: net.IPMask{255, 255, 0, 0}},
|
||||||
Dns: "",
|
Dns: "",
|
||||||
Serial: 0}
|
Serial: 0}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user