-
Bug
-
Resolution: Won't Do
-
Normal
-
None
-
4.13.z, 4.14.z, 4.15.z, 4.16.z
-
Moderate
-
None
-
Rejected
-
False
-
Description
The parseIPList function currently fails to handle IP lists that contain both valid and invalid IPs or CIDRs. When the function encounters an invalid entry, it immediately returns an empty string, which prevents any valid IPs from being processed or returned.
Expected Behavior
- The function should process the entire list of IPs or CIDRs.
- It should return a string of all valid IPs and CIDRs, even if there are some invalid entries.
- Invalid entries should be logged for debugging purposes, but they should not cause the function to exit prematurely.
Current Behavior
- The function returns an empty string as soon as it encounters an invalid IP or CIDR.
- No valid IPs are returned if any invalid entries are found.
Steps to Reproduce
- Provide a list of IPs or CIDRs that includes both valid and invalid entries to the parseIPList function.
- Observe that the function returns an empty string, regardless of the valid entries present.
Suggested Solution
Modify the parseIPList function to:
- Collect valid IPs and CIDRs while logging invalid ones.
- Return a space-separated string of valid IPs and CIDRs.
- Log all invalid entries for visibility and debugging.
Additional Information
- A recent PR addresses this issue by enhancing the function to handle mixed validity lists more gracefully.
- This change improves the robustness of IP list processing and provides better insights into invalid entries.