diff --git a/machines/models.py b/machines/models.py index 19d252b7..d5eb15ca 100644 --- a/machines/models.py +++ b/machines/models.py @@ -1365,11 +1365,11 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): DHCPv6). """ if preferences.models.OptionalMachine.get_cached_value("ipv6_mode") == "SLAAC": - return self.ipv6list.all() + return self.ipv6list.filter(active=True) elif ( preferences.models.OptionalMachine.get_cached_value("ipv6_mode") == "DHCPV6" ): - return self.ipv6list.filter(slaac_ip=False) + return self.ipv6list.filter(active=True).filter(slaac_ip=False) else: return [] diff --git a/preferences/models.py b/preferences/models.py index b012b12b..68b8286c 100644 --- a/preferences/models.py +++ b/preferences/models.py @@ -369,7 +369,7 @@ class OptionalTopologie(AclMixin, PreferencesModel): def return_ips_dict(interfaces): return { "ipv4": [str(interface.ipv4) for interface in interfaces], - "ipv6": Ipv6List.objects.filter(interface__in=interfaces).values_list( + "ipv6": Ipv6List.objects.filter(interface__in=interfaces).filter(active=True).values_list( "ipv6", flat=True ), } diff --git a/topologie/models.py b/topologie/models.py index 85f6d188..94ecee87 100644 --- a/topologie/models.py +++ b/topologie/models.py @@ -377,7 +377,7 @@ class Switch(Machine): def return_ips_dict(interfaces): return { "ipv4": [str(interface.ipv4) for interface in interfaces], - "ipv6": Ipv6List.objects.filter(interface__in=interfaces).values_list( + "ipv6": Ipv6List.objects.filter(interface__in=interfaces).filter(active=True).values_list( "ipv6", flat=True ), }