From 05e7de59256798e72034845d7df4dd8d05b3e3c1 Mon Sep 17 00:00:00 2001 From: Alexey Shapovalov Date: Tue, 14 Apr 2020 14:37:53 +0100 Subject: [PATCH] Fix IPAM prefix validation #1288 --- services/web/apps/ip/ipam/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/apps/ip/ipam/views.py b/services/web/apps/ip/ipam/views.py index 5448e9b7fc..0c67fc21bd 100644 --- a/services/web/apps/ip/ipam/views.py +++ b/services/web/apps/ip/ipam/views.py @@ -113,7 +113,7 @@ class IPAMApplication(ExtApplication): """ # Validate vrf = self.get_object_or_404(VRF, id=int(vrf_id)) - if (afi == "4" and (not is_ipv4_prefix(prefix)) or not vrf.afi_ipv4) or ( + if (afi == "4" and (not is_ipv4_prefix(prefix) or not vrf.afi_ipv4)) or ( afi == "6" and (not is_ipv6_prefix(prefix) or not vrf.afi_ipv6) ): return self.response_forbidden("Invalid prefix") -- GitLab