Page MenuHomeFreeBSD

tests: routing: Add address with same prefix present
Needs ReviewPublic

Authored by jlduran on Nov 15 2024, 12:30 AM.
Tags
None
Referenced Files
F106148361: D47585.id.diff
Thu, Dec 26, 4:52 AM
F106138945: D47585.id146479.diff
Thu, Dec 26, 1:12 AM
F106131398: D47585.diff
Wed, Dec 25, 10:21 PM
Unknown Object (File)
Tue, Dec 17, 12:41 AM
Unknown Object (File)
Wed, Dec 11, 5:45 PM
Unknown Object (File)
Sat, Dec 7, 11:33 PM
Unknown Object (File)
Sat, Dec 7, 6:09 PM
Unknown Object (File)
Nov 21 2024, 11:20 AM

Details

Reviewers
ae
emaste
melifaro
zlei
Group Reviewers
network
Summary

Add a test for the fix: when adding an address to an interface with the
same prefix already present in the routing table.

Test Plan
/usr/tests # kyua test sys/net/routing/test_routing_l3.py
sys/net/routing/test_routing_l3.py:TestIfOps::test_add_address_same_prefix_present[inet6]  ->  passed  [0.221s]
sys/net/routing/test_routing_l3.py:TestIfOps::test_add_address_same_prefix_present[inet]  ->  passed  [0.255s]
...

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 60575
Build 57459: arc lint + arc unit

Event Timeline

Do we understand why this test is failing? Is it a test bug or does this represent a real bug in the commit?

Do we understand why this test is failing? Is it a test bug or does this represent a real bug in the commit?

If we set aside the fact that the same test for IPv6 has always been skipped:
The commit fixes this test (the one in the bug reports and in this review), by replacing pinned routes. When assigning to an interface an IPv4 address on the same subnet as another interface, it will replace the (pinned) route with the new interface, therefore failing the first check within the test. That is, it should have kept the first interface, according to the test. I don't know what to think about this one, up to this point, I would even consider it OK-ish.
However, the second part of the test, if we destroy the first second [EDIT] interface, that's where the problem is IMO. The route pointing to the first interface should be back.
I do not fully understand that test TBH, it looks like a lagg test or similar. I'm also not familiar with assigning IPv4 addresses on the same subnet to different interfaces, just like that. That's why, perhaps skipping both (IPv6 and v4) in the meantime would be my suggestion. So yes, I would guess it could be a test bug (just like it has always been for IPv6). I can't immediately see a real-life scenario to support it.

IMHO when we already have an interface route, we should fail on trying to add the same route on different interface. And I think this should fail even before adding route, when an IP address will be configured.
If you want to test the case that was fixed in D47534 you need to add some static route, then configure interface route that will replace this static route, because interface route has higher priority.