Skip to content

[caclmgrd] Get first VLAN host IP address via next()#4685

Merged
lguohan merged 1 commit intosonic-net:masterfrom
jleveque:fix_caclmgrd
Jun 2, 2020
Merged

[caclmgrd] Get first VLAN host IP address via next()#4685
lguohan merged 1 commit intosonic-net:masterfrom
jleveque:fix_caclmgrd

Conversation

@jleveque
Copy link
Copy Markdown
Contributor

@jleveque jleveque commented Jun 2, 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.

@jleveque jleveque requested a review from lguohan June 2, 2020 06:57
@jleveque jleveque self-assigned this Jun 2, 2020
@lguohan
Copy link
Copy Markdown
Collaborator

lguohan commented Jun 2, 2020

i am not sure this is a bug, ipv6 subnet range is huge! definitely need to switch to iterator.

@lguohan lguohan merged commit 7b80377 into sonic-net:master 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.
@jleveque jleveque deleted the fix_caclmgrd branch July 24, 2020 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants