Bug 1413297 - Wi-Fi connections created in Fedora <= 24 get "Cloned MAC address: permanent" in nm-connection-editor, blocking save
Summary: Wi-Fi connections created in Fedora <= 24 get "Cloned MAC address: permanent"...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: network-manager-applet
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lubomir Rintel
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-14 16:44 UTC by Matt McCutchen
Modified: 2017-09-15 03:50 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-09-15 03:50:49 UTC
Type: Bug


Attachments (Terms of Use)
Example keyfile (281 bytes, text/plain)
2017-01-14 16:44 UTC, Matt McCutchen
no flags Details

Description Matt McCutchen 2017-01-14 16:44:10 UTC
Created attachment 1240720 [details]
Example keyfile

Description of problem:
I recently upgraded from Fedora 24 to 25, and when I open one of my previously created Wi-Fi connections in nm-connection-editor, the "Save" button is disabled.  It looks like the problem is that the "Cloned MAC address" field is set to "permanent"; if I clear the field, then I can save.

It looks like this happens because the keyfile does not contain the wifi.mac-address-randomization property, so the code at https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/libnm-core/nm-keyfile-reader.c?id=1.4.2#n1324 is setting wifi.mac-address-randomization to NEVER, which causes the code at https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/libnm-core/nm-connection.c?id=1.4.2#n900 to set wifi.cloned-mac-address to "permanent".  I know the configuration format for MAC address cloning has changed in NetworkManager 1.4 (https://blogs.gnome.org/thaller/2016/08/26/mac-address-spoofing-in-networkmanager-1-4-0/) and I'm not sure how this is supposed to work or whether the NetworkManager or network-manager-applet component should be blamed.

For connections created in Fedora 25, wifi.mac-address-randomization is set to DEFAULT (0) in the keyfile and the problem doesn't occur.

Version-Release number of selected component (if applicable):
NetworkManager-1.4.2-2.fc25
network-manager-applet-1.4.0-1.fc25

How reproducible:
Always

Steps to Reproduce:
1. Save the attached keyfile (based on one I actually had before the F25 upgrade) to /etc/NetworkManager/system-connections and restart NetworkManager.
2. Open the "test" connection in nm-connection-editor.

Actual results:
The "Cloned MAC address" field says "permanent" and the "Save" button is disabled.

Expected results:
The "Save" button is enabled.  I'm not sure what the "Cloned MAC address" field should say.

Comment 1 Thomas Haller 2017-01-14 20:16:02 UTC
thanks for the analysis.

It is wrong that keyfile reader sets mac-address-randomization in absence of the field. That is fixed upstream:

master: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=46d53e11012c047e09d04f663c1c36e6c47dc298

nm-1-4: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=2a960d3936d78087d74ba556df8ac808639c96a0

This causes old keyfiles (that pre-date mac-address-randomization property) to be interpreted as 
  wifi.mac-address-randomization=1
  wifi.cloned-mac-address=permanent
as they don't specify one of the settings explicitly.


It's not too bad, because adding a new property obviously needs that we choose some value in those old connections. "permanent" is not too bad as a default value, because that is also what old versions of NetworkManager did implicitly. So, on upgrade, NetworkManager still behaves the same.
Better would be of course to leave the value unspecified. 
Because:
  - we changed the default value to no longer mean "permanent" but "preserve". So, leaving the value unspecified, allows for the desired(?) change in behavior (https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=fae5ecec5a4d9987a1915441602cb78275a9f490)
  - it allows the default value to be overwritten by global connection defaults (https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=8eed67122c58540360b617eb42d5df8328e21b5d)




Another problem is that nm-connection-editor doesn't know how to handle the special values like cloned-mac-address=permanent. It's not too bad however, because the user can delete the word "permanent" and use nm-c-e to edit the connection. Of course, he is unable to save those unsupported values, but for that he can use nmcli or nmtui.
(this is TODO)

