[PR #2502] [MERGED] Fix the handling of shared IPs (VIP, VRRF, etc.) when unique IP space enforcement is set. #12396

Closed
opened 2025-12-29 22:21:16 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/2502
Author: @knobix
Created: 10/8/2018
Status: Merged
Merged: 11/5/2018
Merged by: @jeremystretch

Base: developHead: 2501_fix_shared_ips


📝 Commits (1)

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 netbox/ipam/models.py (+2 -2)

📄 Description

Fixes: #2501

It's not possible to create duplicate shared IPs in a VRF when unique IP space enforcement is on.

This is due missing parentheses around the whole logical-OR statement which causes "[...] or (
self.vrf and self.vrf.enforce_unique)
" to be always true and thus goes further to the duplicate IP address check instead of skipping this check.

Add parentheses for the logical OR-statement that checks the conditions if unique IP space enforcement is on and if the IP address is duplicate.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/2502 **Author:** [@knobix](https://github.com/knobix) **Created:** 10/8/2018 **Status:** ✅ Merged **Merged:** 11/5/2018 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `2501_fix_shared_ips` --- ### 📝 Commits (1) - [`ce4ef7c`](https://github.com/netbox-community/netbox/commit/ce4ef7c8b2087d5014677c320a60d9c7fd763cd4) Update models.py ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `netbox/ipam/models.py` (+2 -2) </details> ### 📄 Description ### Fixes: #2501 It's not possible to create duplicate shared IPs in a VRF when unique IP space enforcement is on. This is due missing parentheses around the whole logical-OR statement which causes "**[...] or ( self.vrf and self.vrf.enforce_unique)**" to be always true and thus goes further to the duplicate IP address check instead of skipping this check. Add parentheses for the logical OR-statement that checks the conditions if unique IP space enforcement is on and if the IP address is duplicate. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:21:16 +01:00
adam closed this issue 2025-12-29 22:21:16 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12396