cloud-setup: don't require delimiter in 'nmcs_utils_hwaddr_normalize'

Azure gives MAC address without delimiter. So, make the normalize function
more liberal so that it can accept this format.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/576
This commit is contained in:
Sayed Shah 2020-07-13 15:22:16 -04:00 committed by Thomas Haller
parent aa4cb0e5eb
commit e3cd3b73ed
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -501,8 +501,7 @@ nmcs_utils_hwaddr_normalize (const char *hwaddr, gssize len)
nm_assert (hwaddr);
hwaddr = nm_strndup_a (300, hwaddr, len, &hwaddr_clone);
}
if (!nm_utils_hwaddr_aton (hwaddr, buf, sizeof (buf)))
if(!nm_utils_hexstr2bin_full (hwaddr, FALSE, FALSE, ":-", sizeof (buf), buf, sizeof (buf), NULL))
return NULL;
return nm_utils_hwaddr_ntoa (buf, sizeof (buf));