[caclmgrd] Get first VLAN host IP address via next()#4685
Merged
lguohan merged 1 commit intosonic-net:masterfrom Jun 2, 2020
jleveque:fix_caclmgrd
Merged
[caclmgrd] Get first VLAN host IP address via next()#4685lguohan merged 1 commit intosonic-net:masterfrom jleveque:fix_caclmgrd
lguohan merged 1 commit intosonic-net:masterfrom
jleveque:fix_caclmgrd
Conversation
Collaborator
|
i am not sure this is a bug, ipv6 subnet range is huge! definitely need to switch to iterator. |
lguohan
approved these changes
Jun 2, 2020
abdosi
pushed a commit
that referenced
this pull request
Jun 3, 2020
I found that with IPv4Network types, calling list(ip_ntwrk.hosts()) is reliable. However, when doing the same with an IPv6Network, I found that the conversion to a list can hang indefinitely. This appears to me to be a bug in the ipaddress.IPv6Network implementation. However, I could not find any other reports on the web. This patch changes the behavior to call next() on the ip_ntwrk.hosts() generator instead, which returns the IP address of the first host.
yxieca
pushed a commit
that referenced
this pull request
Jun 9, 2020
I found that with IPv4Network types, calling list(ip_ntwrk.hosts()) is reliable. However, when doing the same with an IPv6Network, I found that the conversion to a list can hang indefinitely. This appears to me to be a bug in the ipaddress.IPv6Network implementation. However, I could not find any other reports on the web. This patch changes the behavior to call next() on the ip_ntwrk.hosts() generator instead, which returns the IP address of the first host.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found that with IPv4Network types, calling
list(ip_ntwrk.hosts())is reliable. However, when doing the same with an IPv6Network, I found that the conversion to a list can hang indefinitely. This appears to me to be a bug in the ipaddress.IPv6Network implementation. However, I could not find any other reports on the web.This patch changes the behavior to call
next()on theip_ntwrk.hosts()generator instead, which returns the IP address of the first host.