After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 736275 - [PATCH] master nmcli is unable to validate a MAC address
[PATCH] master nmcli is unable to validate a MAC address
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: nmcli
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-09-08 17:06 UTC by Lubomir Rintel
Modified: 2014-09-09 09:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Suggested fix (6.78 KB, patch)
2014-09-08 17:06 UTC, Lubomir Rintel
rejected Details | Review
cli: fix MAC address validation (971 bytes, patch)
2014-09-08 18:16 UTC, Dan Winship
none Details | Review

Description Lubomir Rintel 2014-09-08 17:06:02 UTC
Created attachment 285663 [details] [review]
Suggested fix

[lkundrak@fedora20-1 NetworkManager]$ clients/cli/nmcli c add con-name yolo type bluetooth ifname '*' addr 40:98:4E:68:DF:80 bt-type dun-gsm
Error: 'addr': '40:98:4E:68:DF:80' is not a valid Ethernet MAC address.
Comment 1 Dan Winship 2014-09-08 18:15:51 UTC
Comment on attachment 285663 [details] [review]
Suggested fix

I left check_mac() taking an arptype rather than a length because it seemed wrong to assume that InfiniBand would always be the only arptype whose addresses were INFINIBAND_ALEN long.
Comment 2 Dan Winship 2014-09-08 18:16:49 UTC
Created attachment 285668 [details] [review]
cli: fix MAC address validation

(broken by 3a54d050985d6ef2067b025571910a8ccd3cbd57)
Comment 3 Jiri Klimes 2014-09-09 06:43:59 UTC
Good catch, Lubomir.

Currently, the only recognized types are ARPHRD_ETHER and ARPHRD_INFINIBAND. And nm_utils_hwaddr_len() only accepts them. So both patches would work fine. But let's proceed with danw's one as it is shorter and more future-proof.
Comment 4 Lubomir Rintel 2014-09-09 08:32:19 UTC
Agreed.
Comment 5 Jiri Klimes 2014-09-09 09:25:35 UTC
730d096 cli: fix MAC address validation (bgo #736275)