Details
-
Bug
-
Status: Resolved
-
Resolution: Cannot Reproduce
-
None
-
None
-
None
-
Operating System: All
Platform: All
-
3050
Description
The plugin presently has no checks that the values passed by the user to the matchbuilders are canonical.
As a result if you pass any of the following (actual examples of error values taken from the tests):
10.0.0.1/24 - the switch will install 10.0.0.0/24 and return 10.0.0.0/24 on opstate query
10.0.0.2/20 - the switch will install 10.0.0.0/20 and return 10.0.0.0/20 on opstate query
1234:5678:9ABC:DEF0:FDCD:A987:6543:0/8 - the switch will install 1200::/8
So actually our own tests are an example of how to achieve opstate != conf state as that is exactly what would happen if someone plugs these values from nortbound.
I can try "shopping around" for an implementation of a switch which is as broken as us, but I am having trouble with finding one. Anything I try given a 10.0.0.1/24 stubbornedly returns 10.0.0.0/24.
The real fix for this should be in the MD-SAL and yangtools, however as long as they are not being fixed we should probably raise an InvalidArgument if passed anything like these values.
In the meantime, the tests should be fixed to (at least) pass valid values and check for valid values.