Comment 2 Thomas Haller 2017-01-14 20:20:35 UTC
(In reply to Thomas Haller from comment #1)
>   - we changed the default value to no longer mean "permanent" but
> "preserve". So, leaving the value unspecified, allows for the desired(?)
> change in behavior
> (https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/
> ?id=fae5ecec5a4d9987a1915441602cb78275a9f490)

(btw, the change of the final fallback for the default value of cloned-mac-adress from "permanent" to "preserve" will be part of 1.6.0. It will not reach Fedora 25 (but Fedora 26+).

Comment 3 Matt McCutchen 2017-01-14 21:13:53 UTC
So is the idea that https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=2a960d3936d78087d74ba556df8ac808639c96a0 will be released to Fedora 25 and this bug will go away as a consequence?

Comment 4 Fedora Update System 2017-01-14 21:52:03 UTC
NetworkManager-1.4.4-3.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-3b8bd593c7

Comment 5 Thomas Haller 2017-01-14 21:53:39 UTC
(In reply to Matt McCutchen from comment #3)
> So is the idea that
> https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/
> ?id=2a960d3936d78087d74ba556df8ac808639c96a0 will be released to Fedora 25
> and this bug will go away as a consequence?

Correct. Please try NetworkManager-1.4.4-3.fc25. Thanks.

Comment 6 Matt McCutchen 2017-01-15 01:04:42 UTC
Verified that NetworkManager-1.4.4-3.fc25 fixes this bug for me.

Comment 7 Fedora Update System 2017-01-15 11:19:59 UTC
NetworkManager-1.4.4-3.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-3b8bd593c7

Comment 8 Beniamino Galvani 2017-01-16 16:40:37 UTC
(In reply to Thomas Haller from comment #1)
> Another problem is that nm-connection-editor doesn't know how to handle the
> special values like cloned-mac-address=permanent.
> (this is TODO)

Fixed upstream with commit:

https://git.gnome.org/browse/network-manager-applet/commit/?id=85b6b659a140a59c3df787062e089a0b4e2a547d

Comment 9 Fedora Update System 2017-01-16 19:52:24 UTC
NetworkManager-1.4.4-3.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Alick Zhao 2017-08-22 22:28:51 UTC
I am bitten by the same bug. I don't think it is fully fixed.

Now I know I can delete the text "permanent" in "Cloned MAC" field to make changes able to "Save". However, every time I save the changes (with an empty Cloned MAC), "MACADDR=permanent" still gets written to the ifcfg-SSID file, and next time I want to edit the connection, I need to delete "permanent" again...
This is quite annoying.

Besides, it is confusing to not able to "Save" in the GUI because of this automatic generated entry.

Finally, why is the bug still ON_QA after so many months?

Comment 11 Thomas Haller 2017-08-23 11:26:45 UTC
(In reply to Alick Zhao from comment #10)
> I am bitten by the same bug. I don't think it is fully fixed.

you don't say which version of NetworkManager/nm-connection-editor you are using. 

On Fedora25, the patch https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=7f63c875f973f3b7cc136130c61348b36e280ab6 is not present. That could cause what you describe.

Probably the workaround is to reset wifi.mac-address-randomization:
https://mail.gnome.org/archives/networkmanager-list/2017-January/msg00061.html

Comment 12 Alick Zhao 2017-08-23 15:09:57 UTC
(In reply to Thomas Haller from comment #11)
> (In reply to Alick Zhao from comment #10)
> > I am bitten by the same bug. I don't think it is fully fixed.
> 
> you don't say which version of NetworkManager/nm-connection-editor you are
> using. 

Sorry I forgot to mention, but this is a fully updated Fedora 25 laptop:

NetworkManager-1.4.4-5.fc25

network-manager-applet-1.4.0-1.fc25 (contains nm-connection-editor)

> 
> On Fedora25, the patch
> https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/
> ?id=7f63c875f973f3b7cc136130c61348b36e280ab6 is not present. That could
> cause what you describe.
> 

I think so. Would be good to make it a patch for fc25.

> Probably the workaround is to reset wifi.mac-address-randomization:
> https://mail.gnome.org/archives/networkmanager-list/2017-January/msg00061.
> html

I agree, and will test when I have access to the laptop.

Comment 13 Fedora Update System 2017-08-23 16:53:11 UTC
NetworkManager-1.4.6-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-a2f2ef5a3c

Comment 14 Thomas Haller 2017-08-23 16:53:46 UTC
please try NetworkManager-1.4.6-1.fc25

Comment 15 Fedora Update System 2017-08-24 01:52:04 UTC
NetworkManager-1.4.6-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-a2f2ef5a3c

Comment 16 Alick Zhao 2017-08-25 14:50:33 UTC
(In reply to Thomas Haller from comment #14)
> please try NetworkManager-1.4.6-1.fc25

Seems fixed with this version. Thanks!

Comment 17 Fedora Update System 2017-09-15 03:50:49 UTC
NetworkManager-1.4.6-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.