[L3][port_forwarding] two different protocols can not have the same internal/external port number at the same time

Bug #1799155 reported by LIU Yulong
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
LIU Yulong

Bug Description

ENV: devstack master

Floating IP port_forwardings with different protocols can not have the same internal or external port number to the same vm_port. But we can have different application server, for instance TCP server and UDP server, listen to the same port at same time.

For instance, if you create a port_forwarding to a floating IP with the following input:
{"port_forwarding":
{
"internal_port_id": "3145b56c-949d-45d4-9e35-614117b5f69c",
"internal_port": 22,
"protocol": "tcp",
"external_port": 22,
"internal_ip_address": "192.168.188.3"
}
}

And then add another port_forwarding with protocol to udp and internal port number 22 again:
{"port_forwarding":
{
"internal_port_id": "3145b56c-949d-45d4-9e35-614117b5f69c",
"internal_port": 22,
"protocol": "udp",
"external_port": 2222,
"internal_ip_address": "192.168.188.3"
}
}

The neutron will return 40x error.

This is the key point, these unique constraints do not consider the protocol:
https://github.com/openstack/neutron/blob/master/neutron/db/migration/alembic_migrations/versions/rocky/expand/867d39095bf4_port_forwarding.py#L53-L58

summary: - [l3][port_forwarding] tow different protocols can not have the same
+ [l3][port_forwarding] two different protocols can not have the same
internal/external port number at the same time
Changed in neutron:
status: New → Confirmed
importance: Undecided → Medium
summary: - [l3][port_forwarding] two different protocols can not have the same
+ [L3][port_forwarding] two different protocols can not have the same
internal/external port number at the same time
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/613549

Changed in neutron:
assignee: nobody → LIU Yulong (dragon889)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/613549
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=e17dac3ae9f64d726db7cee20c492b3507350349
Submitter: Zuul
Branch: master

commit e17dac3ae9f64d726db7cee20c492b3507350349
Author: lizheng <email address hidden>
Date: Thu Oct 11 14:17:30 2018 +0800

    Add protocol to port_forwarding uniq constraint

    Floating IP port forwardings with different protocols can not have
    the same internal or external port number to the same VM port. But
    we can have different application servers, for instance TCP server
    and UDP server, listen to the same port at same time.

    This patch adds the protocol attribute to the DB uniq constraint
    to allow creating different protocol port forwardings with same
    internal or external port number.

    Co-Authored-By: LIU Yulong <email address hidden>
    Closes-Bug: #1799155
    Change-Id: Ifbb5f3ee2473aac98982bff0d2e6bb9b3e5ab5d6

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 14.0.0.0b1

This issue was fixed in the openstack/neutron 14.0.0.0b1 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.