-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(nm): L2Only as alias of Unmanaged mode #5663
Conversation
55bb01c
to
994da41
Compare
The code looks ok to me. However, I've some doubts about the meaning of this feature. At the end, the I understand that in this way the old configurations could not work anymore, but I think that with Kura 6 we can accept a breaking change. |
@mattdibi |
Nopes. Kura will just not touch the configuration it finds. Also note that there's a little quirk with L2ONLY: it is a property of the interface and doesn't (or better "shouldn't") have any concept of layer 3 stuff. |
I agree, I believe we should only have one entry (most likely the unmanaged one) in the UI. The backend should be able to manage the old l2 property and maybe convert it to unmanaged. |
Ok, I will revert back to the 39d7aba implementation. This should work because, if IPv6 is missing (like it should in old specific-profiles Kura versions), we have the following bit of logic that fills it in: kura/kura/org.eclipse.kura.nm/src/main/java/org/eclipse/kura/nm/NMDbusConnector.java Lines 459 to 463 in c0feb0b
If, when IPv4 is set to L2ONLY, IPv6 is present in the snapshot it should match IPv4 (i.e. UNMANAGED) otherwise Kura will throw an exception (as per our offline discussion with @pierantoniomerlino). Does this look ok for everybody? After this I will remove the "L2ONLY" entry from the UI. |
After testing I found out that my assumption in #5663 (comment) were wrong: if IPv6 is missing from the snapshot it gets automatically This should not break compatibility with older snapshot. |
...test/org.eclipse.kura.nm.test/src/test/java/org/eclipse/kura/nm/KuraInterfaceStatusTest.java
Show resolved
Hide resolved
This reverts commit 7fff65f.
854172b
to
f621158
Compare
This PR fixes the behaviour of the
netIPv4StatusL2Only
/netIPv6StatusL2Only
parameter.Up until now
netIPvXStatusL2Only
was not correctly supported in our codebase in our generic profiles. See:kura/kura/org.eclipse.kura.nm/src/main/java/org/eclipse/kura/nm/NMDbusConnector.java
Lines 87 to 88 in ca95dd7
This meant that, when configured as
netIPvXStatusL2Only
, Kura would quit configuration without touching the interface. Seekura/kura/org.eclipse.kura.nm/src/main/java/org/eclipse/kura/nm/NMDbusConnector.java
Lines 467 to 472 in ca95dd7
This behaviour technically still obtains the desired configuration (interface is up and the user is free to configure it) but is not quite correct.
This PR simply promotes
netIPv4StatusL2Only
to an alias ofnetIPv4StatusUnmanaged
thus obtaining the expected behaviour.Note: To preserve the compatibility with older Kura versions and the old-networking profiles, specifying only IPv4 as "L2Only" will suffice to set the whole interface as "Unmanaged". This is due to the fact that originally, there was no IPv6 support.
For "Unmanaged" we require users to set both IPv4 and IPv6 as "Unmanaged" otherwise we will throw an error. This is because "Unmanaged" is a property of the whole network interface not only the IPv4/6 part of the settings. The same applies for L2Only but, requiring the IPv4 and IPv6 status to be both set to L2Only would break compatibility with old snapshots.
@pierantoniomerlino I have only one doubt: currently, if the IPv6 status is
UNKNOWN
the method won't throw an exception. The original idea was to throw an exception when any of the statuses wasUNKNOWN
but, if we do withL2ONLY
, we might risk breaking existing snapshots? What do you think?You can use the introduced tests to understand what's going on.