yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #49176
[Bug 1567472] Re: net_helpers.get_free_namespace_port can return used ports
Reviewed: https://review.openstack.org/302913
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=d5ae8645ccfe12fb2fd99f412821ad1556e06191
Submitter: Jenkins
Branch: master
commit d5ae8645ccfe12fb2fd99f412821ad1556e06191
Author: Assaf Muller <amuller@xxxxxxxxxx>
Date: Thu Apr 7 10:21:46 2016 -0400
Fix regexp for ss output
Previously we ignored when destination address was replaced by
asterisk.
Co-Authored-By: amuller@xxxxxxxxxx
Change-Id: I68bbd43c1b98e5f21d2cbf7dc33a8bdccbb70bd0
Closes-Bug: 1567472
** Changed in: neutron
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1567472
Title:
net_helpers.get_free_namespace_port can return used ports
Status in neutron:
Fix Released
Bug description:
Here's a simplification of 'get_free_namespace_port':
output = ip_wrapper.netns.execute(['ss', param])
used_ports = _get_source_ports_from_ss_output(output) # Parses 'ss' output and gets all used ports, this is the problematic part
return get_unused_port(used_ports)
Here's a demonstration:
output = ip_wrapper.netns.execute(['ss', param])
print output
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 10 127.0.0.1:6640 *:*
LISTEN 0 128 *:46675 *:*
LISTEN 0 128 *:22 *:*
LISTEN 0 128 *:5432 *:*
LISTEN 0 128 *:3260 *:*
LISTEN 0 50 *:3306 *:*
ESTAB 0 36 10.0.0.202:22 10.0.0.44:45258
ESTAB 0 0 127.0.0.1:32965 127.0.0.1:4369
ESTAB 0 0 10.0.0.202:22 10.0.0.44:36104
LISTEN 0 128 :::80 :::*
LISTEN 0 128 :::4369 :::*
LISTEN 0 128 :::22 :::*
LISTEN 0 128 :::5432 :::*
LISTEN 0 128 :::3260 :::*
LISTEN 0 128 :::5672 :::*
ESTAB 0 0 ::ffff:127.0.0.1:4369 ::ffff:127.0.0.1:32965
used = net_helpers._get_source_ports_from_ss_output(output)
print used
{'22', '3260', '32965', '4369', '5432', '5672', '80'}
You can see it returned '3260' but not '3306'.
This bug can impact how fullstack picks which free ports to use for
neutron-server and neutron-openvswitch-agent.
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1567472/+subscriptions
References