← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1738371] Re: Neutron API port range validation not working correctly

 

Reviewed:  https://review.openstack.org/528205
Committed: https://git.openstack.org/cgit/openstack/neutron-lib/commit/?id=4c49003bb8aa08bde8d8d760d7435d6c48609709
Submitter: Zuul
Branch:    master

commit 4c49003bb8aa08bde8d8d760d7435d6c48609709
Author: Hunt Xu <mhuntxu@xxxxxxxxx>
Date:   Fri Dec 15 16:28:34 2017 +0800

    Fix port comparison in port range validation
    
    Ports are compared as integers.
    
    Change-Id: Icfe0c101f5095a779580ea3794d2e7c939b12af5
    Closes-Bug: #1738371


** 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/1738371

Title:
  Neutron API port range validation not working correctly

Status in neutron:
  Fix Released

Bug description:
  Neutron API port range validation is not working correctly.

  In neutron-api, when doing port range validation, we compares min_port
  and max_port as strings. Which leads to wrong port range specification
  could pass the validation successfully.

  * Step-by-step reproduction steps:
    1. create a firewall rule with wrong port range specification:
       openstack firewall group rule create --source-port 1111:9 --protocol tcp

  * Expected output:
    - "Invalid input for source_port. Reason: First port in a port range must be lower than the second port."
    - This is the error message from neutron API port range validator.

  * Actual output:
    - "Invalid value for port 1111:9."
    - This is the error message from FWaaS exception InvalidPortValue, which means that the problematic port range specification passed the API validation.

  * Version:
    - neutron-lib 1.11.0 installed from PyPI as a requirement.

  * Environment:
    - devstack with FWaaS(master commit 66d3d57ac4fd8630b757d343106de7e974afe698, Oct 25, 2017)

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1738371/+subscriptions


References