GNOME Bugzilla – Bug 736275
[PATCH] master nmcli is unable to validate a MAC address
Last modified: 2014-09-09 09:25:35 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 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.
Created attachment 285668 [details] [review] cli: fix MAC address validation (broken by 3a54d050985d6ef2067b025571910a8ccd3cbd57)
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.
Agreed.
730d096 cli: fix MAC address validation (bgo #736275)