5c27b6
From 4ff07d06055d17b19f5f43bfbefcda58931a08a5 Mon Sep 17 00:00:00 2001
5c27b6
Message-Id: <4ff07d06055d17b19f5f43bfbefcda58931a08a5@dist-git>
5c27b6
From: Laine Stump <laine@laine.org>
5c27b6
Date: Thu, 13 Apr 2017 14:29:23 -0400
5c27b6
Subject: [PATCH] util: make virMacAddrParse more versatile
5c27b6
5c27b6
Previously the MAC address text was required to be terminated with a
5c27b6
NULL. After this, it can be terminated with a space or any control
5c27b6
character.
5c27b6
5c27b6
Resolves: https://bugzilla.redhat.com/1442040 (RHEL 7.3.z)
5c27b6
Resolves: https://bugzilla.redhat.com/1415609 (RHEL 7.4)
5c27b6
5c27b6
(cherry picked from commit 30b07a425d7b5b3ac7ca68d3574692ac6415ccbe)
5c27b6
---
5c27b6
 src/util/virmacaddr.c | 2 +-
5c27b6
 1 file changed, 1 insertion(+), 1 deletion(-)
5c27b6
5c27b6
diff --git a/src/util/virmacaddr.c b/src/util/virmacaddr.c
5c27b6
index 612a409d0..7afe032b9 100644
5c27b6
--- a/src/util/virmacaddr.c
5c27b6
+++ b/src/util/virmacaddr.c
5c27b6
@@ -169,7 +169,7 @@ virMacAddrParse(const char* str, virMacAddrPtr addr)
5c27b6
 
5c27b6
         addr->addr[i] = (unsigned char) result;
5c27b6
 
5c27b6
-        if ((i == 5) && (*end_ptr == '\0'))
5c27b6
+        if ((i == 5) && (*end_ptr <= ' '))
5c27b6
             return 0;
5c27b6
         if (*end_ptr != ':')
5c27b6
             break;
5c27b6
-- 
5c27b6
2.12.2
5c27b6