From e3cd3b73ed8b517e132f53bd7f2bcc4c59fdf36e Mon Sep 17 00:00:00 2001 From: Sayed Shah Date: Mon, 13 Jul 2020 15:22:16 -0400 Subject: [PATCH] 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 --- clients/cloud-setup/nm-cloud-setup-utils.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/clients/cloud-setup/nm-cloud-setup-utils.c b/clients/cloud-setup/nm-cloud-setup-utils.c index 5705c63179..a244e07c01 100644 --- a/clients/cloud-setup/nm-cloud-setup-utils.c +++ b/clients/cloud-setup/nm-cloud-setup-utils.c @@ -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));