Skip to contentSkip to conversation

virt: Revert only update macaddr cache when capture dhcp ACK pkt

PATCH New Lucas Meneghel Rodrigues 1 participant 1 message Oct 24, 2011 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virt: Revert only update macaddr cache when capture dhcp ACK pkt

Revert commit d9bab5bef598b4b415d004eb62e9cd32c3243565, that changes how the macaddr cache is updated. This patch brought a lot of regressions on our internal tests, so it'll be dropped until a possibly safer version of the fix is proposed.

---
 client/virt/virt_env_process.py |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
client/virt/virt_env_process.py +2 -8
index a1ec07a..25285b8 100644
@@ -403,20 +403,14 @@ def _update_address_cache(address_cache, line):
             address_cache["last_seen"] = matches[0]
     if re.search("Client.Ethernet.Address", line, re.IGNORECASE):
         matches = re.findall(r"\w*:\w*:\w*:\w*:\w*:\w*", line)
-        if matches:
-            address_cache["last_mac"] = matches[0]
-    if re.search("DHCP-Message", line, re.IGNORECASE):
-        matches = re.findall(r"ACK", line)
-        if matches and (address_cache.get("last_seen") and
-                        address_cache.get("last_mac")):
-            mac_address = address_cache.get("last_mac").lower()
+        if matches and address_cache.get("last_seen"):
+            mac_address = matches[0].lower()
             if time.time() - address_cache.get("time_%s" % mac_address, 0) > 5:
                 logging.debug("(address cache) Adding cache entry: %s ---> %s",
                               mac_address, address_cache.get("last_seen"))
             address_cache[mac_address] = address_cache.get("last_seen")
             address_cache["time_%s" % mac_address] = time.time()
             del address_cache["last_seen"]
-            del address_cache["last_mac"]
 
 
 def _take_screendumps(test, params, env):
Signature · 1 line
1.7.7