[ https://issues.apache.org/jira/browse/CLOUDSTACK-10217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16318977#comment-16318977 ]
ASF GitHub Bot commented on CLOUDSTACK-10217: --------------------------------------------- rhtyd closed pull request #2393: CLOUDSTACK-10217: Clean up old MAC addresses from DHCP lease file URL: https://github.com/apache/cloudstack/pull/2393 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/systemvm/debian/opt/cloud/bin/cs_dhcp.py b/systemvm/debian/opt/cloud/bin/cs_dhcp.py index b85e650d90a..88b4b7568c5 100755 --- a/systemvm/debian/opt/cloud/bin/cs_dhcp.py +++ b/systemvm/debian/opt/cloud/bin/cs_dhcp.py @@ -25,12 +25,18 @@ def merge(dbag, data): if data['ipv4_address'] in dbag: del(dbag[data['ipv4_address']]) else: - remove_key = None + remove_keys = set() for key, entry in dbag.iteritems(): if key != 'id' and entry['host_name'] == data['host_name']: - remove_key = key + remove_keys.add(key) break - if remove_key is not None: + + for key, entry in dbag.iteritems(): + if key != 'id' and entry['mac_address'] == data['mac_address']: + remove_keys.add(key) + break + + for remove_key in remove_keys: del(dbag[remove_key]) dbag[data['ipv4_address']] = data ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > When IPv4 address of Instance is updated DHCP data is not cleared on VR > ----------------------------------------------------------------------- > > Key: CLOUDSTACK-10217 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10217 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: Virtual Router > Affects Versions: 4.10.0.0 > Environment: Basic Networking - KVM > Reporter: Wido den Hollander > Assignee: Wido den Hollander > Labels: basic-networking, dhcp, virtual-router > Fix For: 4.11.0.0 > > > When the IPv4 address of a NIC is changed the new entry is added to the DHCP > lease file in the Virtual Router, but the old entry (with the same MAC) is > not removed and this causes the Instance to still receive the old address. -- This message was sent by Atlassian JIRA (v6.4.14#64029)