Skip to content

Commit 5f184d4

Browse files
TuxPowered42kofrezo
authored andcommitted
Fix supernet calculation, the network can also equal
1 parent f429854 commit 5f184d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

serveradmin/serverdb/query_materializer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def _add_supernet_attribute(self, attribute: Attribute, servers_in):
204204

205205
def _add_supernet_attribute_af(self, attribute, servers_in):
206206
supernet_id = ServerInetAttribute.objects.filter(
207-
value__net_contains=OuterRef("value"),
207+
value__net_contains_or_equals=OuterRef("value"),
208208
server__servertype_id=attribute.target_servertype_id,
209209
attribute__inet_address_family=attribute.inet_address_family,
210210
).values("server__server_id")
@@ -229,7 +229,7 @@ def _add_supernet_attribute_intern_ip(self, attribute, servers):
229229
servers_in_1, servers_in_2 = itertools.tee(servers)
230230

231231
supernet_id = Server.objects.filter(
232-
intern_ip__net_contains=OuterRef("intern_ip"),
232+
intern_ip__net_contains_or_equals=OuterRef("intern_ip"),
233233
servertype_id=attribute.target_servertype_id,
234234
).values("server_id")
235235

0 commit comments

Comments
 (0)