fix: CompareIpByte skips invalid IP bytes instead of using zero-value IP - #1909
fix: CompareIpByte skips invalid IP bytes instead of using zero-value IP#1909bhumikadangayach wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
There is one commit incorrectly signed off. This means that the author of this commit failed to include a Signed-off-by line in the commit message. To avoid having PRs blocked in the future, always include Signed-off-by: Author Name authoremail@example.com in every commit message. You can also do this automatically by using the -s flag (i.e., git commit -s). Here is how to fix the problem so that this code can be merge |
Signed-off-by: Bhumika Dangayach <139267865+bhumikadangayach@users.noreply.github.com>
2474a17 to
21ceff1
Compare
Fixes #1908
CompareIpByte logged an error on invalid IP bytes but didn't stop - the zero-value IP's String() ("invalid IP") was used as a map key anyway, so multiple malformed entries would collide under the same key, and a malformed entry in one side could incorrectly match against one left over from the other side.
Added continue after the error log in both loops, so malformed entries are skipped entirely instead of participating in the comparison.
Added a test case covering malformed entries mixed with valid ones on both sides, verifying the diff result only reflects genuine IP comparisons.